Hi,
I have this template sensor that is populated by a script. It is meant to store a specific amount of seconds that the script calculates. Anyway, here's my template.yaml:
- trigger:
- platform: event
event_type: thisshouldnevertrigger
sensor:
- name: "Orange Duration"
unique_id: 1723585496000
icon: "mdi:sort-clock-descending-outline"
state: None
unit_of_measurement: s
state_class: measurement
attributes:
caller: None
The attribute caller restores without fail, but the state (which is numeric) is set to unknown upon both restart and template entities reload.
What's the issue here?
The HA docs say: «The state, including attributes, of trigger-based sensors and binary sensors is restored when Home Assistant is restarted. The state of other trigger-based template entities is not restored.»