2018-01-02 00:00:45 +00:00
|
|
|
#-------------------------------------------
|
|
|
|
# Motion Sensor in the office.
|
|
|
|
# Find more recipes @ https://github.com/CCOSTAN/Home-AssistantConfig
|
|
|
|
#-------------------------------------------
|
|
|
|
#------LightSensor Node---http://amzn.to/2oUgj5i
|
|
|
|
homeassistant:
|
|
|
|
customize:
|
|
|
|
binary_sensor.office_motion:
|
|
|
|
friendly_name: Office Motion Sensor
|
2018-01-14 23:30:56 +00:00
|
|
|
|
2020-06-06 20:54:36 +00:00
|
|
|
|
2018-01-02 00:00:45 +00:00
|
|
|
#---Sensor for Light-----------------------------
|
|
|
|
binary_sensor:
|
|
|
|
- platform: mqtt
|
|
|
|
state_topic: "NodeMCU4/Motion/Motion"
|
|
|
|
name: "Office_Motion"
|
|
|
|
payload_on: 1
|
|
|
|
payload_off: 0
|
|
|
|
device_class: motion
|
|
|
|
|
|
|
|
# This boolean gets reset every night in the sunset automation.
|
|
|
|
# Gets turned on by dash button automation primarily.
|
|
|
|
input_boolean:
|
|
|
|
daylight_override:
|
|
|
|
name: Daylight Override
|
|
|
|
initial: off
|
|
|
|
|
|
|
|
automation:
|
|
|
|
- alias: 'Motion in the Office - Turn on Light'
|
|
|
|
trigger:
|
|
|
|
- platform: state
|
|
|
|
entity_id:
|
|
|
|
- binary_sensor.office_motion
|
|
|
|
to: 'on'
|
|
|
|
from: 'off'
|
|
|
|
|
|
|
|
condition:
|
|
|
|
- condition: state
|
|
|
|
entity_id: group.family
|
|
|
|
state: 'home'
|
|
|
|
- condition: state
|
|
|
|
entity_id: light.office_lamp
|
|
|
|
state: 'off'
|
2018-08-23 22:16:15 +00:00
|
|
|
- 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
|
|
|
- condition: or
|
|
|
|
conditions:
|
|
|
|
- condition: time
|
|
|
|
after: '18:00:00'
|
|
|
|
- condition: state
|
|
|
|
entity_id: sun.sun
|
|
|
|
state: 'below_horizon'
|
|
|
|
- condition: state
|
|
|
|
entity_id: input_boolean.daylight_override
|
|
|
|
state: 'on'
|
2020-06-03 21:32:55 +00:00
|
|
|
- condition: numeric_state
|
|
|
|
entity_id: sensor.dark_sky_cloud_coverage
|
|
|
|
above: 90
|
|
|
|
- condition: numeric_state
|
|
|
|
entity_id: sensor.dark_sky_precip_intensity
|
|
|
|
above: 1
|
2018-01-02 00:00:45 +00:00
|
|
|
|
|
|
|
action:
|
|
|
|
- service: light.turn_on
|
|
|
|
entity_id: light.office_lamp
|
|
|
|
|
|
|
|
- alias: 'Motion in the Office - Turn off Light'
|
|
|
|
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_lamp
|
|
|
|
state: 'on'
|
|
|
|
|
|
|
|
action:
|
|
|
|
- service: light.turn_off
|
|
|
|
entity_id: light.office_lamp
|