In my configuration.yaml I have this entry :
sensor:
- platform: mqtt
state_topic: "tele/ZIGBEE/SENSOR"
name: 'ButtonPower'
value_template: '{{value_json.0x6E4E.Power}}'
When I listen to the topic tele/ZIGBEE/SENSOR in home assistant I get the message:
{
"ZbReceived": {
"0x6E4E": {
"Device": "0x6E4E",
"Name": "Bedroom_Switch",
"0006!02": "",
"Power": 2,
"Endpoint": 1,
"LinkQuality": 107
}
}
}
However on the Developer Tools page in home assistant under sensor.buttonpower it lists the value as unknown. I want the value to be 2, not unknown.
In the log I get this message:
2021-09-05 11:53:00 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: dict object has no element 28238 when rendering ‘{{value_json.0x6E4E.Power}}’
I’m running:
version core-2021.9.3
supervisor-2021.09.0
Do I need to define the power as an integer? What am I doing wrong?