HA Version: 2024.8.2
OS: Ubuntu 22.04
Agara Zigbee door sensor.
Mosquitto broker
I have an issue with using HA alsways showing an “off” state in my sensor template.
- name: "CGC Door Contact"
state_topic: 'zigbee2mqtt/0x00158d000ad62d3d'
value_template:
"{% if is_state('sensor.cgc_door_contact', 'on') %}
CLOSED
{% else %}
OPEN
{% endif %}"
The door sensor payload has the contact state as true when the Agara sensor and magnet are in close contact which is door closed.
The template function is returning a false state regardless of what I have for the state comparision value. I have tried “on”, “off” and “true”, but it the function call still returns a false state.
I did try to use payload_off and payload_on but that threw an error saying these keys are not valid in a manual configuration.
Zigbee2mqtt does display the correct payload values that is published.
[2024-08-21 08:29:02] info: z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/0x00158d000ad62d3d', payload '{"battery":100,"contact":false,"device_temperature":30,"linkquality":138,"power_outage_count":7,"trigger_count":5,"voltage":3095}'
[2024-08-21 08:29:03] info: z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/0x00158d000ad62d3d', payload '{"battery":100,"contact":true,"device_temperature":30,"linkquality":138,"power_outage_count":7,"trigger_count":5,"voltage":3095}'
Anyone have any thoughts as to what I might be doing wrong?
thanks
Mark