I use an automation for my luxaflex duettes that should be triggered on sunrise/sunset. When I set a state trigger on the sun.sun device, it works, but it seems to trigger multiple times. So I defined the sunset and sunrise events as a trigger. Seems to be fairly simple, but it doesn’t get triggered. Anyone an idea of what I am doing wrong?
not given straight answer, but some experience here.
below trigger, triggered this morning at 7:34 (and sunrise was 7:04). Meaning possible things to think about:
format for offset
offset means ‘after sunrise’, so sun is above horizon.
i’m not familair with 2 triggers for same event yet, so would suggest to do 1 trigger to test with first.
trigger:
- platform: sun
event: sunrise
offset: '00:30:00'
The action part seems to work. When I use this as a trigger, it works (but triggered many times). When I Manually changed the Duettes and it get’s triggered again during the day, it sets the duettes in the dayscene again…
trigger:
- platform: state
entity_id: sun.sun
I am not sure when a sunset event is fired, if the state is below_horizon at that time, since I test on that (to avoid having seperate automations for up and down).
The formatting suggestion would be interesting, since I used the UI to configure it. However I tried using no delay (and thus no formatting issue). That seems to have no effect.
That answer is kind of vague but taking it at face value I’m not sure it works as you might think.
“single” mode only prevents the automation from running more than one simultaneous instances of the automation. It can still trigger hundreds of times a day if the trigger is satisfied.
if the automation is currently running (meaning the automation actions haven’t completed and “current:” attribute value is not 0) if the trigger occurs again then the trigger is ignored. This is usually only affected for actions that have a delay of some kind either thru a programmed “delay:” entry or if a service call is waiting for a response from a device to move to the next action step. But it can happen for any automation if the trigger is detected in succession quickly enough.
but if the trigger happens again when the automation is no longer active (“current:” value is 0) then the automation will run immediately as soon as the trigger and conditions are met.
Using restart in this case won’t really affect anything since that mode tells the automation to cancel it’s actions and start over again if the trigger occurs as the automation action are in progress. since the triggers are single events many hours apart there should be no way for the trigger to re-occur and cause the automation to cancel/restart its actions.
So all of that said I really doubt that the mode has anything to do with the automation not running.
The problem with using a state trigger is that the automation will trigger on every state or attribute change of the entity.
using sunrise/sunset only allows it to trigger on those events and will ignore all the other attribute changes.
I don’t see anything obvious why the automation in your first post shouldn’t run.
to troubleshoot you could try to split them into two separate automations (instead of one using “choose:”) and see if they work like that.