I already have an automation that turns on a light a set time before sunset. It seems to work but I’d like to modify it to compensate for cloudy evenings. On cloudy days, I wanted the light to come on sooner but I couldn’t figure out how to do it efficiently so I just compensated by adjusting the time to trigger the light sooner. Obviously, Home Assistant has the Sun integration but I’ve also installed the OpenWeatherMap integration. So, I have a couple I can work with. Below is the current working automation. Feel free to suggest improvements for it as well as helping to solve the aforementioned issue.
alias: Turn on Sink Light - Before Sunset
description: Turns on the light over the sink prior to sunset.
trigger:
- platform: sun
event: sunset
offset: -00:60:00
condition:
- condition: state
entity_id: light.kitchen_sink_light
state: 'off'
action:
- service: light.turn_on
data:
brightness_pct: 10
entity_id: light.kitchen_sink_light
entity_id: light.kitchen_sink_light
mode: single
I’m, assuming I would have to add another trigger to read data from something like: sensor.openweathermap_cloud_coverage
If you search the forum you will see this has been tried before and it is a poor idea.
Sun at a low angle reflecting off the clouds can be very bright.
Do yourself a favour and buy a cheap Lux meter. If you are into DIY a BH1750 and an ESP8266 running ESPHome can cost less than $15, is extremely reliable and integrates perfectly with Home Assistant.