OpenZWave command via curl

All kinds of 'OS' scripts

Moderator: leecollings

Post Reply
hamster
Posts: 42
Joined: Friday 28 April 2017 19:11
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: USA
Contact:

OpenZWave command via curl

Post by hamster »

Trying to figure out how to tell openzwave to 'test & heal' a node via curl. See screenshot for what I'm talking about. It shows the ozw control panel in domoticz.

I found this post, which partially explains it, but it tells how to set a function on a node, not how to execute a command on the controller itself.

If you're wondering "why," it's because I have an RGBW controller that will only get used during holidays for outdoor lighting, so I turn it off otherwise to save power. When I turn it back on, test & heal is the only thing I've found that works to bring the node out of the "dead" state immediately.

Let me know if I can give any more info to help solve.
Thanks!
testheal.png
testheal.png (52.81 KiB) Viewed 3067 times
hamster
Posts: 42
Joined: Friday 28 April 2017 19:11
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: USA
Contact:

Re: OpenZWave command via curl

Post by hamster »

After posting I was able to figure it out. I'll leave it here for anyone searching later.

In domoticz/www/ozwcp/cp.js you can find all the functions. I ended up doing:

Code: Select all

curl -d "fun=test&num=9&cnt=1" -X POST http://192.168.2.240:8080/ozwcp/thpost.html
for reviving the node after i power on the device and

Code: Select all

curl -d "fun=refreshnode&node=9" -X POST http://192.168.2.240:8080/ozwcp/admpost.html
for refreshing the node after powering it off, so ozw will mark it dead again and not attempt to route through it.
User avatar
user4563
Posts: 96
Joined: Tuesday 19 October 2021 17:24
Target OS: Windows
Domoticz version: 2023.2
Contact:

Re: OpenZWave command via curl

Post by user4563 »

Thank you for posting this, it's exactly what I need in my dzVents script I'm putting together. It's still the only thing to bring back a dead node.
If others need this in dzVents, make the call like this:

Code: Select all

                domoticz.openURL({
                    url = 'http://127.0.0.1:8080/ozwcp/thpost.html',
                    method = 'POST',
                    postData = "fun=test&num=38&cnt=1"
                })
The Content-Type is application/x-www-form-urlencoded but the dzVents docs only show the format for Content-Type: application/json which is different and will fail.
Domoticz 2023.2 running as a service on Windows 10 w/ Aeotec Z-Stick Gen5+, HAProxy (remote access)
Domoticz for Android
Domoticz Scenes add-on in Kodi
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests