Hi,
I’m planning to control light brightness based on sun’s elevation. I’m triggering an automation peridically. The problem is how should I format the equation for brightness_pct value. I’m having hard time to understand yaml.
Code below. Thanks in advance.
alias: testi
description: ""
triggers:
- trigger: time_pattern
hours: "0"
minutes: "0"
seconds: "0"
conditions:
- condition: numeric_state
entity_id: sensor.sun_solar_elevation
above: -6
below: 0
- condition: time
after: "07:00:00"
before: "20:00:00"
actions:
- action: light.turn_on
metadata: {}
data:
transition: 59
brightness_pct: "{{ float(sun_solar_elevation) * -16.66 }}"
target:
entity_id: light.ylakerta_reittivalo
mode: single