Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95919

Option to leave light on after motion detected

$
0
0

@ScottS wrote:

I use the below to turn on a light if there’s motion and then to turn it back off.

This light is in my office and there are times that I’m in the office and would like it to stay on. Is there some type of setup I could use where there’s an option to leave light on? My first/only thought is to create another automation that enables/disables a specific variable and when the below fires to check if that variable is set on/off. Thoughts?

- alias: Office Motion Light On
  trigger:
  - platform: state
    entity_id: binary_sensor.office_motion_detector_motion
    to: 'on'
  condition:
  - condition: state
    entity_id: sun.sun
    state: below_horizon
  action:
  - service: homeassistant.turn_on
    entity_id: light.office_floor_lamp
    data:
      brightness_pct: 90
      transition: 2
  id: b20e6030d71c4fc2a0c77a539d0818ed
- alias: Office Motion Light Off
  trigger:
  - platform: state
    entity_id: binary_sensor.office_motion_detector_motion
    to: 'off'
  action:
  - service: homeassistant.turn_off
    entity_id: light.office_floor_lamp
    data:
      transition: 5
  id: 47e8feb202994f92b773a8d08295ae76

Posts: 9

Participants: 5

Read full topic


Viewing all articles
Browse latest Browse all 95919

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>