XaF/qolsysgw

Add support for `tilt` sensor type

Closed this issue · 5 comments

Before submitting this form

  • I have checked that this sensor type was not suggested for addition before; I know that it could
    be in open or closed issues, and if there was another issue mentioning this sensor type I could
    simply comment in it instead

  • I have updated the <sensor type> mention in the title of the issue, but left the issue title
    as it was otherwise

  • I understand that if I want to suggest the addition of more than a single sensor type, I need
    to file that form for each separate type

Sensor type

Tilt

Home Assistant device class

garage_door

Does the panel send sensor status updates?

  • Yes, I can see the Open/Close messages (I have been able to capture ZONE_ACTIVE messages)
  • No, it seems to only tell us the sensor exists, but never update its state

Sensor data from an INFO message

I don't have an Info message all I have is:

from the MQTT Qolsys error message.
From "homeassistant/sensor/qolsys_panel_last_error/attributes"
QoS: 0
Payload:

type: UnknownQolsysSensorException
desc: >-

{
  "id": "7389AB",
  "type": "Tilt",
  "name": "Garage Tilt",
  "group": "garageTilt1",
  "status": "Closed",
  "state": "0",
  "zone_id": 8,
  "zone_physical_type": 1,
  "zone_alarm_type": 3,
  "zone_type": 16,
  "partition_id": 0
}

Sensor data from a ZONE_EVENT's ZONE_UPDATE message

I don't have a ZONE_EVENT all I have is:

from the MQTT Qolsys error message.
From "homeassistant/sensor/qolsys_panel_last_error/attributes"
QoS: 0
Payload:

type: UnknownQolsysSensorException
desc: >-

{
  "id": "7389AB",
  "type": "Tilt",
  "name": "Garage Tilt",
  "group": "garageTilt1",
  "status": "Closed",
  "state": "0",
  "zone_id": 8,
  "zone_physical_type": 1,
  "zone_alarm_type": 3,
  "zone_type": 16,
  "partition_id": 0
}

Sensor data from a ZONE_EVENT's ZONE_ACTIVE message

I don't have an Info message all I have is:

from the MQTT Qolsys error message.
From "homeassistant/sensor/qolsys_panel_last_error/attributes"
QoS: 0
Payload:

type: UnknownQolsysSensorException
desc: >-

{
  "id": "7389AB",
  "type": "Tilt",
  "name": "Garage Tilt",
  "group": "garageTilt1",
  "status": "Closed",
  "state": "0",
  "zone_id": 8,
  "zone_physical_type": 1,
  "zone_alarm_type": 3,
  "zone_type": 16,
  "partition_id": 0
}

Screenshot 2023-01-15 at 9 06 46 PM

Additional context

The sensor doesn't show up under my alarm device or in the list of entities, but it is triggering the qolys error sensor.

XaF commented

Hello! If you change the status of your sensor by triggering it (so it would be open), are you seeing an update to the error description (with status to Open instead of Closed as in the data you provided)?

Also, as described when submitting the issue, if you have the debug logs enabled and you look at the logs of AppDaemon, you should be able to see the content of the INFO SUMMARY message and any ZONE_ACTIVE. The later should also tell us if the sensor changes state when you trigger it.

Yes, it moves from open to close and vice versa:

I'll try to get the logs next, I couldn't see them in the AppDaemon logs before.

{
  "id": "7389AB",
  "type": "Tilt",
  "name": "Garage Tilt",
  "group": "garageTilt1",
  "status": "Open",
  "state": "0",
  "zone_id": 8,
  "zone_physical_type": 1,
  "zone_alarm_type": 3,
  "zone_type": 16,
  "partition_id": 0
}

{
  "id": "7389AB",
  "type": "Tilt",
  "name": "Garage Tilt",
  "group": "garageTilt1",
  "status": "Closed",
  "state": "0",
  "zone_id": 8,
  "zone_physical_type": 1,
  "zone_alarm_type": 3,
  "zone_type": 16,
  "partition_id": 0
}

I think these are the relevant logs?

2023-01-16 18:12:12.233765 DEBUG qolsys_panel: Data received (len: 154): {"event":"ZONE_EVENT","zone_event_type":"ZONE_ACTIVE","version":1,"zone":{"status":"Open","zone_id":8},"requestID":"e0b32764-2599-4fd2-acfc-96f7f30a31ad"} 2023-01-16 18:12:12.235286 DEBUG qolsys_panel: Qolsys callback for event: <QolsysEventZoneEventActive zone=namespace(id=8, status='Open') version=1> 2023-01-16 18:12:12.235762 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": 8}, "requestID": "e0b32764-2599-4fd2-acfc-96f7f30a31ad"}'} 2023-01-16 18:12:12.391519 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": 8}, "requestID": "e0b32764-2599-4fd2-acfc-96f7f30a31ad"}'} and kwargs={'topic': 'qolsys/qolsys_panel/event', '__thread_id': 'MainThread'} 2023-01-16 18:12:12.395869 DEBUG qolsys_panel: MQTT callback for event: <QolsysEventZoneEventActive zone=namespace(id=8, status='Open') version=1> 2023-01-16 18:12:12.400084 DEBUG qolsys_panel: ACTIVE zone=namespace(id=8, status='Open') 2023-01-16 18:12:27.636431 DEBUG qolsys_panel: Data received (len: 156): {"event":"ZONE_EVENT","zone_event_type":"ZONE_ACTIVE","version":1,"zone":{"status":"Closed","zone_id":8},"requestID":"7099e7a4-8b1f-4485-88fc-0681646da404"} 2023-01-16 18:12:27.640506 DEBUG qolsys_panel: Qolsys callback for event: <QolsysEventZoneEventActive zone=namespace(id=8, status='Closed') version=1> 2023-01-16 18:12:27.641552 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": 8}, "requestID": "7099e7a4-8b1f-4485-88fc-0681646da404"}'} 2023-01-16 18:12:28.250945 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": 8}, "requestID": "7099e7a4-8b1f-4485-88fc-0681646da404"}'} and kwargs={'topic': 'qolsys/qolsys_panel/event', '__thread_id': 'MainThread'} 2023-01-16 18:12:28.252333 DEBUG qolsys_panel: MQTT callback for event: <QolsysEventZoneEventActive zone=namespace(id=8, status='Closed') version=1> 2023-01-16 18:12:28.253580 DEBUG qolsys_panel: ACTIVE zone=namespace(id=8, status='Closed')

XaF commented

It is indeed! And it confirms that your tilt sensor does change state to Open, so can be fully (and usefully) integrated! Thanks!

Thank you for being so awesome. I didn't see a "buy me a coffee" link, do you have one? I'd love to buy you a coffee or beer.