Sun: above / below horizon gone?

Last year i did several automations with sun above and sun below horizon. Somewhere since new year the unchanged automations behave strange or fail.

It should be used as trigger addition, as example here within logical AND

condition: and
conditions:

  • condition: state
    entity_id: sun.sun
    state: above_horizon
    attribute: elevation

Changed automation with this block today result to “never turn on”, the sun is never above or below horizon for hassio. The old sun.above sun.below seems to exist anymore, what’s the new method to peek for day or night?

Still exists

But delete

from your condition

  - platform: template
    sensors:
      solar_angle:
        friendly_name: "Sun angle"
        unit_of_measurement: "degrees"
        value_template: "{{ state_attr('sun.sun', 'elevation') }}"

      sunrise:
        value_template: "{{ state_attr('sun.sun', 'next_rising') }}" 

Create new senors

Not needed — the problem is just the attribute that has been populated when it should not have been.

This often happens: the design of the UI encourages the user to select an attribute when it should be left blank to read the entity state.

1 Like