Hi,
Trying to get entity last update, everything I found doesn’t help. I have Xiaomi sensors that work through zigbee2mqtt and MQTT integration.
When trying to get a template like this:
{{ states.sensor.0x00158d000315a681_temperature.last_changed }}
I get error:
invalid template (TemplateSyntaxError: expected token 'end of print statement', got 'x00158d000315a681_temperature') for dictionary value @ data['template']. Got '{{ states.sensor.0x00158d000315a681_temperature.last_changed }}\n{{ states.sensor.cpu_temperature.last_changed }}'
It works with other sensors, e.g. CPU core temperature. Meanwhile UI on device shows the last update time, so it is stored somewhere.
Do you have a clue on where the issue could be or maybe there is a topic already that I haven’t found?