The goal is to add on the fly adjustments to the lights based upon changes in cloud cover. It works great as a condition when the lights are off. But, my problem these days with a sick kid at home (Covid fun when it’s supposedly over…yay) is that constant movement means lights are always on. So, they do not end up adjusting to the outdoor light change.
I recognize this isn’t the best but it’s what I have to work with at the moment. Sometime I’ll look into spending dinero I don’t have for ambient light sensors.
The trigger I came up with is:
trigger:
- type: cloudcover
platform: device
device_id: 45a6ae64e81ca2ca86450430756e47f8
entity_id: sensor.openweathermap_cloud_coverage
domain: sensor
above: 49
below: 101
for:
hours: 0
minutes: 10
seconds: 0
milliseconds: 0
The below/above adjustments are odd I grant you. I am using -1 and 101 because cloud cover can be 0 and can be 100.
I wrote the YAMLs as follows:
- id: '331899958999004'
alias: Kitchen lights on with no cloud cover already on adjustment
trigger:
- type: cloudcover
platform: device
device_id: 45a6ae64e81ca2ca86450430756e47f8
entity_id: sensor.openweathermap_cloud_coverage
domain: sensor
above: -1
below: 20
for:
hours: 0
minutes: 10
seconds: 0
milliseconds: 0
condition:
- condition: and
conditions:
- condition: sun
before: sunset
before_offset: -01:30:01
- condition: time
after: 09:00
action:
- service: light.turn_on
target:
entity_id: light.kitchen_main_lights
data:
brightness_pct: 0
- service: light.turn_on
target:
entity_id: light.kitchen_under_cabinet
data:
brightness_pct: 30
- service: switch.turn_off
target:
entity_id: switch.kitchen_sink_light
- id: '331899958999003'
alias: Kitchen lights on with lots of cloud cover already on adjustment
trigger:
- type: cloudcover
platform: device
device_id: 45a6ae64e81ca2ca86450430756e47f8
entity_id: sensor.openweathermap_cloud_coverage
domain: sensor
above: 49
below: 101
for:
hours: 0
minutes: 10
seconds: 0
milliseconds: 0
condition:
- condition: and
conditions:
- condition: sun
before: sunset
before_offset: -01:30:01
- condition: time
after: 09:00
action:
- service: light.turn_on
target:
entity_id: light.kitchen_main_lights
data:
brightness_pct: 50
- service: light.turn_on
target:
entity_id: light.kitchen_under_cabinet
data:
brightness_pct: 70
- service: switch.turn_off
target:
entity_id: switch.kitchen_sink_light
- id: '331899958999001'
alias: Kitchen lights on with some cloud cover already on adjustment
trigger:
- type: cloudcover
platform: device
device_id: 45a6ae64e81ca2ca86450430756e47f8
entity_id: sensor.openweathermap_cloud_coverage
domain: sensor
above: 15
below: 50
for:
hours: 0
minutes: 10
seconds: 0
milliseconds: 0
condition:
- condition: and
conditions:
- condition: sun
before: sunset
before_offset: -02:00:00
- condition: time
after: 09:00
action:
- service: light.turn_on
target:
entity_id: light.kitchen_main_lights
data:
brightness_pct: 25
- service: light.turn_on
target:
entity_id: light.kitchen_under_cabinet
data:
brightness_pct: 60
- service: switch.turn_off
target:
entity_id: switch.kitchen_sink_light
I’m not sure if this is proper to make the triggers work on the fly here. Additionally, I’m not sure about this -1 and 101 to capture 0 and 100 cloud coverage for triggers.
Any input is greatly appreciated.