XaF / qolsysgw

Qolsys IQ Panel 2+ gateway to an Home Assistant Alarm Control Panel
MIT License
131 stars 13 forks source link

Add support for `Doorbell` sensor type #102

Closed agelwarg closed 1 year ago

agelwarg commented 1 year ago

Before submitting this form

Sensor type

Doorbell

Home Assistant device class

door

Does the panel send sensor status updates?

Sensor data from an INFO message

{"id": "6006A7", "type": "Doorbell", "name": "Door Bell", "group": "localsafety", "status": "Closed", "state": "0", "zone_id": 18, "zone_physical_type": 1, "zone_alarm_type": 3, "zone_type": 109, "partition_id": 0}

Sensor data from a ZONE_EVENT's ZONE_UPDATE message

{"event":"ZONE_EVENT","zone_event_type":"ZONE_UPDATE","zone":{"id":"6006A7","type":"Doorbell","name":"Door Bell","group":"localsafety","status":"Closed","state":"0","zone_id":18,"zone_physical_type":1,"zone_alarm_type":3,"zone_type":109,"partition_id":0},"version":1,"requestID":"09352e90-9993-4def-aa25-77010ff7e3ac"}

Sensor data from a ZONE_EVENT's ZONE_ACTIVE message

Can't capture

Additional context

No response

agelwarg commented 1 year ago

For what it's worth, by making these changes, I can use the doorbell and setup notifications:

https://github.com/agelwarg/qolsysgw/commit/82196f53f013a594d1f4728172981ecaeae96310

However, I'm not sure if making it a device_class door makes sense.

XaF commented 1 year ago

Do you see any change in state when your doorbell is being used? Or does it just appear in home assistant but does not ever change state?

agelwarg commented 1 year ago

Looks like it changes state

D561AF4E-E63E-458F-82AA-2A4B48B9D10C

XaF commented 1 year ago

Do those open/close correspond to someone using the doorbell? I'm surprised since you mentioned not seeing any ZONE_ACTIVE messages, which are the ones leading to open/close status of a sensor!

agelwarg commented 1 year ago

Yes, there are -- I apologize as I didn't see "doorbell" in the ZONE_ACTIVE messages, but I now see that those only contain the zone_id:

2023-03-29 11:31:58.999447 DEBUG qolsys_panel: Data received (len: 155): {"event":"ZONE_EVENT","zone_event_type":"ZONE_ACTIVE","version":1,"zone":{"status":"Open","zone_id":18},"requestID":"c0bc9c44-e534-4287-a156-6c18ac2fb202"}
2023-03-29 11:31:59.003813 DEBUG qolsys_panel: Qolsys callback for event: <QolsysEventZoneEventActive zone=namespace(id=18, status='Open') version=1>
2023-03-29 11:31:59.005266 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": 18}, "requestID": "c0bc9c44-e534-4287-a156-6c18ac2fb202"}'}
2023-03-29 11:31:59.022027 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": 18}, "requestID": "c0bc9c44-e534-4287-a156-6c18ac2fb202"}'} and kwargs={'topic': 'qolsys/qolsys_panel/event', '__thread_id': 'MainThread'}
2023-03-29 11:31:59.029230 DEBUG qolsys_panel: MQTT callback for event: <QolsysEventZoneEventActive zone=namespace(id=18, status='Open') version=1>
2023-03-29 11:31:59.034817 DEBUG qolsys_panel: ACTIVE zone=namespace(id=18, status='Open')
2023-03-29 11:31:59.041689 DEBUG qolsys_panel: Sensor '6006A7' (Door Bell) status updated to 'Open'
2023-03-29 11:31:59.047743 DEBUG qolsys_panel: Notifying <QolsysSensorDoorbell id=6006A7 name=Door Bell group=localsafety status=Open state=0 zone_id=18 zone_type=109 zone_physical_type=1 zone_alarm_type=3 partition_id=0> observers with: {'change': 'update_status', 'prev_value': 'Closed', 'new_value': 'Open'}
2023-03-29 11:31:59.052573 DEBUG qolsys_panel: Received update from sensor 'Door Bell' for CHANGE=update_status, from prev_value=Closed to new_value=Open
2023-03-29 11:31:59.057859 DEBUG qolsys_panel: call_service: mqtt/publish, {'namespace': 'mqtt', 'retain': True, 'topic': 'homeassistant/binary_sensor/door_bell/state', 'payload': 'Open'}
2023-03-29 11:31:59.225466 DEBUG qolsys_panel: Data received (len: 157): {"event":"ZONE_EVENT","zone_event_type":"ZONE_ACTIVE","version":1,"zone":{"status":"Closed","zone_id":18},"requestID":"ffa9966d-c346-4388-9098-129c447b4d5f"}
2023-03-29 11:31:59.232103 DEBUG qolsys_panel: Qolsys callback for event: <QolsysEventZoneEventActive zone=namespace(id=18, status='Closed') version=1>
2023-03-29 11:31:59.233757 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": 18}, "requestID": "ffa9966d-c346-4388-9098-129c447b4d5f"}'}
2023-03-29 11:31:59.575661 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": 18}, "requestID": "ffa9966d-c346-4388-9098-129c447b4d5f"}'} and kwargs={'topic': 'qolsys/qolsys_panel/event', '__thread_id': 'MainThread'}
2023-03-29 11:31:59.581306 DEBUG qolsys_panel: MQTT callback for event: <QolsysEventZoneEventActive zone=namespace(id=18, status='Closed') version=1>
2023-03-29 11:31:59.586527 DEBUG qolsys_panel: ACTIVE zone=namespace(id=18, status='Closed')
2023-03-29 11:31:59.592288 DEBUG qolsys_panel: Sensor '6006A7' (Door Bell) status updated to 'Closed'
2023-03-29 11:31:59.598043 DEBUG qolsys_panel: Notifying <QolsysSensorDoorbell id=6006A7 name=Door Bell group=localsafety status=Closed state=0 zone_id=18 zone_type=109 zone_physical_type=1 zone_alarm_type=3 partition_id=0> observers with: {'change': 'update_status', 'prev_value': 'Open', 'new_value': 'Closed'}
2023-03-29 11:31:59.605279 DEBUG qolsys_panel: Received update from sensor 'Door Bell' for CHANGE=update_status, from prev_value=Open to new_value=Closed
2023-03-29 11:31:59.612442 DEBUG qolsys_panel: call_service: mqtt/publish, {'namespace': 'mqtt', 'retain': True, 'topic': 'homeassistant/binary_sensor/door_bell/state', 'payload': 'Closed'}
2023-03-29 11:32:17.501915 DEBUG qolsys_panel: Data received (len: 318): {"event":"ZONE_EVENT","zone_event_type":"ZONE_UPDATE","zone":{"id":"6006A7","type":"Doorbell","name":"Door Bell","group":"localsafety","status":"Closed","state":"0","zone_id":18,"zone_physical_type":1,"zone_alarm_type":3,"zone_type":109,"partition_id":0},"version":1,"requestID":"9e8e27e5-373d-4858-908b-6b080d8c1303"}
2023-03-29 11:32:17.510730 DEBUG qolsys_panel: Qolsys callback for event: <QolsysEventZoneEventUpdate zone=<QolsysSensorDoorbell id=6006A7 name=Door Bell group=localsafety status=Closed state=0 zone_id=18 zone_type=109 zone_physical_type=1 zone_alarm_type=3 partition_id=0> version=1>
2023-03-29 11:32:17.512434 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": "6006A7", "type": "Doorbell", "name": "Door Bell", "group": "localsafety", "status": "Closed", "state": "0", "zone_id": 18, "zone_physical_type": 1, "zone_alarm_type": 3, "zone_type": 109, "partition_id": 0}, "version": 1, "requestID": "9e8e27e5-373d-4858-908b-6b080d8c1303"}'}
2023-03-29 11:32:17.658220 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": "6006A7", "type": "Doorbell", "name": "Door Bell", "group": "localsafety", "status": "Closed", "state": "0", "zone_id": 18, "zone_physical_type": 1, "zone_alarm_type": 3, "zone_type": 109, "partition_id": 0}, "version": 1, "requestID": "9e8e27e5-373d-4858-908b-6b080d8c1303"}'} and kwargs={'topic': 'qolsys/qolsys_panel/event', '__thread_id': 'MainThread'}
2023-03-29 11:32:17.663111 DEBUG qolsys_panel: MQTT callback for event: <QolsysEventZoneEventUpdate zone=<QolsysSensorDoorbell id=6006A7 name=Door Bell group=localsafety status=Closed state=0 zone_id=18 zone_type=109 zone_physical_type=1 zone_alarm_type=3 partition_id=0> version=1>
2023-03-29 11:32:17.667150 DEBUG qolsys_panel: UPDATE zone=<QolsysSensorDoorbell id=6006A7 name=Door Bell group=localsafety status=Closed state=0 zone_id=18 zone_type=109 zone_physical_type=1 zone_alarm_type=3 partition_id=0>
2023-03-29 11:32:19.614396 DEBUG qolsys_panel: Data received (len: 318): {"event":"ZONE_EVENT","zone_event_type":"ZONE_UPDATE","zone":{"id":"6006A7","type":"Doorbell","name":"Door Bell","group":"localsafety","status":"Closed","state":"0","zone_id":18,"zone_physical_type":1,"zone_alarm_type":3,"zone_type":109,"partition_id":0},"version":1,"requestID":"b1054c31-cb49-49f1-9d20-6825845aa56e"}
2023-03-29 11:32:19.619422 DEBUG qolsys_panel: Qolsys callback for event: <QolsysEventZoneEventUpdate zone=<QolsysSensorDoorbell id=6006A7 name=Door Bell group=localsafety status=Closed state=0 zone_id=18 zone_type=109 zone_physical_type=1 zone_alarm_type=3 partition_id=0> version=1>
2023-03-29 11:32:19.621226 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": "6006A7", "type": "Doorbell", "name": "Door Bell", "group": "localsafety", "status": "Closed", "state": "0", "zone_id": 18, "zone_physical_type": 1, "zone_alarm_type": 3, "zone_type": 109, "partition_id": 0}, "version": 1, "requestID": "b1054c31-cb49-49f1-9d20-6825845aa56e"}'}
2023-03-29 11:32:19.682178 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": "6006A7", "type": "Doorbell", "name": "Door Bell", "group": "localsafety", "status": "Closed", "state": "0", "zone_id": 18, "zone_physical_type": 1, "zone_alarm_type": 3, "zone_type": 109, "partition_id": 0}, "version": 1, "requestID": "b1054c31-cb49-49f1-9d20-6825845aa56e"}'} and kwargs={'topic': 'qolsys/qolsys_panel/event', '__thread_id': 'MainThread'}
2023-03-29 11:32:19.687148 DEBUG qolsys_panel: MQTT callback for event: <QolsysEventZoneEventUpdate zone=<QolsysSensorDoorbell id=6006A7 name=Door Bell group=localsafety status=Closed state=0 zone_id=18 zone_type=109 zone_physical_type=1 zone_alarm_type=3 partition_id=0> version=1>
2023-03-29 11:32:19.691698 DEBUG qolsys_panel: UPDATE zone=<QolsysSensorDoorbell id=6006A7 name=Door Bell group=localsafety status=Closed state=0 zone_id=18 zone_type=109 zone_physical_type=1 zone_alarm_type=3 partition_id=0>
XaF commented 1 year ago

Amazing! Thanks for the data :)

agelwarg commented 1 year ago

Amazing! Thanks for the data :)

Anything else I can do to get this into next release?

GregTexas commented 1 year ago

I'm moving from Hubitat and the Doorbell feature doesn't work with their 3rd party integration either.

Manticore-007 commented 1 year ago

Thank you agelwarg and XaF for this feature, I was missing this and really am looking forward to this update. I was puzzling with getting the data needed to make this request. But the the feature request form works really well with the checks to see if the issue already has been filed, so kudos for that! I hacked an IQ remote to show a browser for a HA dashboard, and I want to make a pop up when the doorbell is pressed (see video for test). Unfortunately I can't get an updated WebView to work on it so the HA companian app can work on it. But I'm already happy that it can show a dashboard.

20230709_113747

https://github.com/XaF/qolsysgw/assets/71702374/476333f5-9cc6-479d-8cab-9bfd5442f7fa

agelwarg commented 1 year ago

I see this was merged, but do you have any timeframe for when you are going to make a release (that includes this)?

Manticore-007 commented 1 year ago

I see this was merged, but do you have any timeframe for when you are going to make a release (that includes this)?

Bump

ifeign commented 1 year ago

Thank you agelwarg and XaF for this feature, I was missing this and really am looking forward to this update. I was puzzling with getting the data needed to make this request. But the the feature request form works really well with the checks to see if the issue already has been filed, so kudos for that! I hacked an IQ remote to show a browser for a HA dashboard, and I want to make a pop up when the doorbell is pressed (see video for test). Unfortunately I can't get an updated WebView to work on it so the HA companian app can work on it. But I'm already happy that it can show a dashboard.

20230709_113747

https://github.com/XaF/qolsysgw/assets/71702374/476333f5-9cc6-479d-8cab-9bfd5442f7fa

What is this sorcery? How do I get my HASS dash on there?

XaF commented 1 year ago

Sorry for the time it took to release. Was hoping to put in there some of the other sensor requests also but didn't happen to pan out. Happy this is helpful!

I'll +1 @ifeign's question about your dark magic: did not know there was a way to load a custom page on the panel, how does this work? Or did you have to override something?

Manticore-007 commented 1 year ago

This is not an IQ panel 2 or IQ panel 4, but the IQ remote. The IQ remote has two buttons which gets you to the recovery menu, like any Android device, and from there you have access to Android Debug Bridge (ADB). Connect it with USB so with a command line on a pc you can uninstall the Qolsys app, install a browser and a launcher and get access to the settings menu. The Home Assistant companion app doesn't work properly, probably because of an old version of Webview, but that is hard coded it the system and I haven't found a way to update that. Maybe someone smarter than me can tackle that issue 😎

IMG-20230915-WA0008.jpg

IMG-20230915-WA0005.jpg

IMG-20230915-WA0003.jpg

IMG-20230915-WA0001.jpg

IMG-20230915-WA0010.jpg