Buhi
January 30, 2019, 11:02am
1
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?
cgtobi
(Tobi)
January 30, 2019, 11:08am
2
Take a look at the sun component .
It provides elevation and azimuth.
milanvo
January 30, 2019, 11:38am
3
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
Buhi
January 30, 2019, 12:02pm
4
Thank you. It worked for me. Now i understand how it works. This helps me also for other problems.
- platform: template
sensors:
sonnenstand_xxxxxx:
friendly_name: "Sonnenstand XXXXX"
unit_of_measurement: '°'
value_template: "{{ state_attr('sun.sun', 'elevation') }}"
3 Likes
vormsty
(Vormsty)
June 2, 2020, 12:23am
5
Hello,
Is that possible to have a jauge with the sun elevation ?
Best regards
aldihome
(Leon)
September 8, 2022, 10:23am
7
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