Difference between revisions of "Events With State"

From LinuxMCE
Jump to: navigation, search
(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 === *...")
 
 
Line 1: Line 1:
 +
[[Category: EIB/KNX]]
 +
[[category: Automation]]
 +
[[category: Events]]
 +
[[category: Programming]]
 
== Activity based on events and state ==
 
== 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.
 
Turning on and off a light based on events and state is an important thing, but a feast not easily configured.

Latest revision as of 18:00, 4 October 2015

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