How to fire sunrise/sunset event for testing automations

I am trying to use the Developer Tools → Events page to fire a sunrise event to test some automations I made, without waiting until tomorrow. Is there a simple way to do this? I guess I am not sure what to add in the Event Data (for the Event Type, I just have ‘sunrise’ without the quotes).
If I listen for the sunrise event, I can see the event I fired with empty data {}, but it does not trigger any of my automations, so I know I am missing something.

Here is one of my triggers:

trigger:
  - platform: sun
    event: sunrise
    offset: '0'

Are you trying to test the actions? If yes, you can got to configuration → automations and just run the actions. Blue button next to the automation.

Unfortunately, I am trying to test the conditions, which are not evaluated when you just manually run the action.

1 Like

Does anyone know the name of the sunrise event? Worse case, I can listen for it to figure out what it sends normally.
So far I have listened for sun and sunrise, but neither of those are right.

Can’t you just set it/override in Developer Tools > States?

Execute the automation.trigger service, for your automation, from Developer Tools > Services and disable Skip conditions. It will still skip the trigger section but will include the condition section.

Be advised that if your automation’s condition or action references the trigger variable, testing it this way won’t work because the trigger variable will be undefined (for more information, refer to Automation - Testing your automation).

1 Like

Clever idea, but this did not trigger the event for me. Did this work for you?

This worked, thank you!