1
0

Switch to presence sensor

This commit is contained in:
Przemek Grondek 2023-04-22 20:03:39 +02:00
parent efee6df844
commit 8e93e14df1
8 changed files with 183 additions and 82 deletions

View File

@ -34,7 +34,7 @@
condition:
- condition: numeric_state
entity_id: sensor.office_illuminance
below: '170'
below: '200'
action:
- service: script.hallway_lights_on

View File

@ -2,19 +2,22 @@
alias: '[Kitchen] Lights On'
mode: single
trigger:
# - platform: state
# entity_id: binary_sensor.kitchen_motion_sensor
# from: 'off'
# to: 'on'
# - platform: state
# entity_id: binary_sensor.kitchen_tabletop_motion_detection
# to: 'on'
- platform: state
entity_id: binary_sensor.kitchen_motion_sensor
from: 'off'
to: 'on'
- platform: state
entity_id: binary_sensor.kitchen_tabletop_motion_detection
entity_id: binary_sensor.presence_sensor_fp2_kitchen
to: 'on'
action:
- choose:
- conditions:
- condition: numeric_state
entity_id: sensor.office_illuminance
below: '170'
below: '200'
sequence:
- service: script.kitchen_lights_on
@ -23,30 +26,33 @@
mode: restart
trigger:
- platform: state
entity_id: binary_sensor.kitchen_motion_sensor
for: '0:02:00'
from: 'on'
entity_id: binary_sensor.presence_sensor_fp2_kitchen
to: 'off'
- platform: state
entity_id: binary_sensor.kitchen_sink_motion_sensor
to: 'off'
for: '0:02:00'
- platform: state
entity_id: binary_sensor.kitchen_tabletop_motion_detection
to: 'off'
for: '0:02:00'
condition:
- condition: state
entity_id: binary_sensor.kitchen_motion_sensor
state: 'off'
for: '0:02:00'
- condition: state
entity_id: binary_sensor.kitchen_sink_motion_sensor
state: 'off'
for: '0:02:00'
- condition: state
entity_id: binary_sensor.kitchen_tabletop_motion_detection
state: 'off'
for: '0:02:00'
# - platform: state
# entity_id: binary_sensor.kitchen_motion_sensor
# for: '0:02:00'
# from: 'on'
# to: 'off'
# - platform: state
# entity_id: binary_sensor.kitchen_sink_motion_sensor
# to: 'off'
# for: '0:02:00'
# - platform: state
# entity_id: binary_sensor.kitchen_tabletop_motion_detection
# to: 'off'
# for: '0:02:00'
# condition:
# - condition: state
# entity_id: binary_sensor.kitchen_motion_sensor
# state: 'off'
# for: '0:02:00'
# - condition: state
# entity_id: binary_sensor.kitchen_sink_motion_sensor
# state: 'off'
# for: '0:02:00'
# - condition: state
# entity_id: binary_sensor.kitchen_tabletop_motion_detection
# state: 'off'
# for: '0:02:00'
action:
- service: script.kitchen_lights_off

View File

@ -23,56 +23,7 @@
type: remote_button_alt_short_press
subtype: button_2
action:
- choose:
- conditions:
- condition: state
entity_id: light.couch_lights
state: 'on'
sequence:
- service: light.turn_off
entity_id: light.couch_lights
- conditions:
- condition: state
entity_id: light.couch_lights
state: 'off'
sequence:
- choose:
- conditions:
- condition: state
entity_id: input_select.home_mode
state: Day
sequence:
- choose:
- conditions:
- condition: state
entity_id: input_boolean.sleep_mode
state: 'on'
sequence:
- service: light.turn_on
entity_id: light.couch_lights
data:
brightness_pct: 100
kelvin: 2000
- conditions:
- condition: state
entity_id: input_boolean.sleep_mode
state: 'off'
sequence:
- service: light.turn_on
entity_id: light.couch_lights
data:
brightness_pct: 100
kelvin: 3200
- conditions:
- condition: state
entity_id: input_select.home_mode
state: Night
sequence:
- service: light.turn_on
entity_id: light.couch_lights
data:
brightness_pct: 5
kelvin: 2700
- service: script.living_room_lights_toggle
- id: living-room-button-3 # Middle left
alias: '[Living Room] Button 3 - AndroidTV'

View File

@ -0,0 +1,25 @@
- id: living-room-lights-on
alias: '[Living Room] Lights On'
mode: single
trigger:
- platform: state
entity_id: binary_sensor.presence_sensor_fp2_couch
to: 'on'
action:
- choose:
- conditions:
- condition: numeric_state
entity_id: sensor.office_illuminance
below: '200'
sequence:
- service: script.living_room_lights_on
- id: living-room-lights-off
alias: '[Living Room] Lights Off'
mode: restart
trigger:
- platform: state
entity_id: binary_sensor.presence_sensor_fp2_couch
to: 'off'
action:
- service: script.living_room_lights_off

View File

@ -26,7 +26,7 @@
trigger:
- platform: numeric_state
entity_id: sensor.office_illuminance
below: '170'
below: '200'
for:
hours: 0
minutes: 5
@ -43,6 +43,9 @@
- condition: state
entity_id: device_tracker.amdn4684
state: 'home'
- condition: state
entity_id: binary_sensor.presence_sensor_fp2_office
state: 'on'
- condition: state
entity_id: input_select.home_mode
state: Day

View File

@ -0,0 +1,25 @@
- id: office-lights-on
alias: '[Office] Lights On'
mode: single
trigger:
- platform: state
entity_id: binary_sensor.presence_sensor_fp2_office
to: 'on'
action:
- choose:
- conditions:
- condition: numeric_state
entity_id: sensor.office_illuminance
below: '200'
sequence:
- service: script.office_lights_on
- id: office-lights-off
alias: '[Office] Lights Off'
mode: restart
trigger:
- platform: state
entity_id: binary_sensor.presence_sensor_fp2_office
to: 'off'
action:
- service: script.office_lights_off

View File

@ -0,0 +1,25 @@
- id: table-lights-on
alias: '[Table] Lights On'
mode: single
trigger:
- platform: state
entity_id: binary_sensor.presence_sensor_fp2_table
to: 'on'
action:
- choose:
- conditions:
- condition: numeric_state
entity_id: sensor.office_illuminance
below: '200'
sequence:
- service: script.table_lights_on
- id: table-lights-off
alias: '[Table] Lights Off'
mode: restart
trigger:
- platform: state
entity_id: binary_sensor.presence_sensor_fp2_table
to: 'off'
action:
- service: script.table_lights_off

View File

@ -0,0 +1,66 @@
living_room_lights_toggle:
alias: '[Living Room] Lights toggle'
sequence:
- choose:
- conditions:
- condition: state
entity_id: light.table_lamp_lights
state: 'on'
sequence:
living_room_ice: script.table_lights_off
- conditions:
- condition: state
entity_id: light.table_lamp_lights
state: 'off'
sequence:
living_room_ice: script.table_lights_on
living_room_lights_on:
alias: '[Living Room] Lights on'
sequence:
- choose:
- conditions:
- condition: state
entity_id: input_select.home_mode
state: Day
sequence:
- choose:
- conditions:
- condition: state
entity_id: input_boolean.sleep_mode
state: 'on'
sequence:
- service: light.turn_on
entity_id: light.couch_lights
data:
brightness_pct: 100
kelvin: 2000
- conditions:
- condition: state
entity_id: input_boolean.sleep_mode
state: 'off'
sequence:
- service: light.turn_on
entity_id: light.couch_lights
data:
brightness_pct: 100
kelvin: 3200
- conditions:
- condition: state
entity_id: input_select.home_mode
state: Night
sequence:
- service: light.turn_on
data:
brightness_pct: 40
hs_color:
- 360
- 100
target:
entity_id: light.couch_lights
living_room_lights_off:
alias: '[Living Room] Lights off'
sequence:
- service: light.turn_off
entity_id: light.couch_lights