Sunset trigger options

I was tinkering with some automations that use sunset as a trigger time, and noticed that in the HA docs it mentions using the sun elevation trigger for more granular control.
Are there any plans to include the sun elevation as an option when selecting time/location as a trigger? I only see sunset and sunrise as the 2 options to pick from. Understandable that even though it is recommended, only a small percentage of HA users may actually use it…
I know it can be done in yaml, but with the automations area getting more streamlined I wondered if this was on the horizon or not.

Thanks

As a trigger in an automation, by selecting Entity / Numeric state, then manually typing in “azi” that should provide the azimuth sensor from the Sun Integration.

Similarly, typing in “elevation” should provide the Sun elevation entity.

I believe azimuth and elevation are disabled by default. If the entity does not populate go to the sun integration and click on disabled entities, then enable them.

Also check out sun2, it adds additional sun events.

1 Like

Thanks for the info on this. I knew I could use those options via a state condition if they were enabled, just was curious if there was enough interest to have those type of options available as a radial button when selecting the ‘Sun’ option.

also, I went to that Sun2 github page but something isn’t lining up right. The integration button gives and error about not able to configure in UI even though everything is up to date. and if I search for Sun2 in the add integrations area nothing comes up.
Any ideas on that?

Did you restart HA core after the import of the integration?
The integration might first be available in the integration store after a restart.
Also if you have had sun2 installed previously, then you might have remnants in the configuration.yaml file from then, because it was configured there in earlier versions and that can cause issues with the GUI configuration in newer versions.

You don’t even need to enable the azimuth sensor unless you want it cluttering up your LTS. It’s also reported as an attribute of the sun.sun entity, so you can just do this:

trigger: numeric_state
entity_id:
  - sun.sun
attribute: azimuth
above: 25

1 Like

yeah I restarted core, then did a full HA reboot and still nothing. I also checked the yaml config file and there is nothing in there referencing the sun2 setup.

Make sure you’ve done all the steps…

Step 1: If you haven’t already, installed HACS

Step 2: Open the Sun2 repo in HACS, download it.

Step 2.5: I don’t remember if it’s necessary, but it wouldn’t hurt to restart HA at this point.

Step 3: Set up Sun2 in the Integrations tab.

1 Like

now we’re cooking, thank you.
I was aiming in the direction of something obviously not being available/downloaded, but didn’t get as far as finding that repo link for HACS.
Looks good so far!