Home-AssistantConfig/config/packages/office_motion.yaml

70 lines
1.7 KiB
YAML
Raw Normal View History

2018-01-02 00:00:45 +00:00
#-------------------------------------------
# Motion Sensor in the office.
# Find more recipes @ https://github.com/CCOSTAN/Home-AssistantConfig
#-------------------------------------------
#------LightSensor Node---https://amzn.to/2oUgj5i
2018-01-02 00:00:45 +00:00
homeassistant:
customize:
binary_sensor.office_motion:
friendly_name: Office Motion Sensor
2018-01-14 23:30:56 +00:00
2018-01-02 00:00:45 +00:00
#---Sensor for Light-----------------------------
mqtt:
binary_sensor:
- state_topic: "NodeMCU4/Motion/Motion"
name: "Office_Motion"
payload_on: 1
payload_off: 0
device_class: motion
2018-01-02 00:00:45 +00:00
automation:
- alias: 'Motion in the Office - Turn on Light'
id: 5a8e9dc3-a851-4cce-a054-d96f599cb1f5
mode: restart
2018-01-02 00:00:45 +00:00
trigger:
- platform: state
entity_id:
- binary_sensor.office_motion
to: 'on'
from: 'off'
condition:
- condition: state
entity_id: light.office_lights
2018-01-02 00:00:45 +00:00
state: 'off'
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.sleepnumber_carlo_stacey_is_in_bed
state: 'off'
- condition: state
entity_id: binary_sensor.sleepnumber_carlo_carlo_is_in_bed
state: 'off'
2018-01-02 00:00:45 +00:00
action:
- service: light.turn_on
entity_id: light.office_lights
2018-01-02 00:00:45 +00:00
- alias: 'Motion in the Office - Turn off Light'
id: 346d8210-2160-4911-8be0-1ad696cc69d1
mode: restart
2018-01-02 00:00:45 +00:00
trigger:
- platform: state
entity_id:
- binary_sensor.office_motion
to: 'off'
from: 'on'
for:
2018-01-14 23:30:56 +00:00
minutes: 2
2018-01-02 00:00:45 +00:00
condition:
- condition: state
entity_id: light.office_lights
2018-01-02 00:00:45 +00:00
state: 'on'
action:
- service: light.turn_off
entity_id: light.office_lights