You can’t have an offset in a state condition, that doesn’t make any sense.
The offset is used in combination with a condition from the sun platform not from the state platform.
Do you want the condition to be from 45 minutes before sunset until sunrise?
If so then use this:
condition:
condition: or
conditions:
- condition: sun
after: sunset
after_offset: "-00:45:00"
- condition: sun
before: sunrise
The new automation editor added code that is not explained in the conditions.
before: sunrise
before_offset: '01:00:00'
condition: sun
Before there was just offset. Does the before change the meaning to before the event or does this mean the same and '01:00:00 means an hour after sunrise or does the before change the meaning?
I want 1 hour before sunrise? Do I continue to use the -1?
What do you mean it is not explained in the conditions? It’s right there in the first example of the sun condition part of the condition docs. There’s also a chart explaining the offsets there.
To get 1 hour before sunrise you need this:
before: sunrise
before_offset: '-01:00:00'
condition: sun
Thanks for clearing it up.
All the examples in the chart are for + values. I always have a hard time seeing before a time as a minus. (Two negatives (before & minus) , gives me a positive). As long as I know how it is suppose to work, I can work with it.