Platform Information
- Hardware: Raspberry Pi 3B+
- OS: Raspberry Pi OS (32 Bit - Buster)
- Java Runtime Environment:
- openjdk version “1.8.0_152”
- OpenJDK Runtime Environment (Zulu Embedded 8.25.0.76-linux-aarch32hf) (build 1.8.0_152-b76)
- OpenJDK Client VM (Zulu Embedded 8.25.0.76-linux-aarch32hf) (build 25.152-b76, mixed mode, Evaluation)
- Jython 2.7.0
- openHAB 2.5.5 (Release Build)
Hello,
I’m using the new Insteon binding for openHAB2. While migrating to JSR223/Python rules, I discovered that my lights are turning off many seconds after the state is reporting off. Based upon
timings, this doesn’t appear to related to the JSR223/Python migration. Rather, there seems to be a significant delay between a report of a state change to off and the actual time the off command is received and executed by the Insteon switches.
I’ve repeated this several times, though I have not measured it each time. For this particular occurrence, I enabled TRACE logging on the Insteon binding. The TRACE logging is rather significant, so I attached the logs for the timeline reported below.
Insteon_TRACE_log.txt (492.3 KB)
Does anyone have any clue as why the non-trace logging seems to indicate that the switches (and therefore the lights) turned off at one time, while the trace logging shows a significantly different time.
This is the timeline of a sample occurrence.
- Phone goes offline: 2020-06-13 21:14:56.194. This time is accurate
- gPhone_Presence (actual item being watched for trigger condition goes offline: 2020-06-13 21:14:56.197. This time is accurate.
- Rule executes: 2020-06-13 21:14:56.216 to 2020-06-13 21:14:56.290. This time is accurate.
- Insteon light switches receive commands: 2020-06-13 21:14:56.562 to 2020-06-13 21:14:57.495. This time seems accurate based upon the rule execution time.
- Insteon light switches report as changed state: 2020-06-13 21:14:57.903 to 2020-06-13 21:14:57.918. This time seems accurate based upon the time the commands were received.
- Lights turn off: 2020-06-13, approximately 21:15:15. This is approximate, only because I’ve issued a “watch date” command to note the time the lights actually turn off.
Items
Group:Switch:OR(ON, OFF) gUpstairs_Hallway_Lights "Upstairs Hallway Lights" <switch> (gInsteon)
Switch Upstairs_Hallway_Lights_A "Upstairs Hallway Lights A" <switch> (gUpstairs_Hallway_Lights) { channel="insteon:device:41CF94:switch" }
Switch Upstairs_Hallway_Lights_B "Upstairs Hallway Lights B" <switch> (gUpstairs_Hallway_Lights) { channel="insteon:device:28743C:switch" }
Switch Upstairs_Hallway_Lights_C "Upstairs Hallway Lights C" <switch> (gUpstairs_Hallway_Lights) { channel="insteon:device:28866A:switch" }
Group:Switch:AND(ON, OFF) gPhone_Presence "Family Phone Presence" <switch> (gPhone_Presence)
Switch Burzin_Phone_Presence "Burzin's Phone Presence" (gPhone_Presence) { channel="network:pingdevice:2d798662:online" }
Rules
def lights_out(event):
events.sendCommand("Front_Porch_Lights", "OFF")
events.sendCommand("gKitchen_Island_Lights", "OFF")
events.sendCommand("Kitchen_Over_Cabinet_Lights","OFF")
events.sendCommand("Kitchen_Under_Cabinet_Lights", "OFF")
events.sendCommand("gKitchen_Table_Lights", "OFF")
events.sendCommand("gDining_Room_Lights", "OFF")
events.sendCommand("gFamily_Room_Lights", "OFF")
events.sendCommand("Bar_Light", "OFF")
events.sendCommand("gFireplace_Light", "OFF")
events.sendCommand("Sunroom_Window_Lights", "OFF")
events.sendCommand("gPatio_Lights", "OFF")
events.sendCommand("gFoyer_Light", "OFF")
events.sendCommand("gLiving_Room_Lights", "OFF")
events.sendCommand("gUpstairs_Hallway_Lights", "OFF")
events.sendCommand("Balcony_Light", "OFF")
@rule("Lights Off When Nobody is Home")
@when("Member of gPhone_Presence changed to OFF")
def lights_off_when_nobody_is_home(event):
lights_off_when_nobody_is_home.log.info("Rule 'Lights Off When Nobody is Home' is executing.")
gPhone_Presence=filter(lambda item: item.state == ON, ir.getItem("gPhone_Presence").members)
if not gPhone_Presence:
lights_out(event)
lights_off_when_nobody_is_home.log.info("Rule 'Lights Off When Nobody is Home' has completed.")
Events Log Snippet
2020-06-13 21:14:56.194 [vent.ItemStateChangedEvent] - Burzin_Phone_Presence changed from ON to OFF
2020-06-13 21:14:56.197 [GroupItemStateChangedEvent] - gPhone_Presence changed from ON to OFF through Burzin_Phone_Presence
2020-06-13 21:14:56.562 [ome.event.ItemCommandEvent] - Item 'gUpstairs_Hallway_Lights' received command OFF
2020-06-13 21:14:57.421 [ome.event.ItemCommandEvent] - Item 'Upstairs_Hallway_Lights_A' received command OFF
2020-06-13 21:14:57.465 [ome.event.ItemCommandEvent] - Item 'Upstairs_Hallway_Lights_B' received command OFF
2020-06-13 21:14:57.495 [ome.event.ItemCommandEvent] - Item 'Upstairs_Hallway_Lights_C' received command OFF
2020-06-13 21:14:57.903 [GroupItemStateChangedEvent] - gUpstairs_Hallway_Lights changed from OFF to ON through Upstairs_Hallway_Lights_A
2020-06-13 21:14:57.906 [vent.ItemStateChangedEvent] - Upstairs_Hallway_Lights_A changed from ON to OFF
2020-06-13 21:14:57.910 [vent.ItemStateChangedEvent] - Upstairs_Hallway_Lights_B changed from ON to OFF
2020-06-13 21:14:57.914 [GroupItemStateChangedEvent] - gUpstairs_Hallway_Lights changed from ON to OFF through Upstairs_Hallway_Lights_C
2020-06-13 21:14:57.918 [vent.ItemStateChangedEvent] - Upstairs_Hallway_Lights_C changed from ON to OFF
openHAB Log Snippet
2020-06-13 21:14:56.216 [INFO ] [ython.Lights Off When Nobody is Home] - Rule 'Lights Off When Nobody is Home' is executing.
2020-06-13 21:14:56.290 [INFO ] [ython.Lights Off When Nobody is Home] - Rule 'Lights Off When Nobody is Home' has completed.
Regards,
Burzin