#Manage Time changes (UTC to UTC+1)

1 messages · Page 1 of 1 (latest)

midnight nymph
#

I'm trying to find how to gather the ON DTS and then add variable period of time to calculate the Off time.
Below has been working while time = UTC , but following clock changes the calculation for Off is before the On time.

I don't believe it should be complicated but searching is not giving me the answer.

  • action: input_datetime.set_datetime
    target:
    entity_id: input_datetime.water_boiler_off
    data:
    time: >-
    {{ (now().timestamp()

      +
    
      state_attr('input_datetime.water','timestamp')) |
      timestamp_custom('%H:%M',false)}}
    
zealous ether
#

Could you elaborate what is your end goal?

midnight nymph
#

The ON time can vary so I want to snapshot the time the entity turned on and then add a defined variable time span and store the calculated result in a DTS helper to use in automations.

ON time + variable time = OFF time

#

Do I need to change how I capture the ON time from now() to some other method ?

midnight nymph
#

RESOLVED by changing logic and not using now() - now use

((as_timestamp(state_attr("script.hot_water", "last_triggered")) 

for the ON time

vast crown
#

Going forward: