I have an automation that will turn on my sauna based on a delay that I set on a Lovelace card. In this card I also have a duration (i.e.: for 2 hours). I also have a conditional card that only shows when the sauna is scheduled to turn on that tells me the time (hour) when the sauna will be on.
I have created MQTT sensor so when I turn on the sauna via my automation it will publish, via MQTT, the turn on time that shows on the conditional card above.
As I set a turn on delay, plus a duration period, I would like to have conditional card that shows when the sauna will be on and when it will turn off. Let’s say:
Sauna will turn on at XX:YY
Sauna will turn off at ZZ:WW
I could create a second sensor and use the automation to publish also the turn off time. However, I think HA may have a better solution for that.
This said, any suggestion on how to accomplish it?
Where/how do you store this? (that’s literally your only missing piece from just creating a custom button card or markup card that does the time-math and displays it.)
saunaonat:
unique_id: 1223387662543QLT43
friendly_name: "Turn on Sauna at"
value_template: >
{% set delay = int(states('input_number.sauna_atrazo')) %}
{% set hora = now() + timedelta(minutes=delay) %}
{{ hora.strftime('%H:%M') }}
I could just create another sensor called “saunaoffat” and use the automation to set it. My concern is just because I may be doing “complicated” things with no need.
The sauna power is controlled by an ESP32 running Tasmota.
I have created a input_boolean helper. When I turn on the input_boolean button on Lovelace an automation will get the current time, add the delay, set this time on the “saunaonat” template you see above. This time is then sent to a Tasmota internal timer. The Tasmota will then turn on the sauna at this time.
At the same time I send the time to turn on the sauna I also send the time it should be on. This will be loaded into a Tasmota counter that decrements in seconds. When this counter reaches 0, then the Tasmota shuts down the sauna.