#No negative offsets

1 messages · Page 1 of 1 (latest)

verbal dust
#

The time trigger to trigger at a specific time with an offsets seems like it should almost always be used with a negative offset however if I want to blueprint that offset there is no input type that works since duration only allows positive offsets and, as far as I have seen, the offset attribute cannot be templated.

I am trying to make a sunrise alarm but I want the user facing side to simply have to input an alarm time (when the light should be 100% on) and a duration, this means that the automation needs to trigger duration time before the alarm time, but I cannot get a negative duration nor template a positive duration to be negative.

Is there an something I am missing or should negative offsets be allowed?

#

to clarify, I need the functionality of either

triggers:
  - at:
      entity_id: !input time_entity
      offset: !input sunrise_start
    trigger: time

with a negative sunrise_start
or

trigger_variables:
  duration: !input sunrise_duration
triggers:
  - at:
      entity_id: !input time_entity
      offset: "-{{duration}}"
    trigger: time
verbal dust
#

It is solvable using text as input but that is a concession I do not quite like.

small dew
#

I simply use a template helper which contains the alarm time minus 10 minutes and use that to trigger the alarm.

I suspect you could use a template trigger as well if it's easier for you.