Page 1 of 1

Control z-wave device with OpenZWave

Posted: Friday 13 December 2019 7:45
by Zorc
Is it possible to control a z-wave device in a script through OpenZwave node directly without using an assigned device in Domoticz?

See also this post:
https://www.domoticz.com/forum/viewtopi ... 50&t=30492

I can change device parameters in the Domoticz tab but I don't get any associated device (like an on/off switch).
In the OpenZWave control panel I can turn it on/off, is there any way I could use that to make a virtual switch in Domoticz or use in in a script?

Re: Control z-wave device with OpenZWave

Posted: Friday 13 December 2019 8:48
by Egregius
You can at least with PHP:

Code: Select all

$ch=curl_init('http://127.0.0.1:8080/ozwcp/valuepost.html');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, '103-SWITCH BINARY-user-bool-1-0=false');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));
curl_exec($ch);
103 is the IDX of the node, 1 is the instance. False=Off, True=On.
Use the developer console of your browser to find the exact string that you need to post.

Could be that you first need to do something like this to get authenticated in OZWCP:

Code: Select all

file_get_contents('http://127.0.0.1:8080/json.htm?type=openzwavenodes&idx=3',false);
3 is the IDX of your z-wave hardware.

Re: Control z-wave device with OpenZWave

Posted: Friday 13 December 2019 13:18
by Zorc
:-) thank you for pointing me in the right direction, I'll look into that!

Re: Control z-wave device with OpenZWave

Posted: Monday 16 December 2019 11:29
by Zorc
:D Great, got it working with this.
Thank you!