Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sensors incorrectly report tampered conditions #117

Open
2 tasks done
jsb5151 opened this issue Jul 28, 2023 · 6 comments
Open
2 tasks done

Sensors incorrectly report tampered conditions #117

jsb5151 opened this issue Jul 28, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@jsb5151
Copy link

jsb5151 commented Jul 28, 2023

Before submitting this form

  • I have checked that there hasn't been a similar issue submitted in the past

  • 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

2023-07-28 12:48:02.523839 DEBUG qolsys_panel: Data received (len: 154): {"event":"ZONE_EVENT","zone_event_type":"ZONE_ACTIVE","version":1,"zone":{"status":"Open","zone_id":5},"requestID":"0e9f9a67-1911-400d-89de-2b548a33b7d7"}
2023-07-28 12:48:02.530519 DEBUG qolsys_panel: Qolsys callback for event: <QolsysEventZoneEventActive zone=namespace(id=5, status='Open') version=1>
2023-07-28 12:48:02.531320 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": 5}, "requestID": "0e9f9a67-1911-400d-89de-2b548a33b7d7"}'}
2023-07-28 12:48:02.647533 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": 5}, "requestID": "0e9f9a67-1911-400d-89de-2b548a33b7d7"}'} and kwargs={'topic': 'qolsys/qolsys_panel/event', '__thread_id': 'MainThread'}
2023-07-28 12:48:02.655661 DEBUG qolsys_panel: MQTT callback for event: <QolsysEventZoneEventActive zone=namespace(id=5, status='Open') version=1>
2023-07-28 12:48:02.664906 DEBUG qolsys_panel: ACTIVE zone=namespace(id=5, status='Open')
2023-07-28 12:48:02.673978 DEBUG qolsys_panel: Sensor '101-5348' (PG9945 Reed) status updated to 'Open'
2023-07-28 12:48:02.683379 DEBUG qolsys_panel: Notifying <QolsysSensorDoorWindow id=101-5348 name=PG9945 Reed group=entryexitdelay status=Open state=0 zone_id=5 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'}
2023-07-28 12:48:02.692839 DEBUG qolsys_panel: Received update from sensor 'PG9945 Reed' for CHANGE=update_status, from prev_value=Closed to new_value=Open
2023-07-28 12:48:02.702123 DEBUG qolsys_panel: Data received (len: 157): {"event":"ZONE_EVENT","zone_event_type":"ZONE_ACTIVE","version":1,"zone":{"status":"Closed","zone_id":19},"requestID":"af8c070d-ff8f-4f59-8067-d35284b8daae"}
2023-07-28 12:48:02.708797 DEBUG qolsys_panel: Qolsys callback for event: <QolsysEventZoneEventActive zone=namespace(id=19, status='Closed') version=1>
2023-07-28 12:48:02.710199 DEBUG qolsys_panel: call_service: mqtt/publish, {'namespace': 'mqtt', 'retain': True, 'topic': 'homeassistant/binary_sensor/pg9945_reed/state', 'payload': 'Open'}
2023-07-28 12:48:02.712239 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": 19}, "requestID": "af8c070d-ff8f-4f59-8067-d35284b8daae"}'}
2023-07-28 12:48:03.302708 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": 19}, "requestID": "af8c070d-ff8f-4f59-8067-d35284b8daae"}'} and kwargs={'topic': 'qolsys/qolsys_panel/event', '__thread_id': 'MainThread'}
2023-07-28 12:48:03.310358 DEBUG qolsys_panel: MQTT callback for event: <QolsysEventZoneEventActive zone=namespace(id=19, status='Closed') version=1>
2023-07-28 12:48:03.317862 DEBUG qolsys_panel: ACTIVE zone=namespace(id=19, status='Closed')

Z5 OPEN/Z19 CLOSED -> Z5 OPEN/Z19 OPEN

2023-07-28 12:48:33.808831 DEBUG qolsys_panel: Data received (len: 154): {"event":"ZONE_EVENT","zone_event_type":"ZONE_ACTIVE","version":1,"zone":{"status":"Open","zone_id":5},"requestID":"b60c3aa2-fb4f-41f1-a3c5-c7540ec37a09"}
2023-07-28 12:48:33.816391 DEBUG qolsys_panel: Qolsys callback for event: <QolsysEventZoneEventActive zone=namespace(id=5, status='Open') version=1>
2023-07-28 12:48:33.817224 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": 5}, "requestID": "b60c3aa2-fb4f-41f1-a3c5-c7540ec37a09"}'}
2023-07-28 12:48:34.012004 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": 5}, "requestID": "b60c3aa2-fb4f-41f1-a3c5-c7540ec37a09"}'} and kwargs={'topic': 'qolsys/qolsys_panel/event', '__thread_id': 'MainThread'}
2023-07-28 12:48:34.019320 DEBUG qolsys_panel: MQTT callback for event: <QolsysEventZoneEventActive zone=namespace(id=5, status='Open') version=1>
2023-07-28 12:48:34.026595 DEBUG qolsys_panel: ACTIVE zone=namespace(id=5, status='Open')
2023-07-28 12:48:34.200709 DEBUG qolsys_panel: Data received (len: 155): {"event":"ZONE_EVENT","zone_event_type":"ZONE_ACTIVE","version":1,"zone":{"status":"Open","zone_id":19},"requestID":"a4a6becd-2c95-4971-b2ee-5343c3007593"}
2023-07-28 12:48:34.207303 DEBUG qolsys_panel: Qolsys callback for event: <QolsysEventZoneEventActive zone=namespace(id=19, status='Open') version=1>
2023-07-28 12:48:34.208050 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": 19}, "requestID": "a4a6becd-2c95-4971-b2ee-5343c3007593"}'}
2023-07-28 12:48:34.603919 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": 19}, "requestID": "a4a6becd-2c95-4971-b2ee-5343c3007593"}'} and kwargs={'topic': 'qolsys/qolsys_panel/event', '__thread_id': 'MainThread'}
2023-07-28 12:48:34.611906 DEBUG qolsys_panel: MQTT callback for event: <QolsysEventZoneEventActive zone=namespace(id=19, status='Open') version=1>
2023-07-28 12:48:34.619202 DEBUG qolsys_panel: ACTIVE zone=namespace(id=19, status='Open')
2023-07-28 12:48:34.627165 DEBUG qolsys_panel: Sensor '101-5348' (Front Window) status updated to 'Open'
2023-07-28 12:48:34.635418 DEBUG qolsys_panel: Notifying <QolsysSensorDoorWindow id=101-5348 name=Front Window group=entryexitdelay status=Open state=0 zone_id=19 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'}
2023-07-28 12:48:34.643807 DEBUG qolsys_panel: Received update from sensor 'Front Window' for CHANGE=update_status, from prev_value=Closed to new_value=Open
2023-07-28 12:48:34.648373 DEBUG qolsys_panel: call_service: mqtt/publish, {'namespace': 'mqtt', 'retain': True, 'topic': 'homeassistant/binary_sensor/front_window/state', 'payload': 'Open'}

Z5 OPEN/Z19 OPEN -> Z5 CLOSED/Z19 OPEN - REPORTS TAMPER ON Z19 DUE TO DUPLICATE OPEN MESSAGE

2023-07-28 12:49:38.603432 DEBUG qolsys_panel: Data received (len: 156): {"event":"ZONE_EVENT","zone_event_type":"ZONE_ACTIVE","version":1,"zone":{"status":"Closed","zone_id":5},"requestID":"65ae136b-00ff-4c92-886c-71eb7080168f"}
2023-07-28 12:49:38.610909 DEBUG qolsys_panel: Qolsys callback for event: <QolsysEventZoneEventActive zone=namespace(id=5, status='Closed') version=1>
2023-07-28 12:49:38.611732 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": 5}, "requestID": "65ae136b-00ff-4c92-886c-71eb7080168f"}'}
2023-07-28 12:49:38.701221 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": 5}, "requestID": "65ae136b-00ff-4c92-886c-71eb7080168f"}'} and kwargs={'topic': 'qolsys/qolsys_panel/event', '__thread_id': 'MainThread'}
2023-07-28 12:49:38.709461 DEBUG qolsys_panel: MQTT callback for event: <QolsysEventZoneEventActive zone=namespace(id=5, status='Closed') version=1>
2023-07-28 12:49:38.716922 DEBUG qolsys_panel: ACTIVE zone=namespace(id=5, status='Closed')
2023-07-28 12:49:38.725071 DEBUG qolsys_panel: Sensor '101-5348' (PG9945 Reed) status updated to 'Closed'
2023-07-28 12:49:38.733649 DEBUG qolsys_panel: Notifying <QolsysSensorDoorWindow id=101-5348 name=PG9945 Reed group=entryexitdelay status=Closed state=0 zone_id=5 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'}
2023-07-28 12:49:38.742336 DEBUG qolsys_panel: Received update from sensor 'PG9945 Reed' for CHANGE=update_status, from prev_value=Open to new_value=Closed
2023-07-28 12:49:38.751839 DEBUG qolsys_panel: Data received (len: 155): {"event":"ZONE_EVENT","zone_event_type":"ZONE_ACTIVE","version":1,"zone":{"status":"Open","zone_id":19},"requestID":"7a748498-f3db-4c1e-aedc-e65ffcf1b3dc"}
2023-07-28 12:49:38.758535 DEBUG qolsys_panel: Qolsys callback for event: <QolsysEventZoneEventActive zone=namespace(id=19, status='Open') version=1>
2023-07-28 12:49:38.759868 DEBUG qolsys_panel: call_service: mqtt/publish, {'namespace': 'mqtt', 'retain': True, 'topic': 'homeassistant/binary_sensor/pg9945_reed/state', 'payload': 'Closed'}
2023-07-28 12:49:38.761730 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": 19}, "requestID": "7a748498-f3db-4c1e-aedc-e65ffcf1b3dc"}'}
2023-07-28 12:49:38.778754 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": 19}, "requestID": "7a748498-f3db-4c1e-aedc-e65ffcf1b3dc"}'} and kwargs={'topic': 'qolsys/qolsys_panel/event', '__thread_id': 'MainThread'}
2023-07-28 12:49:38.786190 DEBUG qolsys_panel: MQTT callback for event: <QolsysEventZoneEventActive zone=namespace(id=19, status='Open') version=1>
2023-07-28 12:49:38.794447 DEBUG qolsys_panel: ACTIVE zone=namespace(id=19, status='Open')
2023-07-28 12:49:38.802455 DEBUG qolsys_panel: Sensor '101-5348' (Front Window) tampered updated to 'True'
2023-07-28 12:49:38.810802 DEBUG qolsys_panel: Notifying <QolsysSensorDoorWindow id=101-5348 name=Front Window group=entryexitdelay status=Open state=0 zone_id=19 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}
2023-07-28 12:49:38.819214 DEBUG qolsys_panel: Received update from sensor 'Front Window' for CHANGE=update_tampered, from prev_value=False to new_value=True
2023-07-28 12:49:38.827417 DEBUG qolsys_panel: Notifying <QolsysSensorDoorWindow id=101-5348 name=Front Window group=entryexitdelay status=Open state=0 zone_id=19 zone_type=1 zone_physical_type=1 zone_alarm_type=3 partition_id=0> observers with: {'change': 'update_attributes'}
2023-07-28 12:49:38.835806 DEBUG qolsys_panel: Received update from sensor 'Front Window' for CHANGE=update_attributes, from prev_value=None to new_value=None
2023-07-28 12:49:38.840286 DEBUG qolsys_panel: call_service: mqtt/publish, {'namespace': 'mqtt', 'retain': True, 'topic': 'homeassistant/binary_sensor/front_window/attributes', 'payload': '{"group": "entryexitdelay", "state": "0", "zone_type": 1, "zone_physical_type": 1, "zone_alarm_type": 3, "tampered": true}'}`

Additional context

No response

@XaF
Copy link
Owner

XaF commented Jul 28, 2023

What happens when you do tamper sensors ?

@jsb5151
Copy link
Author

jsb5151 commented Jul 30, 2023

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?

@jsb5151
Copy link
Author

jsb5151 commented Jul 30, 2023

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!

@jsb5151 jsb5151 changed the title HW Translator and Multiple loop sensors incorrectly reported as tampered Sensors incorrectly report tampered conditions Jul 30, 2023
@jsb5151
Copy link
Author

jsb5151 commented Jul 30, 2023

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...

@XaF
Copy link
Owner

XaF commented Jul 31, 2023

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?

@jsb5151
Copy link
Author

jsb5151 commented Oct 17, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants