Add time to time object

Hello, i currently have two time object (helper) named WAKE_ALARM and WAKE_ALARM_STEP2.
I just want to build an automation, triggered every night at 01.00 (after i set the wake-up alarm!), which read the time of WAKE_ALARM and write in WAKE_ALARM_STEP2 that time plus 15 minutes.
Ex. WAKE_ALARM == 7.00 -> WAKE_ALARM_STEP2 == 7.15

based on this helper i will trigger some automations (which i already have, but with a hardcoded time).

I understood that i need to call the service input_datetime.set_datetime
but what i should write in the “data” field?
Thanks since now to anyone can help!

The easiest way to do it would be to ensure that your wake_alarm and wake_alarm2 datetime also include the date instead of just the time.

then you could set the input_datetime to:

service: input_datetime.set_datetime
entity_id: input_datetime.wake_time2
  datetime: "{{ (state_attr('input_datetime.wake_time', 'timestamp') + 900) | timestamp_custom ('%Y-%m-%d %H:%M:%S') }}"

otherwise the conversion becomes harder to accomplish.

Many thanks for your help.
Based on your structure i went to this:

{{ states(“sensor.time”) == (state_attr(‘input_datetime.sveglia’ , ‘timestamp’) + (60*15) ) | timestamp_custom (“%H:%M”, false) }}

directly as trigger for an automation. So i can set the wakeup alarm and the automation trigger 15 minutes after that time.

Anyway i found a bug (?):

This is correctly trigger:

{{ states(“sensor.time”) == (state_attr(‘input_datetime.sveglia’ , ‘timestamp’) + (60*15) ) | timestamp_custom (“%H:%M”, false) }}

while this one not, and force to setup a timesensor

{{ now().strftime(“%H:%M”) == (state_attr(‘input_datetime.sveglia’ , ‘timestamp’) + (60*15) ) | timestamp_custom (“%H:%M”, false) }}

I’ll open a bug report, maybe this could be fixed later. Thanks.

Already reported (Issue 44063). You may wish to add your example to it so someone will fix it (8 days later and no one has been assigned yet).

Template Trigger employing now() throws an error

I just experienced the same bug. Left my “me too” on the linked issue.

You would have thought that this type of bug would have received a bit more attention. It’s kind of a basic functionality for it not to work in a trigger.

It explains why I’ve been struggling trying to help another user with a template trigger using now() and not understanding why it isn’t working.

Hopefully it won’t fall into the same oubliette containing my other Issue (unresolved for months). If you disable an entity, it’s disabled instantly. If you re-enable it, depending on the integration, you will have restart Home Assistant. Worst of all, even the ones that do get re-enabled (without a restart) do it according to some mysterious time period (i.e. re-enables itself in the UI after maybe 15-20 seconds). Basically, if it doesn’t come back after about a half minute, you need to restart to get it back. Truly ornery bug.

there is actually a message now when you re-enable entities that tells you that they will be re-added in 30 seconds. I don’t know when that started but I just noticed it a few days ago.


That message didn’t exist when I first reported the problem (and was never mentioned in the Issue).