Automations are not running Automatically

Hello all

I have an Automation that Turns On the Living Room Light Switch if the Suns Solar Elevation has Dropped below 30 Degrees.

alias: Turn On Living Room Light when Sun is Below specific Solar Elevation
description: ''
triggers:
  - trigger: sun.elevation_crossed_threshold
    options:
      for: '00:00:00'
      threshold:
        type: below
        value:
          active_choice: number
          number: 30
conditions:
  - condition: light.is_off
    target:
      entity_id: light.tv_led_lights_2
    options:
      behavior: any
      for: '00:00:00'
  - condition: switch.is_off
    target:
      device_id: 3ce021fd40174ddc11e1e00ab835928c
    options:
      behavior: any
actions:
  - action: switch.turn_on
    metadata: {}
    target:
      device_id: 3ce021fd40174ddc11e1e00ab835928c
    data: {}
mode: single

This Automation has worked perfectly for some Time, however, over the Last Month it no longer seems to Run Automatically.

If I Run the Automation Manually, after confirming that the Suns Solar Elevation has Dropped Below the required point, it Runs perfectly, Turning On the Living Room Light Switch.

This Issue seems to have occurred after a Home Assistant Update, unfortunately, I do not know which one.

Any suggestions.

Thanks in advance

Kevin

Check your traces for the automation. I’d wager the reason is your tv_led_lights are reporting on or the switch is reporting on.

When you run actions, it doesn’t check the conditions. That’s when you check the trace to see what blocked the automation from running.

Hello

Thanks for the Reply.

I did check the Traces and the Automation did not even Run so no Conditions stopped it.

Thanks

Kevin

If the automation isn’t even running, there’s likely an issue with your home location and elevation set in general settings. Or you live in an area where the sun doesn’t set.

Hello

I have just checked the Home Settings and everything looks fine.

My Address is Correct as is the Elevation above Sea Level (9m).

Thanks

Kevin

elevation should be set to 0 unless you live in a skyrise, the property says “above sea level”, however that’s not the real meaning behind it. The real meaning is “above ground level”. But 9m will not alter the elevation too much. Make sure the sun integration is working accordingly though.

Hello

The Elevation above Sea Level has always been ‘0’, I just looked up the Elevations above Sea Level for my Address and it said it is 9m, which is what I changed it to.

Following what you have said, I have changed it back to ‘0’.

Thanks

Kevin

Home assistant doesn’t use elevation above sea level. The elevation in general settings is “height above ground level”. So if you’re in a highrise building on the 100th floor, you’d change that elevation to the height above ground.

Again, the label in general settings page is wrong. It falsely says “elevation above sea level”. You’re welcome to continue to use 9, but I’m fairly sure you don’t live 9 meters above the ground unless your house is floating.

Hi,

I did that too, because that is what the manual says…

Try to change the trigger to the below option. I think I remember adding a “Sun” integration via Settings → Devices.

30 minutes before sunset

  - trigger: sun
    event: sunset
    offset: '-00:30:00'

30 minutes after sunset

  - trigger: sun
    event: sunset
    offset: '00:30:00'