Hello there.
I integrated openweathermap to my home assistant, so far no problems. Afterwards I set up the automation:
between 2h after sunrise and 2h before sunset (condition, because light normaly turns off 2h after sunrise)
if sunny or windy, turn light on (or action 1, same scene is used with other automations)
else turn the light on (or action 2, same scene is used with other automations)
Here is the code I got, what am I doing wrong? Looking outside the window, its cloudy, thats what openweathermap shows me as well (Sensors: condition=cloudy)
description: ""
trigger:
- platform: state
entity_id:
- sensor.openweathermap_condition
condition:
- condition: and
conditions:
- condition: time
after: input_datetime.sunrise_plus_2h
before: input_datetime.sunrise_minus_2h
action:
- if:
- condition: or
conditions:
- condition: state
entity_id: sensor.openweathermap_condition
state: windy-variant
- condition: state
entity_id: sensor.openweathermap_condition
state: sunny
then:
- service: scene.turn_on
target:
entity_id: scene.turn_off_all_lights
metadata: {}
else:
- service: scene.turn_on
target:
entity_id: scene.all_lights
metadata: {}
Or is it because it has to CHANGE the state, rather then just beeing e.g. cloudy?
In my understanding, betweend 2h after sunrise and 2h before sunset, as soon as cloud coverage goes above 75%, the light turns on. otherwise it switches all lights off…
Yet, it doesnt seem to work and after playing with the ifelse, conditionsm I still cant figure why… What did I overlook?