Simple turn on and off query

Discussions about Z-Way software and Z-Wave technology in general
Post Reply
drzippit
Posts: 1
Joined: 30 Apr 2014 12:17

Simple turn on and off query

Post by drzippit »

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?
User avatar
PoltoS
Posts: 7571
Joined: 26 Jan 2011 19:36

Re: Simple turn on and off query

Post by PoltoS »

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).
Mike Yeager
Posts: 160
Joined: 03 May 2014 07:02

Re: Simple turn on and off query

Post by Mike Yeager »

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.
User avatar
PoltoS
Posts: 7571
Joined: 26 Jan 2011 19:36

Re: Simple turn on and off query

Post by PoltoS »

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.
Mike Yeager
Posts: 160
Joined: 03 May 2014 07:02

Re: Simple turn on and off query

Post by Mike Yeager »

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.....
Post Reply