diff --git a/include/automations/lys_skab.yaml b/include/automations/lys_skab.yaml new file mode 100644 index 0000000..323f33b --- /dev/null +++ b/include/automations/lys_skab.yaml @@ -0,0 +1,109 @@ +- id: skab_claus_motion_lys + alias: Lys skab Claus + mode: restart + + trigger: + - platform: state + entity_id: binary_sensor.hue_motion_sensor_1_motion + to: "on" + + condition: + - condition: numeric_state + entity_id: sensor.hue_motion_sensor_1_illuminance + below: 90 + + action: + - choose: + - conditions: + - condition: time + after: "06:00:00" + before: "23:59:00" + sequence: + - service: light.turn_on + target: + entity_id: light.skab_1 + data: + brightness_pct: 100 + rgb_color: [20, 255, 127] + default: + - service: scene.turn_on + target: + entity_id: scene.skab_daempet + +- id: skab_claus_motion_sluk + alias: Sluk lys i skab Claus + mode: restart + + trigger: + - platform: state + entity_id: binary_sensor.hue_motion_sensor_1_motion + to: "off" + + action: + - wait_for_trigger: + - platform: state + entity_id: binary_sensor.hue_motion_sensor_1_motion + to: "on" + timeout: "00:01:00" + continue_on_timeout: true + - condition: state + entity_id: binary_sensor.hue_motion_sensor_1_motion + state: "off" + - service: light.turn_off + target: + entity_id: light.skab_1 + +- id: skab_anne_motion_lys + alias: Lys skab Anne + mode: restart + + trigger: + - platform: state + entity_id: binary_sensor.motion + to: "on" + + condition: + - condition: numeric_state + entity_id: sensor.hue_motion_sensor_1_illuminance_2 + below: 90 + + action: + - choose: + - conditions: + - condition: time + after: "06:00:00" + before: "23:59:00" + sequence: + - service: light.turn_on + target: + entity_id: light.skab_1 + data: + brightness_pct: 100 + rgb_color: [254, 11, 255] + default: + - service: scene.turn_on + target: + entity_id: scene.skab_daempet + +- id: skab_anne_motion_sluk + alias: Sluk lys i skab Anne + mode: restart + + trigger: + - platform: state + entity_id: binary_sensor.motion + to: "off" + + action: + - wait_for_trigger: + - platform: state + entity_id: binary_sensor.motion + to: "on" + timeout: "00:01:00" + continue_on_timeout: true + - condition: state + entity_id: binary_sensor.motion + state: "off" + - service: light.turn_off + target: + entity_id: light.skab_1 diff --git a/include/automations/skabsovevaerelse.yaml b/include/automations/skabsovevaerelse.yaml deleted file mode 100644 index dd52f73..0000000 --- a/include/automations/skabsovevaerelse.yaml +++ /dev/null @@ -1,67 +0,0 @@ - - alias: 'Lys skab Claus' - trigger: - platform: state - entity_id: binary_sensor.hue_motion_sensor_1_motion - to: 'on' - condition: - - condition: numeric_state - entity_id: sensor.hue_motion_sensor_1_illuminance - below: 90 - - condition: time - after: '06:00:00' - before: '23:00:00' - action: - - service: homeassistant.turn_on - target: - entity_id: light.skab_1 - data: - brightness_pct: 100 - rgb_color: [20, 255, 127] - - - - alias: 'Sluk lys i skab Claus' - trigger: - platform: state - entity_id: binary_sensor.hue_motion_sensor_1_motion - to: 'off' - for: - minutes: 1 - action: - service: homeassistant.turn_off - data: - entity_id: - - light.skab_1 - - - alias: 'Lys skab Anne' - trigger: - platform: state - entity_id: binary_sensor.motion - to: 'on' - condition: - - condition: numeric_state - entity_id: sensor.hue_motion_sensor_1_illuminance_2 - below: 90 - - condition: time - after: '06:00:00' - before: '23:00:00' - action: - - service: homeassistant.turn_on - target: - entity_id: light.skab_1 - data: - brightness_pct: 100 - rgb_color: [254, 11, 255] - - - - alias: 'Sluk lys i skab' - trigger: - platform: state - entity_id: binary_sensor.motion - to: 'off' - for: - minutes: 1 - action: - service: homeassistant.turn_off - data: - entity_id: - - light.skab_1