Tweak wife's desk lights handler, add lux condition for computer trigger

This commit is contained in:
2024-04-15 17:33:47 -04:00
parent d8146a0f41
commit ff9c081887

View File

@ -1740,47 +1740,66 @@
from: 'off' from: 'off'
to: 'on' to: 'on'
id: toggle-on id: toggle-on
alias: Toggle On
- platform: state - platform: state
entity_id: input_boolean.tina_desk_lights entity_id: input_boolean.tina_desk_lights
from: 'on' from: 'on'
to: 'off' to: 'off'
id: toggle-off id: toggle-off
alias: Toggle Off
- platform: state - platform: state
entity_id: input_select.tina_desk_scenes entity_id: input_select.tina_desk_scenes
to: Reset to: Reset
id: reset id: reset
alias: Reset
- platform: state - platform: state
entity_id: light.tina_desk_lights entity_id: light.tina_desk_lights
from: 'on' from: 'on'
to: 'off' to: 'off'
id: lights-off id: lights-off
alias: Lights Off
- platform: state - platform: state
entity_id: light.tina_desk_lights entity_id: light.tina_desk_lights
from: 'off' from: 'off'
to: 'on' to: 'on'
id: lights-on id: lights-on
alias: Lights On
- platform: state - platform: state
entity_id: binary_sensor.tina_desktop_on entity_id: binary_sensor.tina_desktop_on
from: 'off' from: 'off'
to: 'on' to: 'on'
id: computer-on id: computer-on
alias: Computer On
condition: [] condition: []
action: action:
- if: - alias: Reset
- condition: or if:
- alias: Triggered by Toggle On, Reset, or Computer On
condition: or
conditions: conditions:
- condition: trigger - condition: trigger
id: toggle-on id: toggle-on
alias: Toggle On
- condition: trigger - condition: trigger
id: reset id: reset
- condition: trigger alias: Reset
id: computer-on - alias: Computer On
condition: and
conditions:
- condition: trigger
id: computer-on
alias: Triggered by Computer On
- alias: Light level below threshold
condition: numeric_state
entity_id: sensor.dining_room_illuminance
below: 40
then: then:
- service: input_select.select_option - service: input_select.select_option
target: target:
entity_id: input_select.tina_desk_scenes entity_id: input_select.tina_desk_scenes
data: data:
option: '{{ states(''sensor.tina_desk_scene'') }}' option: '{{ states(''sensor.tina_desk_scene'') }}'
alias: Reset to appropriate default scene
- if: - if:
- condition: trigger - condition: trigger
id: toggle-off id: toggle-off
@ -1789,6 +1808,7 @@
target: target:
entity_id: light.tina_desk_lights entity_id: light.tina_desk_lights
data: {} data: {}
alias: Toggle Off
- if: - if:
- condition: trigger - condition: trigger
id: lights-off id: lights-off
@ -1802,6 +1822,7 @@
target: target:
entity_id: input_boolean.tina_desk_lights entity_id: input_boolean.tina_desk_lights
data: {} data: {}
alias: Lights Off
- if: - if:
- condition: trigger - condition: trigger
id: lights-on id: lights-on
@ -1818,6 +1839,7 @@
- delay: - delay:
seconds: 2 seconds: 2
alias: Prevent script from re-triggering when boolean is turned on alias: Prevent script from re-triggering when boolean is turned on
alias: Lights On
mode: single mode: single
- id: '1696286403914' - id: '1696286403914'
alias: Basement Lights Handling alias: Basement Lights Handling