[Solved] Code_Device, BinarySwitch, state not updated

Discussions about RaZberry - Z-Wave board for Raspberry computer
Post Reply
billyboy
Posts: 61
Joined: 16 Mar 2013 21:33

[Solved] Code_Device, BinarySwitch, state not updated

Post by billyboy »

If i update the Code_Device from a webpage, like:
http://127.0.0.1:8083/ZAutomation/api/v ... command/on
the state of device in the z-way-ha interface is not updated. The device is switched on but the UI shows off.
Before with a previous version I didn't had this problem.
When the device is switched on the javaScript function setPortState(8,1) is execute.
Maybe I need the return a value, but what?? Can't find it in the documentation.
Also at a server startup the state of the device is not requested.
Last edited by billyboy on 24 Jun 2015 10:37, edited 2 times in total.
billyboy
Posts: 61
Joined: 16 Mar 2013 21:33

Re: [v2.0.1-rc25] Code_Device, BinarySwitch, state not updat

Post by billyboy »

I tried to go back and install older versions up to 2.0.0 but none update the switch state correct.

can nobody help me?
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: [v2.0.1-rc25] Code_Device, BinarySwitch, state not updat

Post by pz1 »

What switch do you have? Some do have temporary problems. In the recipes section is a [devices] topic on failing staus reports.
Won't cure every problem though. I do have some nasty Zwave.Me switches that have stopped sending status updates, even though they are associated with the Zwave controller (have you checked that for your device?)
billyboy
Posts: 61
Joined: 16 Mar 2013 21:33

Re: [v2.0.1-rc25] Code_Device, BinarySwitch, state not updat

Post by billyboy »

Like I said in the first post, it's a code device. Not a real z-wave device. switching this device executes javascipt code.
This code sets or reads the state of a shiftregister connected to my Raspberry. To that shift register are 8 relais connected. This way I can control 8 devices.
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: [v2.0.1-rc25] Code_Device, BinarySwitch, state not updat

Post by pz1 »

Sorry, I indeed missed the importance of the first line of your first post :oops:
Maybe this post viewtopic.php?f=3422&t=21472 can help you? I haven't had the time to try it myself.
billyboy
Posts: 61
Joined: 16 Mar 2013 21:33

Re: [v2.0.1-rc25] Code_Device, BinarySwitch, state not updat

Post by billyboy »

I am using rc33 now and still the same issue.
If I click on a Code_Device_switchBinary in the webinterface, the lamp hooked up to that Code_Device_switchBinary is switched, but the state on the website stays grey.
Only after a periodically get state command, the state on the website is showing the right state.
I tried returning true (from the set function) and much more but still the same problem.

Please help
billyboy
Posts: 61
Joined: 16 Mar 2013 21:33

Re: Code_Device, BinarySwitch, state not updated

Post by billyboy »

Is ther nobody who can/will help me? PoltoS?
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: Code_Device, BinarySwitch, state not updated

Post by pz1 »

Still wrestling myself with the upgrade of my production system to RC35. Amongst others, I lost all names of my coded devices (though they still are in ./automation/storage/configjsonxxxx.json files under title). My automation behaves funny, and the toggleButton devices (including scenes) do not seem to work from the new UI.
User avatar
PoltoS
Posts: 7594
Joined: 26 Jan 2011 19:36

Re: Code_Device, BinarySwitch, state not updated

Post by PoltoS »

@billboy Chip'n'Dale are coming!

Note that actions and reports are handled separately in HA engine. In programmers terms setters and getters are separate.

On Action script dp not change the state of the device itself. You acn do it by setting a getter or instead setting value in the setter:

Code: Select all

vDev.set('metrics:level', value)
Note that vDev object is defined in the scope of the setter (check source code of this module).

This should do the job
CodeDeviceExample.png
CodeDeviceExample.png (21.33 KiB) Viewed 10801 times
billyboy
Posts: 61
Joined: 16 Mar 2013 21:33

Re: Code_Device, BinarySwitch, state not updated

Post by billyboy »

It worked!! Thanks PoltoS!!
Post Reply