Is there a way to perform some sort of API call to activate scenes or switch devices outside of the GUI?
What I'm thinking here is if I have a small script that runs locally and I want it to have the ability to ask z-cloud to switch a device or scene or report the status of a device based on a local trigger is that possible?
Controlling devices via API / HTTP
Please read related posts
Z-Cloud supports external API. Read this article with detailed description of the API.Some examples are also available on th forum.
Perfect, just what I was
Perfect, just what I was looking for but not finding )
Thanks
Thanks
got it
Okay I figured it out so posting this for others too
To set a Dimmer full on
curl --user user:password --data " " "https://z-cloud.z-wave.me:port/ZWaveAPI/Run/devices[45].instances[0].commandClasses[0x26].Set(99)" -k
To set a dimmer off
curl --user user:password --data " " "https://z-cloud.z-wave.me:port/ZWaveAPI/Run/devices[45].instances[0].commandClasses[0x26].Set(0)" -k
The command can be found by opening the log window in network management turning on debug and then performing the command in the UI. The string you need should appear in there.
Still trying to figure out how I can pull the current value of the dimmer though. I can send the get command but I guess that just updates z-cloud and I then need a different command to read the updated value out.
To set a Dimmer full on
curl --user user:password --data " " "https://z-cloud.z-wave.me:port/ZWaveAPI/Run/devices[45].instances[0].commandClasses[0x26].Set(99)" -k
To set a dimmer off
curl --user user:password --data " " "https://z-cloud.z-wave.me:port/ZWaveAPI/Run/devices[45].instances[0].commandClasses[0x26].Set(0)" -k
The command can be found by opening the log window in network management turning on debug and then performing the command in the UI. The string you need should appear in there.
Still trying to figure out how I can pull the current value of the dimmer though. I can send the get command but I guess that just updates z-cloud and I then need a different command to read the updated value out.
All data is returned back using ZWaveAPIData tree
You are right, Get() command just put a new job in the queue. It will be out as soon as it will reach it's turn and the device will (but not obliged to!) respond in some time.Our Z-Wave stack inside Z-Way engine is fully asynchronous. All the data are returned back into data tree that we call ZWaveAPIData. To get updates of this tree you have to make a POST request for /ZWaveAPI/Data/<timestamp>. To get everything use 0 for timestamp. The response is a JSON object that contains pairs (path, new value).The light level you need is located in devices[nodeID].instances[instanceID].SwitchMultilevel.data.level.value. As a hint, go in Expert commands and press on Command Class name. A window will be opened containing the data in hierarchical view (the subtree). It is quite flat for SwitchMultilevel, but is not for Configuration or Association Command Classes.Have fun!