Event responder configured to switch "Night/Day" on and "Hall Auto" off at sunrise

Event responder configured to switch "Night/Day" off and "Hall Auto" on at sunset

Lighting scenario "Lights Auto" to switch "Hall Auto" on from the home screen

Lighting scenario "Lights Manual" to switch "Hall Auto" off from the home screen

Code below saved as interceptor.rb or similar (name is not important)

Device configured for the interceptor (see Plain Text DCE Messages) and the id inserted into the code below at the top

Procedure

Run the code below in a loop:

while true ; do ruby interceptor.rb ; done

You should see it connect and register intercepts for Lighting and Security messages. You can now configure the interceptor by triggering events, looking at the output of the interceptor for where it says for example:

Correlating message: (165 -108 2 9 25 "0")

You can take the part from within the brackets and use it in the rules.

You can see a few rules defined in my example, and will notice that you can have rules for automatic lighting zones, and also straightforward rules for triggering events. The latter scenario is not really very useful as LMCE is pretty good at doing this anyway. I mostly used that stuff for testing.

I am not a programmer, so this code was written as I scoured the net for Ruby examples and tried to make sense of it. I know it is messy and very there is a lot of garbage in there, but I did not think it was worth spending the time on. Once LMCE has developed a little more this code is useless, so it should remain a simple hack to get along in the meantime.