So I have this simple automation that turns on the inside light at sundown with an offset based on the cloud level.
alias: RDC - Au coucher du soleil
description: Allume des lumières au RDC
triggers:
- trigger: numeric_state
entity_id: sun.sun
attribute: elevation
below: sensor.sunset_elevation
conditions:
- condition: state
entity_id: light.lumiere_de_l_evier
state: "off"
actions:
- action: scene.turn_on
target:
entity_id: scene.rdc_lumieres_le_soir
sensor.sunset_elevation is defined as such
- default_entity_id: sensor.sunset_elevation
state: '{{ state_attr(''weather.openweathermap'', ''cloud_coverage'') / 100 * 3.36 + 1.33 }}'
name: sunset_elevation
It has worked perfectly, except last night (yeah, night, not evening lol).
This is the last five triggers of that automation:
Dec 8, 4:03:33pm
Dec 9, 3:49:19pm
Dec 10, 3:43:08pm
Dec 11, 1:56:01am
Dec 11, 3:43:01pm
Why the heck did it launch at 1:56am last night?!? According to System Monitor, the host last boot was last week and HA Uptime integration wasn’t loaded so I don’t know its uptime but I was asleep at that time so it wasn’t a restart I did.
In the mean time, I’ve added a condition to check if elevation is above 0 so it will no longer trigger at night.
