Sun elevation sensor

Hi there.

I built a greenhouse but there is a building near by. So i wanted to have a sensor that gives the elevation as an numeric angle. Then i can check when the angle is enough that the sun reaches my geodome.
I searched the forum already. But i didn’t found a solution.
Does somone have an idea?

Take a look at the sun component.

It provides elevation and azimuth.

Hi,

I am using sun component attributes directly in automation trigger. You can sure setup template sensor https://www.home-assistant.io/components/sensor.template to get elevation (sun elevation example included).

automation:
  - alias: automate something 
    initial_state: true
    trigger:
    - platform: numeric_state
      entity_id: sun.sun
      value_template: "{{ state.attributes.azimuth }}"
      above: 80
      below: 82
    - platform: numeric_state
      entity_id: sun.sun
      value_template: "{{ state.attributes.elevation }}"
      above: 5
      below: 7

Thank you. It worked for me. Now i understand how it works. This helps me also for other problems. :wink:

  - platform: template
    sensors:
     sonnenstand_xxxxxx:
       friendly_name: "Sonnenstand XXXXX"
       unit_of_measurement: '°'
       value_template: "{{ state_attr('sun.sun', 'elevation') }}"
3 Likes

Hello,
Is that possible to have a jauge with the sun elevation ?

Best regards

Coming a bit late but in case you’re still interested this might be a good fit GitHub - AitorDB/home-assistant-sun-card: Home assistant sun card based on Google weather design @vormsty

Since the Legacy binary sensor should not be used anymore it works like this now:

template:
  - sensor:
      - name: "Sonnenstand"
        unit_of_measurement: "°"
        state: >
          {{ state_attr('sun.sun', 'elevation') }}
2 Likes