Events With State
From LinuxMCE
Revision as of 18:00, 4 October 2015 by Marie.o (Talk | contribs) (Created page with "== Activity based on events and state == Turning on and off a light based on events and state is an important thing, but a feast not easily configured. === The devices === *...")
Contents
Activity based on events and state
Turning on and off a light based on events and state is an important thing, but a feast not easily configured.
The devices
- A KNX sensor which emits a group address. This group address is added as a light with ON/OFF and STATUS containing the same group address. KNX is only an example, any device that can emit a state change can be used.
- A Hue light
The goal
Pressing a the button on the KNX sensor should toggle the state of the hue light. Just like a regular KNX light works.
The event for ON
In web admin under Advanced / Configuration / Events a new advanced event is created, named Turn Hue Light ON, type State Changed. Three segments need to be added. First segment is
State Changed / Device KNX sensor / On/Off / <> / 2
The 2 is used as the state will never be 2, so this will trigger whenever the button is pressed. Second segment is
PK_Device / = / KNX Sensor
Third segment is
State / Device Hue light / On/Off / contains / OFF
The command for ON
The command is a simple Hue Light / On
What to do for OFF
Identical to the event for ON except the third segment contains ON, and the command for OFF is Hue Light / Off