Page 1 of 1

Code Device - Code to get value

Posted: 17 Apr 2017 16:18
by Tobus
Hello,
I think I have a problem with the understanding of the 'Code to get value' functionality.

What I want to to with the code device:
-state on: My smartphone is connected to my wireless lan.
-state off: My smartphone isn't connected

So I created a new code device and added to 'Code to get value' an Python script. At the moment, the script contains only:

Code: Select all

sys.stdout.write('on')
In my understanding the code device should change the status to 'on', because the return value of the script is in this case always 'on'.

The z-ware logfile shows an new entry:

Code: Select all

[2017-04-15 13:34:50.819] [I] [core] Notification: device-info (device-OnOff): {"dev":"test return","l":[0,"on"]}
But the code device is without status (eigher 'on' or 'off')

Can anybody help me?

Thanks and best regards
Tobias

Re: Code Device - Code to get value

Posted: 01 May 2017 18:40
by Tobus
Any idea?