Hi everyone,
I’m testing Zigbee2Tasmota to get my window and door sensors status.
It works, but I’ve got a problem.
Every device has a unique ShortAddr (eg. 0x123F).
My devices are 0x2E8F and 0xF34F.
This is what Tasmota sends to MQTT broker for 0x2E8F:
tele/sonoff-z2t/SENSOR = {"ZigbeeReceived":{"0x2E8F":{"Power":false,"LinkQuality":65}}}
and this is what it sends for 0xF34F:
tele/sonoff-z2t/SENSOR = {"ZigbeeReceived":{"0xF34F":{"Power":false,"LinkQuality":70}}}
As you can see it sends same topic but with different payload.
On homeassistant I’ve created two binary sensors…
- platform: mqtt
name: "finestra_soggiorno_01"
state_topic: "tele/sonoff-z2t/SENSOR"
value_template: "{{ value_json.ZigbeeReceived['0x2E8F'].Power }}"
device_class: window
payload_on: true
payload_off: false
- platform: mqtt
name: "porta_ingresso"
state_topic: "tele/sonoff-z2t/SENSOR"
value_template: "{{ value_json.ZigbeeReceived['0xF34F'].Power }}"
device_class: door
payload_on: true
payload_off: false
they works, but if I open/close the 0x2E8F window I see this on HA log…
2019-12-05 23:56:32 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: 'dict object' has no attribute '0xF34F' (value: {"ZigbeeReceived":{"0x2E8F":{"Power":true,"LinkQuality":60}}}, template: {{ value_json.ZigbeeReceived['0xF34F'].Power }})
2019-12-05 23:56:35 WARNING (MainThread) [homeassistant.components.mqtt.binary_sensor] No matching payload found for entity: porta_ingresso with state topic: tele/sonoff-z2t/SENSOR. Payload: {"ZigbeeReceived":{"0x2E8F":{"Power":true,"LinkQuality":60}}}, with value template Template("{{ value_json.ZigbeeReceived['0xF34F'].Power }}")`
…and if I open/close the 0xF34F door I see this…
2019-12-05 23:56:45 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: 'dict object' has no attribute '0x2E8F' (value: {"ZigbeeReceived":{"0xF34F":{"Power":true,"LinkQuality":60}}}, template: {{ value_json.ZigbeeReceived['0x2E8F'].Power }})
2019-12-05 23:56:47 WARNING (MainThread) [homeassistant.components.mqtt.binary_sensor] No matching payload found for entity: finestra_soggiorno_01 with state topic: tele/sonoff-z2t/SENSOR. Payload: {"ZigbeeReceived":{"0xF34F":{"Power":true,"LinkQuality":70}}}, with value template Template("{{ value_json.ZigbeeReceived['0x2E8F'].Power }}")`
How can I solve this problem ?
Thank you