View Single Post
Posts: 277 | Thanked: 319 times | Joined on Jan 2010
#940
Originally Posted by No!No!No!Yes! View Post



Here's another way to have a "2 States Button" which is "ON" on widget/system startup and toggles at every press.
Hello

First of all, what a great application! I can't believe I haven't noticed this before because it is something I've been looking for.

I use it to control my lights. My server acts, among other things, as a controller for my zwave-network which controls the lights. I can send simple http-request commands to that server to switch on/off/dim any node (light) in that zwave network.

Since I'm a total idiot and can't do anything right, I've just created a single beecon for every command:



The only command that beecon sends is:

Code:
wget ´http://ipaddress:port/ZwaveCommand?command=device&id=21&level=100´
Where the device id is the node that should do something and the level command is from 0(off) to 100(on full).

This works well.

Now I'm trying to get the two-state buttons to work as ON/OFF buttons for the nodes AND show the current state.

When I send the http-request the server does its magic with the light and sends this back:

Code:
DEVICE~Eteinen~7~50~Controller
DEVICE~Iso taso~9~0~BinaryPowerSwitch
DEVICE~Jääkaappi~14~99~MultilevelPowerSwitch
DEVICE~Lamppu~15~0~MultilevelSwitch
DEVICE~Lastenhuone~19~0~MultilevelPowerSwitch
DEVICE~Makuuhuone~20~0~MultilevelPowerSwitch
DEVICE~Olohuone~8~99~MultilevelPowerSwitch
DEVICE~Pieni Taso~16~255~BinaryPowerSwitch
DEVICE~Ruokapöytä~22~99~MultilevelPowerSwitch
DEVICE~Spotit~12~0~BinarySwitch
DEVICE~Taustavalo~18~0~BinarySwitch
DEVICE~Tiskipöytä~11~0~BinaryPowerSwitch
DEVICE~Toimisto~21~99~MultilevelPowerSwitch
Meaning DEVICE~<name of device>~<device id>~<device level>~<type of device>

If I was to save that response to a zwave.txt file every time it is received, could I somehow make all the beecons "read" that text file and change their states (level=0 -> light off, level>0 -> light on) accordingly, while at the same time being able to send ON/OFF-requests? I'm not bothering with DIM-commands because that would require a slider and a way more complex beecon.

As I said, I'm a complete ***** especially when it comes to scripting, so if anyone would like to answer, please keep it simple..

Thanks,

Slarti