Hi guys,
i'm trying to implement a Virtual Button to enable or disable an application using a bash script.
I've enabled on the .syscommand the directory where is the script and my On\Off command works as expected:
On: system('/opt/z-way-server/automation/scripts/lares.sh IP');
Off: system('/opt/z-way-server/automation/scripts/lares.sh D');
Status: system('/opt/z-way-server/automation/scripts/lares.sh PT');
The script launched with parameter PT report simply on/off (i've tried also with the double ') but on the GUI the Button is marked as off.. and this is the log from z-way server:
[2017-07-28 21:47:13.691] [core] Notification: device-info (device-OnOff): {"dev":"App Status","l":[0,"off"]}
[2017-07-28 21:47:13.715] [core] [BaseModule-10] Set lastLevel to 0,off for Code_Device_switchBinary_12 (was 0,off)
the message is the same also if the status is "on"
Any help?
Thanks!
Help with CodeDevice
Re: Help with CodeDevice
note that system do not just return the output of your command, but an array: ret[0] = status code, ret[1] = text. You can see it in the Z-Way reference.
So use system('/opt/z-way-server/automation/scripts/lares.sh PT')[1] instead.
So use system('/opt/z-way-server/automation/scripts/lares.sh PT')[1] instead.
Re: Help with CodeDevice
thanks!
this solved the issue
this solved the issue