Hey All,
I've recently picked up a Razberry to have some fun learning to code and actually making something useful for myself.
I just can't figure out how the API is set up. Basically what I want is a script to run and turn on a device through a HTTP POST request. And another one to turn off a device through another HTTP POST request. I've read through the API but I can't for the life of me figure it out.
Can someone push me in the right direction?
Simple turn on and off query
Re: Simple turn on and off query
Try this:
wget "http://localhost:8083/JS/Run/zway.devic ... sic.Set(Y)"
where N is the node ID and V is the value (0..99 or 255).
wget "http://localhost:8083/JS/Run/zway.devic ... sic.Set(Y)"
where N is the node ID and V is the value (0..99 or 255).
-
- Posts: 160
- Joined: 03 May 2014 07:02
Re: Simple turn on and off query
I have been working with a Kwikset deadbolt lock and so far I've managed to get it to lock and unlock. The command to lock is :
http://192.168.0.220:8083/ZWaveAPI/Run/ ... 2].Set[255]
If I replace the 255 with a 0, it unlocks it. I'm trying now to find a reliable way (without beating the battery in the lock to death) to determine the state of the lock. Just to clarify, the lock is device #2 (first one I added to the network) and instance I am assuming is likely always 0. The command class is important and must match the device you are trying to control. You can google z-wave command classes (MiCasaVerde has a good list) and once you find the correct command class, you should be in business. 0 and 255 appear to be the only valid settings for a binary switch. A dimmer would use anything in between.
http://192.168.0.220:8083/ZWaveAPI/Run/ ... 2].Set[255]
If I replace the 255 with a 0, it unlocks it. I'm trying now to find a reliable way (without beating the battery in the lock to death) to determine the state of the lock. Just to clarify, the lock is device #2 (first one I added to the network) and instance I am assuming is likely always 0. The command class is important and must match the device you are trying to control. You can google z-wave command classes (MiCasaVerde has a good list) and once you find the correct command class, you should be in business. 0 and 255 appear to be the only valid settings for a binary switch. A dimmer would use anything in between.
Re: Simple turn on and off query
For simplicity ".instances[0]" can be omitted. Also "commandClass[CC] can be replaced with it's verbal name like "DoorLock", "Basic" and others. See Z-Way developer manual for full list.
-
- Posts: 160
- Joined: 03 May 2014 07:02
Re: Simple turn on and off query
Now that may actually help with my understanding of how to work this thing. I'm getting the hang of the lock although there are many features I have yet to figure out how to support... Knowing that the commands can be simplified will make a difference.....