techposts

LD2420/LD2410 Automation for Home Assistant

Oct 20th, 2024 (edited)
2,054
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.09 KB | Software | 0 0
  1. alias: Desktop Work Mode
  2. description: Controls Bedroom lights based on work mode and movement distance.
  3. triggers:
  4.   - entity_id: sensor.bedroompresencedetection_moving_distance
  5.     below: 110
  6.     above: 4.8
  7.     trigger: numeric_state
  8.   - entity_id: sensor.bedroompresencedetection_moving_distance
  9.     above: 210
  10.     trigger: numeric_state
  11.   - entity_id: sensor.bedroompresencedetection_moving_distance
  12.     below: 0
  13.     trigger: numeric_state
  14. actions:
  15.   - choose:
  16.       - conditions:
  17.           - condition: numeric_state
  18.             entity_id: sensor.bedroompresencedetection_moving_distance
  19.             below: 110
  20.             above: 4.8
  21.         sequence:
  22.           - target:
  23.               entity_id:
  24.                 - switch.bedroom_lights_bedroom_light_1
  25.                 - switch.bedroom_lights_bedroom_light_2
  26.             action: switch.turn_on
  27.             data: {}
  28.           - target:
  29.               entity_id:
  30.                 - switch.bedroom_lights_bedroom_light_3
  31.                 - switch.bedroom_lights_bedroom_light_4
  32.             action: switch.turn_off
  33.             data: {}
  34.       - conditions:
  35.           - condition: numeric_state
  36.             entity_id: sensor.bedroompresencedetection_moving_distance
  37.             above: 210
  38.         sequence:
  39.           - target:
  40.               entity_id:
  41.                 - switch.bedroom_lights_bedroom_light_1
  42.                 - switch.bedroom_lights_bedroom_light_2
  43.                 - switch.bedroom_lights_bedroom_light_3
  44.                 - switch.bedroom_lights_bedroom_light_4
  45.             action: switch.turn_on
  46.             data: {}
  47.       - conditions:
  48.           - condition: numeric_state
  49.             entity_id: sensor.bedroompresencedetection_moving_distance
  50.             below: 0
  51.         sequence:
  52.           - target:
  53.               entity_id:
  54.                 - switch.bedroom_lights_bedroom_light_1
  55.                 - switch.bedroom_lights_bedroom_light_2
  56.                 - switch.bedroom_lights_bedroom_light_3
  57.                 - switch.bedroom_lights_bedroom_light_4
  58.             action: switch.turn_off
  59.             data: {}
  60. mode: single
  61.  
Advertisement
Add Comment
Please, Sign In to add comment