Advertisement
berd75

Untitled

Oct 20th, 2023
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.17 KB | Source Code | 0 0
  1.     ########################################
  2.     #
  3.     # 0  Alkonyat érzékelő - Nap magasság / felhőzöttség függvénye
  4.     #
  5.     ########################################
  6.       - name: 'felhos_alkony'
  7.         unique_id:
  8.         #friendly_name: Alkony kapcsoló
  9.         state: >
  10.            {% set h = now().hour %}
  11.             {% if ((
  12.                 (( states('sensor.openweathermap_cloud_coverage')|int >= 75 ) and ( state_attr('sun.sun', 'elevation') <= -2 ) and ( state_attr('sun.sun', 'elevation') > -3 ))
  13.                    or
  14.                 (( states('sensor.openweathermap_cloud_coverage')|int < 75 ) and ( states('sensor.openweathermap_cloud_coverage')|int >= 50 ) and ( state_attr('sun.sun', 'elevation') <= -3 ) and ( state_attr('sun.sun', 'elevation') > -4 ))
  15.                    or
  16.                 (( states('sensor.openweathermap_cloud_coverage')|int < 50 ) and ( state_attr('sun.sun', 'elevation') <= -4 ) and ( state_attr('sun.sun', 'elevation') > -5))              
  17.                )
  18.                and
  19.                ( h > 12 )
  20.                )
  21.             %}
  22.                 on
  23.             {% else %}
  24.                 off
  25.             {% endif %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement