Control z-wave device with OpenZWave

For Z-Wave related questions in Domoticz

Moderator: leecollings

Post Reply
Zorc
Posts: 4
Joined: Wednesday 11 December 2019 5:51
Target OS: Linux
Domoticz version:
Contact:

Control z-wave device with OpenZWave

Post 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?
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Control z-wave device with OpenZWave

Post 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.
Zorc
Posts: 4
Joined: Wednesday 11 December 2019 5:51
Target OS: Linux
Domoticz version:
Contact:

Re: Control z-wave device with OpenZWave

Post by Zorc »

:-) thank you for pointing me in the right direction, I'll look into that!
Zorc
Posts: 4
Joined: Wednesday 11 December 2019 5:51
Target OS: Linux
Domoticz version:
Contact:

Re: Control z-wave device with OpenZWave

Post by Zorc »

:D Great, got it working with this.
Thank you!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest