Open jsb5151 opened 1 year ago
What happens when you do tamper sensors ?
So I had a sensor that had the reed switch open but the aux switch closed, and when it got tampered, both sensors were marked open, both tampered = false.
How does qolsysgw decide if a sensor is tampered if it's not reported by the API?
BTW, looking at the logs, I've noticed that I get a LOT of tampered sensor messages in the logs. The only reason why I noticed it is that I have a push notification every time the garage door status changes (open/close/unavailable).
After all, this may not be limited only to dual sensors, as my PIRs routinely report tampered conditions and I know for a fact that they aren't tampered with, otherwise I would see messages on the IQP2 or on MobileTech!
It seems to happen when some sensors stay open for a very long time; it seems like the panel is sending a redundant zone_action message when a status changes after a while...
I documented in this document: https://github.com/XaF/qolsysgw/blob/main/docs/qolsys-panel-interactions.md (search "tamper") how I've identified (tests and checks) that the panel reports tampered sensors through the control4 API.
I've not had any issue with that, even when keeping my windows open for a while, it does not seem to repeat-report the open status or send redundant messages through ZONE_ACTIVE
. The ZONE_UPDATE
messages are the ones being used generally to resync the status of sensors that have not reported in a while.
I'm not familiar with dual sensors: how are they working? I would have expected two sensors in the panel, if coming from the same physical sensor, to have zone ids that follow each other but it's not the case in your situation? I'm also curious why the sensor tampering seems to be an issue for all of your sensors: could it be a panel configuration option somewhere?
I've looked at this further, and I still don't know why it reports that. Manually overriding the trouble check in the code fixed my issue. I've looked at panel config options and can't find anything, and MobileTech does not report any trouble conditions at this time.
Resurrecting an old thread, I'm seeing the same behavior with one of my sensors. It is an outdoor PowerG sensor (PG9312). It does have an AUX input port similar to the initial report; however, I do not use the AUX input at all.
This sensor is used on an outdoor gate that is opened in the morning and usually left open for about 12-14 hours and then closed at night. The issue I'm seeing is at night when the gate is CLOSED, Home Assistant shows that the gate is still OPEN even though on the IQ 4 panel it is properly showing as closed.
Looking in the logs, I'm seeing that during the coarse of the day while the gate is still OPEN, there is an incorrect reported tamper event being sent. And then when the gate is CLOSED later in the evening, instead of that event being captured as CLOSED, it is clearing the tamper event, which leaves Home Assistant still believing the gate is OPEN. Usually after a few hours during a ZONE_UPDATE, the proper CLOSED state is eventually sent.
I'm not sure if there is any solution to this, or if there is a way to just disable the tamper check altogether for this sensor. Either way, just passing along more details in case it is helpful to resolve this. I'm happy to provide any additional information/logs if it would be helpful.
_Sensor id=107-5354 / Sensor name=Driveway Gate / zoneid=10
Gate OPEN in the morning:
2024-10-17 06:40:18.006044 DEBUG qolsys_panel: Data received (len: 155): {"event":"ZONE_EVENT","zone_event_type":"ZONE_ACTIVE","version":1,"zone":{"status":"Open","zone_id":10},"requestID":"d2f935bb-fe06-42b6-aea9-01d3fe5a8e1a"}
2024-10-17 06:40:18.008616 DEBUG qolsys_panel: Qolsys callback for event: <QolsysEventZoneEventActive zone=namespace(id=10, status='Open') version=1>
2024-10-17 06:40:18.008879 DEBUG qolsys_panel: call_service: mqtt/publish, {'namespace': 'mqtt', 'topic': 'qolsys/qolsys_panel/event', 'payload': '{"event": "ZONE_EVENT", "zone_event_type": "ZONE_ACTIVE", "version": 1, "zone": {"status": "Open", "zone_id": 10}, "requestID": "d2f935bb-fe06-42b6-aea9-01d3fe5a8e1a"}'}
2024-10-17 06:40:18.412581 DEBUG qolsys_panel: Received MQTT_MESSAGE with data={'topic': 'qolsys/qolsys_panel/event', 'wildcard': '#', 'payload': '{"event": "ZONE_EVENT", "zone_event_type": "ZONE_ACTIVE", "version": 1, "zone": {"status": "Open", "zone_id": 10}, "requestID": "d2f935bb-fe06-42b6-aea9-01d3fe5a8e1a"}'} and kwargs={'topic': 'qolsys/qolsys_panel/event', '__thread_id': 'MainThread'}
2024-10-17 06:40:18.414114 DEBUG qolsys_panel: MQTT callback for event: <QolsysEventZoneEventActive zone=namespace(id=10, status='Open') version=1>
2024-10-17 06:40:18.414940 DEBUG qolsys_panel: ACTIVE zone=namespace(id=10, status='Open')
2024-10-17 06:40:18.415858 DEBUG qolsys_panel: Sensor '107-5354' (Driveway Gate) status updated to 'Open'
2024-10-17 06:40:18.416794 DEBUG qolsys_panel: Notifying <QolsysSensorDoorWindow id=107-5354 name=Driveway Gate group=localsafety status=Open state=0 zone_id=10 zone_type=1 zone_physical_type=1 zone_alarm_type=3 partition_id=0> observers with: {'change': 'update_status', 'prev_value': 'Closed', 'new_value': 'Open'}
2024-10-17 06:40:18.417750 DEBUG qolsys_panel: Received update from sensor 'Driveway Gate' for CHANGE=update_status, from prev_value=Closed to new_value=Open
2024-10-17 06:40:18.418992 DEBUG qolsys_panel: call_service: mqtt/publish, {'namespace': 'mqtt', 'retain': True, 'topic': 'homeassistant/binary_sensor/driveway_gate/state', 'payload': 'Open'}
Incorrect gate TAMPER event (while gate is still OPEN):
2024-10-17 19:02:23.029949 DEBUG qolsys_panel: Data received (len: 155): {"event":"ZONE_EVENT","zone_event_type":"ZONE_ACTIVE","version":1,"zone":{"status":"Open","zone_id":10},"requestID":"495ff2aa-c32a-4f17-81d0-358fc86fc4c0"}
2024-10-17 19:02:23.032309 DEBUG qolsys_panel: Qolsys callback for event: <QolsysEventZoneEventActive zone=namespace(id=10, status='Open') version=1>
2024-10-17 19:02:23.032611 DEBUG qolsys_panel: call_service: mqtt/publish, {'namespace': 'mqtt', 'topic': 'qolsys/qolsys_panel/event', 'payload': '{"event": "ZONE_EVENT", "zone_event_type": "ZONE_ACTIVE", "version": 1, "zone": {"status": "Open", "zone_id": 10}, "requestID": "495ff2aa-c32a-4f17-81d0-358fc86fc4c0"}'}
2024-10-17 19:02:23.034805 DEBUG qolsys_panel: Received MQTT_MESSAGE with data={'topic': 'qolsys/qolsys_panel/event', 'wildcard': '#', 'payload': '{"event": "ZONE_EVENT", "zone_event_type": "ZONE_ACTIVE", "version": 1, "zone": {"status": "Open", "zone_id": 10}, "requestID": "495ff2aa-c32a-4f17-81d0-358fc86fc4c0"}'} and kwargs={'topic': 'qolsys/qolsys_panel/event', '__thread_id': 'MainThread'}
2024-10-17 19:02:23.035729 DEBUG qolsys_panel: MQTT callback for event: <QolsysEventZoneEventActive zone=namespace(id=10, status='Open') version=1>
2024-10-17 19:02:23.036556 DEBUG qolsys_panel: ACTIVE zone=namespace(id=10, status='Open')
2024-10-17 19:02:23.037748 DEBUG qolsys_panel: Sensor '107-5354' (Driveway Gate) tampered updated to 'True'
2024-10-17 19:02:23.038737 DEBUG qolsys_panel: Notifying <QolsysSensorDoorWindow id=107-5354 name=Driveway Gate group=localsafety status=Open state=0 zone_id=10 zone_type=1 zone_physical_type=1 zone_alarm_type=3 partition_id=0> observers with: {'change': 'update_tampered', 'prev_value': False, 'new_value': True}
2024-10-17 19:02:23.039732 DEBUG qolsys_panel: Received update from sensor 'Driveway Gate' for CHANGE=update_tampered, from prev_value=False to new_value=True
2024-10-17 19:02:23.040704 DEBUG qolsys_panel: Notifying <QolsysSensorDoorWindow id=107-5354 name=Driveway Gate group=localsafety status=Open state=0 zone_id=10 zone_type=1 zone_physical_type=1 zone_alarm_type=3 partition_id=0> observers with: {'change': 'update_attributes'}
2024-10-17 19:02:23.041711 DEBUG qolsys_panel: Received update from sensor 'Driveway Gate' for CHANGE=update_attributes, from prev_value=None to new_value=None
2024-10-17 19:02:23.042912 DEBUG qolsys_panel: call_service: mqtt/publish, {'namespace': 'mqtt', 'retain': True, 'topic': 'homeassistant/binary_sensor/driveway_gate/attributes', 'payload': '{"group": "localsafety", "state": "0", "zone_type": 1, "zone_physical_type": 1, "zone_alarm_type": 3, "tampered": true}'}
Gate CLOSED in the evening (Home Assistant still reports OPEN):
2024-10-17 21:25:36.209366 DEBUG qolsys_panel: Data received (len: 157): {"event":"ZONE_EVENT","zone_event_type":"ZONE_ACTIVE","version":1,"zone":{"status":"Closed","zone_id":10},"requestID":"10b6f154-c099-45d4-b7cb-4c2471e67a01"}
2024-10-17 21:25:36.211476 DEBUG qolsys_panel: Qolsys callback for event: <QolsysEventZoneEventActive zone=namespace(id=10, status='Closed') version=1>
2024-10-17 21:25:36.211753 DEBUG qolsys_panel: call_service: mqtt/publish, {'namespace': 'mqtt', 'topic': 'qolsys/qolsys_panel/event', 'payload': '{"event": "ZONE_EVENT", "zone_event_type": "ZONE_ACTIVE", "version": 1, "zone": {"status": "Closed", "zone_id": 10}, "requestID": "10b6f154-c099-45d4-b7cb-4c2471e67a01"}'}
2024-10-17 21:25:36.317971 DEBUG qolsys_panel: Received MQTT_MESSAGE with data={'topic': 'qolsys/qolsys_panel/event', 'wildcard': '#', 'payload': '{"event": "ZONE_EVENT", "zone_event_type": "ZONE_ACTIVE", "version": 1, "zone": {"status": "Closed", "zone_id": 10}, "requestID": "10b6f154-c099-45d4-b7cb-4c2471e67a01"}'} and kwargs={'topic': 'qolsys/qolsys_panel/event', '__thread_id': 'MainThread'}
2024-10-17 21:25:36.318875 DEBUG qolsys_panel: MQTT callback for event: <QolsysEventZoneEventActive zone=namespace(id=10, status='Closed') version=1>
2024-10-17 21:25:36.319703 DEBUG qolsys_panel: ACTIVE zone=namespace(id=10, status='Closed')
2024-10-17 21:25:36.320610 DEBUG qolsys_panel: Sensor '107-5354' (Driveway Gate) tampered updated to 'False'
2024-10-17 21:25:36.321845 DEBUG qolsys_panel: Notifying <QolsysSensorDoorWindow id=107-5354 name=Driveway Gate group=localsafety status=Open state=0 zone_id=10 zone_type=1 zone_physical_type=1 zone_alarm_type=3 partition_id=0> observers with: {'change': 'update_tampered', 'prev_value': True, 'new_value': False}
2024-10-17 21:25:36.322817 DEBUG qolsys_panel: Received update from sensor 'Driveway Gate' for CHANGE=update_tampered, from prev_value=True to new_value=False
2024-10-17 21:25:36.323755 DEBUG qolsys_panel: Notifying <QolsysSensorDoorWindow id=107-5354 name=Driveway Gate group=localsafety status=Open state=0 zone_id=10 zone_type=1 zone_physical_type=1 zone_alarm_type=3 partition_id=0> observers with: {'change': 'update_attributes'}
2024-10-17 21:25:36.324708 DEBUG qolsys_panel: Received update from sensor 'Driveway Gate' for CHANGE=update_attributes, from prev_value=None to new_value=None
2024-10-17 21:25:36.325939 DEBUG qolsys_panel: call_service: mqtt/publish, {'namespace': 'mqtt', 'retain': True, 'topic': 'homeassistant/binary_sensor/driveway_gate/attributes', 'payload': '{"group": "localsafety", "state": "0", "zone_type": 1, "zone_physical_type": 1, "zone_alarm_type": 3, "tampered": false}'}
A few hours later, proper CLOSED event is reported (during ZONE_UPDATE):
2024-10-18 01:05:23.288269 DEBUG qolsys_panel: Data received (len: 325): {"event":"ZONE_EVENT","zone_event_type":"ZONE_UPDATE","zone":{"id":"107-5354","type":"Door_Window","name":"Driveway Gate","group":"localsafety","status":"Closed","state":"0","zone_id":10,"zone_physical_type":1,"zone_alarm_type":3,"zone_type":1,"partition_id":0},"version":1,"requestID":"d3809f47-baa5-437c-8349-b256e98bdd80"}
2024-10-18 01:05:23.290989 DEBUG qolsys_panel: Qolsys callback for event: <QolsysEventZoneEventUpdate zone=<QolsysSensorDoorWindow id=107-5354 name=Driveway Gate group=localsafety status=Closed state=0 zone_id=10 zone_type=1 zone_physical_type=1 zone_alarm_type=3 partition_id=0> version=1>
2024-10-18 01:05:23.291264 DEBUG qolsys_panel: call_service: mqtt/publish, {'namespace': 'mqtt', 'topic': 'qolsys/qolsys_panel/event', 'payload': '{"event": "ZONE_EVENT", "zone_event_type": "ZONE_UPDATE", "zone": {"id": "107-5354", "type": "Door_Window", "name": "Driveway Gate", "group": "localsafety", "status": "Closed", "state": "0", "zone_id": 10, "zone_physical_type": 1, "zone_alarm_type": 3, "zone_type": 1, "partition_id": 0}, "version": 1, "requestID": "d3809f47-baa5-437c-8349-b256e98bdd80"}'}
2024-10-18 01:05:23.660930 DEBUG qolsys_panel: Received MQTT_MESSAGE with data={'topic': 'qolsys/qolsys_panel/event', 'wildcard': '#', 'payload': '{"event": "ZONE_EVENT", "zone_event_type": "ZONE_UPDATE", "zone": {"id": "107-5354", "type": "Door_Window", "name": "Driveway Gate", "group": "localsafety", "status": "Closed", "state": "0", "zone_id": 10, "zone_physical_type": 1, "zone_alarm_type": 3, "zone_type": 1, "partition_id": 0}, "version": 1, "requestID": "d3809f47-baa5-437c-8349-b256e98bdd80"}'} and kwargs={'topic': 'qolsys/qolsys_panel/event', '__thread_id': 'MainThread'}
2024-10-18 01:05:23.662512 DEBUG qolsys_panel: MQTT callback for event: <QolsysEventZoneEventUpdate zone=<QolsysSensorDoorWindow id=107-5354 name=Driveway Gate group=localsafety status=Closed state=0 zone_id=10 zone_type=1 zone_physical_type=1 zone_alarm_type=3 partition_id=0> version=1>
2024-10-18 01:05:23.663350 DEBUG qolsys_panel: UPDATE zone=<QolsysSensorDoorWindow id=107-5354 name=Driveway Gate group=localsafety status=Closed state=0 zone_id=10 zone_type=1 zone_physical_type=1 zone_alarm_type=3 partition_id=0>
2024-10-18 01:05:23.664307 DEBUG qolsys_panel: Notifying <QolsysSensorDoorWindow id=107-5354 name=Driveway Gate group=localsafety status=Closed state=0 zone_id=10 zone_type=1 zone_physical_type=1 zone_alarm_type=3 partition_id=0> observers with: {'change': 'update_status', 'prev_value': 'Open', 'new_value': 'Closed'}
2024-10-18 01:05:23.665262 DEBUG qolsys_panel: Received update from sensor 'Driveway Gate' for CHANGE=update_status, from prev_value=Open to new_value=Closed
2024-10-18 01:05:23.666493 DEBUG qolsys_panel: call_service: mqtt/publish, {'namespace': 'mqtt', 'retain': True, 'topic': 'homeassistant/binary_sensor/driveway_gate/state', 'payload': 'Closed'}
Same issue here with my multi-input sensors, like the PG9945 with reed + aux, and PG9WLSHW8 (8 inputs) also runs into this issue.
If you have a sensor with multiple inputs on the same device ID, it'll create that problem. The only way to fix this is to bypass the trouble reporting in the code.
Before submitting this form
[X] I have checked that there hasn't been a similar issue submitted in the past
[X] I have updated the issue title to something relevant and clear to understand the bug I'm facing
Description of the bug
I have a sensor on my hardwire translator that monitors my garage door. However, in some cases, it stays "open" but with a Tampered condition on qolsysgw, even though the sensor is secure on the IQPanel. It seems that triggering another sensor at the same time on my HW translator causes this issue.
Also, I have a PG9945 sensor that has a built-in reed switch as well as the AUX input. Same condition happens, it occasionally reports an Open condition with a Tampered = true, and closing the sensor reports an Open condition with a Tampered = false. Sometimes it clears itself on its own.
Further research seems to indicate that every time there is a sensor status change from the hardwire translator or a multiple loop sensor like the PG9945, it reports ALL of them through the API even though their status hasn't changed. This means we get 2 "Open" zone_event messages on an opened sensor on the API which is interpreted as a Tampered condition by qolsysgw.
This means we can't really report tampered conditions reliably on devices that report as multiple sensors/multiple loops. It just reports as "Open" in the C4 integration anyway, as there is no explicit field in the API for this.
Is there a way to disable Tamper reporting altogether? Perhaps on individual sensors?
Expected behavior
Garage open = open Garage closed = closed, no tampered condition :)
Or, a way to disable tamper reporting on selected sensors, if not all of them.
DEBUG logs
Sensor is a PG9945 with ID 101-5348, zone 5 is the built-in reed switch, zone 19 is the aux input.
Z5 CLOSED/Z19 CLOSED -> Z5 OPEN/Z19 CLOSED
Z5 OPEN/Z19 CLOSED -> Z5 OPEN/Z19 OPEN
Z5 OPEN/Z19 OPEN -> Z5 CLOSED/Z19 OPEN - REPORTS TAMPER ON Z19 DUE TO DUPLICATE OPEN MESSAGE
Additional context
No response