It tracks how many seconds till alarm triggers. But I would like to make it a template sensor. When I use it as a value_template it doesn’t update. Only after restarting Hassio and then nothing. How should I make it update state?
I think it is. There is entity_id variable - your sensor will update its state every time that entity changes state.
Not sure about using time directly, but if you create a input_boolean and an automation that toggles it every second (trigger: platform: time_pattern) and use that entity, it’ll do the trick
What do you propose then? If my sensor is unavailable and template sensor with as_timestamp is active, it shows me too many errors like in this thread How to find config error?
yeah, unknown is returned when there is no such entity.
unavailable is returned when the entity does exist, but there is no definite state of the entity in question (i.e offline MQTT sensor/switch).