Hi,
I managed to make a nice template to visualize a temp/humidity sensor and get the time since last change as the 4th row (hand writing in picutre) as a widget in my app
<center>
<strong>HB153</strong><br>
<span style="color:#3fbaf1;">
<big><big><strong>{{states('sensor.ute_trh_temperature')|float|round(1)}}°C</strong>°</big></big><br>
<big><strong>{{states('sensor.ute_trh_humidity')|float|round(1)}}%RH</strong></big><br>
<small>{{ relative_time( states.sensor.ute_trh_temperature.last_changed ) }}</small>
</center>
</span>
The sensor names are from my RTXtrx, that unfortunately have shown to have a really crappy receiver, so I have just sent it for warranty exchange.
Now I’m back on the same sensors, but from integration of my Telldus Tellstick Z-Net lite v2.
Sensors have other entity names and when I update entity names, like this:
<strong>HB153</strong><br>
<span style="color:#3fbaf1;">
<big><big><strong>{{states('sensor.5_hb153_temperature')|float|round(1)}}°C</strong>°</big></big><br>
<big><strong>{{states('sensor.5_hb153_humidity')|float|round(1)}}%RH</strong></big><br>
<small>{{ relative_time( states.sensor.5_hb153_temperature.last_changed ) }}</small>
</span>
Both temperature and humidity works with those sensor entity names, but not time since last change…and I can’t figure out why. In the widget template, the update button goes greyed out when I change entity name for last_changed
When I paste it the code without formatting into template in dev tools it looks like this:
and I can’t see I made any typo error while updating code…
If I remove last line, sensor entities works in HA dev template as well as in app:
I’m a beginner in coding - please help