I’ve worked for most of the holidays to get OpenHAB to trigger an event based on change in status from a motion detector. And am frustrated with a complete lack of success. I’ve attempted to find any relevant article in the user community or wider via endless searches in Google. And I’ve read and reread all the instructions for ITEMS, RULES, SITEMAPS, etc., but haven’t found anything that has helped solve my problem. I’ve never posted anything on a user community board, but am now. I’m kind of like most males who refuse to ask for directions and help when lost. But I’m to the point where I need to ask for directions/help…
I’ve an INSTEONPLM modem, a motion detector, a dimmer and a switch. I put them at the bottom of demo.items and commented-out nearly everything else in demo.items (and in demo.sitemap) in an effort to “keep it simple, stupid”…
Here is my openhab.log file:
OpenHAB - openhab.log.pdf (29.6 KB)
I have three .rules files; one for the dimmer, one for the motion detector, and a third for the switch. They are pretty similar. Each file contains a rule that writes an entry to logInfo on startup. You can see in openhab.log that each of the three startup rules is invoked and entries are written successfully to logInfo. Here is the .rules file for the dimmer:
OpenHAB - PADdimmer1.rules.pdf (22.4 KB)
Here is the rules file for the motion detector:
OpenHAB - PADmotion1.rules.pdf (22.1 KB)
And here is the rules file for the switch:
OpenHAB - PADswitch1.rules.pdf (22.1 KB)
My problem is that I cannot get rules written on “received update” or “changed” events to trigger the relevant rules, which has me completely baffled. Works for “received command”, but not for status updates or changes. I have five test scenarios which are intended to show what works and what doesn’t. The details can be seen in the insteonplm.log file (attached further below).
First scenario is to turn ON the switch via the classic UI. This works fine and the “Item Switch1 received command ON” rule is invoked successfully. I then turn the switch OFF via the UI and the “Item Switch1 received command OFF” rule is invoked successfully and INFO entries are written to the events.log and openhab.log files. So far so good…
Second scenario is to turn ON the dimmer via the classic UI. This works fine and the “Item Dimmer1 received command ON” and “Item Dimmer1 received command OFF” rules are invoked successfully and INFO entries are written to the events.log and openhab.log files. Again, so far so good. But subsequent actions don’t work…
Third scenario is to turn ON the dimmer via the ON/OFF knob on the lamp itself. This caused a change in item status as reflected in the insteonplm.log, but was not caused by me sending an ON or OFF commands via the UI as was done in the first scenario. I expected the “Item Dimmer1 received update ON” and “Item Dimmer1 received update OFF” rules to be invoked by the change in status, but they weren’t. Or maybe the “Item Dimmer1 changed from OFF to ON” rule would be invoked by the change in status. But no INFO entries were written to any log file…
The fourth scenario is similar to the third scenario only I physically turned the switch ON and OFF in the garage. No rules were invoked and no status update entries written to the log files.
Fifth scenario was to activate the motion detector. Again one can see activities posted in the insteonplm.log file, but no rules are invoked when the motion detector status becomes “OPEN” or when it changes to “CLOSED” later.
At present both Switch1 and the INSTEONPLM modem are linked as responders to Motion1, which is a controller. (I can provide output from Insteon Terminal if needed.) The motion detector in the garage turns on the lights in garage via the switch when there is motion. And it turns off the lights one minute after the last motion was detected. That’s been working fine for several months. But I want to install a second (new) motion detector outside and use OpenHAB to turn on the outside lights when motion is detected in the driveway. I expect to trigger the outside lights via a change in status for the motion detector from CLOSED to OPEN. I wanted to start simple and confirm I can trigger rules using the motion detector in the garage before I try anything more complex. And I’m stymied because I can’t trigger any action off the existing motion detector.
Here is the insteonplm.log file. You can see that I’ve edited the file and inserted comments such as “=====> Manual 'ON” Switch1 via demo.sitemap classic UI" at appropriate places in the files in an effort to indicate where I took the actions in scenarios one thru five…
OpenHAB - insteonplm.log.pdf (86.2 KB)
I’d appreciate help in figuring out what I’m doing wrong. Thanks…