I’ve done a decent amount of searching and haven’t found quite what I’m looking for, so hoping for some help here. What I’m trying to do is set up a script where, when run, it adds an hour to the existing value of a datetime helper - so, if the current value is 6pm, when run it changes that to 7pm. However, as written, the value is set to an hour from now, not an hour from the current value. I’m quite certain I’ve got something wrong in the code, so I’m hoping someone can point out what that is.
Here’s what I’ve got:
alias: Extend Side Yard Activity
sequence:
- service: input_datetime.set_datetime
metadata: {}
data:
datetime: "{{ (state_attr('input_datetime.side_yard_activity_end', 'timestamp') + 3600) | timestamp_custom ('%Y-%m-%d %H:%M:%S') }}"
target:
entity_id: input_datetime.side_yard_activity_end
mode: single
icon: mdi:clock-time-one
Thanks in advance!