Below is my insane attempt at creating a fun scene for the family room. Part of the time it is joined with the kitchen and entry hall in a group of motion directors. The rest of the time, like overnight, it is on its own motion detector. For whatever reason, the lights are staying on all night and not being turned off via no motion. I’m at a loss and sure I’m screwing up royally somewhere. Any help appreciated.
- id: '1899958999017'
alias: FAMILY room lights on with some cloud cover
trigger:
platform: state
entity_id:
- binary_sensor.family_room_occupancy
to: 'on'
condition:
- condition: and
conditions:
- condition: numeric_state
entity_id: sensor.openweathermap_cloud_coverage
above: 60
below: 70
- condition: sun
before: sunset
before_offset: -02:00:00
- condition: time
# before: 18:00
after: 09:00
action:
- service: light.turn_on
target:
entity_id: light.family_room_main_lights
data:
brightness_pct: 30
- id: '1899959999017'
alias: FAMILY room lights on with some cloud cover set brightness if lights already
on
trigger:
platform: time
at: 09:00:01
condition:
- condition: and
conditions:
- condition: state
entity_id: light.family_room_main_lights
state: 'on'
action:
- service: light.turn_on
target:
entity_id: light.family_room_main_lights
data:
brightness_pct: 30
- id: '1899958999016'
alias: FAMILY room lights off
trigger:
platform: state
entity_id:
- binary_sensor.family_room_occupancy
to: 'off'
for:
minutes: 2
condition:
- condition: time
after: "21:30:00"
before: "16:30:00"
action:
- service: light.turn_off
entity_id: light.family_room_main_lights
- id: '1899958999018'
alias: FAMILY room lights off based on evening
trigger:
platform: state
entity_id:
- group.family
to: 'off'
for:
minutes: 2
condition:
- condition: time
before: "21:30:00"
after: "16:30:00"
action:
- service: light.turn_off
entity_id: light.family_room_main_lights
- id: '1899958999011'
alias: FAMILY room lights lots of cloud cover
trigger:
platform: state
entity_id:
- binary_sensor.family_room_occupancy
to: 'on'
condition:
- condition: and
conditions:
- condition: numeric_state
entity_id: sensor.openweathermap_cloud_coverage
above: 70
- condition: sun
before: sunset
before_offset: -02:00:00
- condition: time
after: "09:00"
before: "20:00"
action:
- service: light.turn_on
target:
entity_id: light.family_room_main_lights
data:
brightness_pct: 30
- id: '1899958999012'
alias: FAMILY room lights with barely cloud cover
trigger:
platform: state
entity_id:
- binary_sensor.family_room_occupancy
to: 'on'
condition:
- condition: and
conditions:
- condition: numeric_state
entity_id: sensor.openweathermap_cloud_coverage
above: 30
below: 50
- condition: sun
before: sunset
before_offset: -02:00:00
- condition: time
after: "09:00"
before: "20:00"
action:
- service: light.turn_on
target:
entity_id: light.family_room_main_lights
data:
brightness_pct: 0
- id: '1899958999013'
alias: FAMILY room lights evening time
trigger:
platform: state
entity_id:
- group.family
to: 'on'
condition:
- condition: and
conditions:
- condition: sun
after: sunset
after_offset: -02:00:00
- condition: time
before: "20:30"
after: "15:20"
action:
- service: light.turn_on
target:
entity_id: light.family_room_main_lights
data:
brightness_pct: 60
- id: '1899959998017'
alias: FAMILY room lights evening time set brightness if lights already on
trigger:
platform: sun
event: sunset
offset: -01:59:00
condition:
- condition: and
conditions:
- condition: state
entity_id: light.family_room_main_lights
state: 'on'
action:
- service: light.turn_on
target:
entity_id: light.family_room_main_lights
data:
brightness_pct: 60
- id: '1899958999014'
alias: FAMILY room lights late night
trigger:
platform: state
entity_id:
- group.family
to: 'on'
condition:
- condition: time
before: '06:00'
after: '20:30'
action:
- service: light.turn_on
target:
entity_id: light.family_room_main_lights
data:
brightness_pct: 25
- id: '1899959999014'
alias: FAMILY room late night set brightness if lights already on
trigger:
platform: time
at: '20:30:01'
condition:
- condition: and
conditions:
- condition: state
entity_id: light.family_room_main_lights
state: 'on'
action:
- service: light.turn_on
target:
entity_id: light.family_room_main_lights
data:
brightness_pct: 25
- id: '1899958999015'
alias: FAMILY room lights morning
trigger:
platform: state
entity_id:
- group.family
to: 'on'
condition:
- condition: time
after: 06:00
before: 09:00
action:
- service: light.turn_on
target:
entity_id: light.family_room_main_lights
data:
brightness_pct: 40
- id: '1899959999015'
alias: FAMILY room morning set brightness if lights already on
trigger:
platform: time
at: 06:00:01
condition:
- condition: and
conditions:
- condition: state
entity_id: light.family_room_main_lights
state: 'on'
action:
- service: light.turn_on
target:
entity_id: light.family_room_main_lights
data:
brightness_pct: 40