Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 107618

Help on template sensors and unavailable after restart

$
0
0

Hi, need a little help on templates.

I have a template I only update daily, at midnight. I then use this number in other calculations. It works as expected, however I have the problem that after a restart the sensor is shown as “unavailable” until next midnight.

Here is the template sensor

- trigger:  ## Daily at midnight
  - platform: time
    at: 
      - "00:00:01"
  sensor:
  - name: "Utility El usage Day increasingtotal temp-number"
    state: >
      {{ states('sensor.develco_zhemi101_f21a021b_smartenergy_metering_summation_delivered') }}

I have tried to find a way to update a helper from the sensor, as this will keep the state after a reboot, however can not figure out how

I have tried with a template that also update at restart. It works, however the number will be wrong, as it is not from midnight (will show the number from restart time)

I have tried using a utility sensor, and have the number comming form “laststate”. This works, however takes up a lot of space in the DB, for only this one small number (utility sensor will update every time the original entity updates, which is a lot)

Ideas? I can not figure out how to do this in a simple way

Easiest solution would be a automation updating a “helper”. However I can not figure out how.

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 107618

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>