How to add, list and use devices via HTTP requests?

Discussions about RaZberry - Z-Wave board for Raspberry computer
Post Reply
Keram77
Posts: 1
Joined: 01 Oct 2015 09:50

How to add, list and use devices via HTTP requests?

Post by Keram77 »

Hello,

I want to control my RaZberry manually by using HTTP requests.

So far, I figured out how to enable inclusion mode:
http://<my_razberry_IP>:8083/ZWaveAPI/Run/controller.AddNodeToNetwork(1)

Then I set my devices into inclusion mode, wait some time and then I stop inclusion mode:
http://<my_razberry_IP>:8083/ZWaveAPI/Run/controller.AddNodeToNetwork(0)

Now, how do I know exactly which devices have been added?
Or alternatively, how can I get a list of all connected devices without getting all JSON data belonging to each device? (I just want a list of numbers like "3,4,5" to see that z-wave devices with id 3, 4 and 5 have been added. Or a list like "1,2,3,4,5" to know that devices with ID 1 to 5 are connected)

However, now that my devices are connected I can use them assuming I found out which device IDs they are. This is easy for things like switches, lights, etc because I just need to set their values. 8-) But I wonder to interface a Routing Alarm Sensor?

First, I need to set the target for the Routing Alarm Sensor to the razberry controller.
Second, I need to get notified if the alarm occurred by the controller.

How to achieve this by using the ZWaveAPI (via HTTP requests)? :?:


Thanks a lot!
Keram
pofs
Posts: 688
Joined: 25 Mar 2011 19:03

Re: How to add, list and use devices via HTTP requests?

Post by pofs »

AddNodeToNetwork mode can only include one device at a time, and it immediately exits inclusion mode after that.

Included device ID is stored in controller.data.lastIncludedDevice. You can bind to that dataholder and execute script to do whatever you want when its value changes.

Your task is much more like for server-side module rather than HTTP requests.
Post Reply