Hi, I have a heating controller with a boost function where I want to use a text sensor to publish the off-time of the boost.
For example if a user hits the 1hr boost button at 13:45, the text sensor should publish 14:45 to HA.
In the example below I can publish the on-time of the boost button-press, but what is the best way to convert that time by adding the duration of the boost?
- id: heating_downstairs_1hr
mode: restart
then:
- switch.turn_on: brb_ds_direct
- light.turn_on:
id: button_light_switch_1
effect: "HeatingActive"
brightness: 90%
- text_sensor.template.publish:
id: text_time_ds_heating
state: !lambda |-
char str[17];
time_t currTime = id(ds1307_time).now().timestamp;
strftime(str, sizeof(str), "%H:%M", localtime(&currTime));
return { str };
- logger.log: "BoilerRelayBoard DS on"
- delay: 60 min
I have a feeling that I need to convert now() into an epoc and then add the equivalent of 60 mins, but is there a more effective way?
Also, the time being published to HA is in GMT (we are GMT+1 summertime currently), how is that best handled in Esphome, or do I need to handle it within HA instead?