mirror of
https://github.com/CeeWeasel/fresh-home.git
synced 2026-08-10 02:50:12 -04:00
initial push
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
alias: Entryway Lights to Off
|
||||
id: automation_entryway_lights_to_off
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: input_select.entryway_mode
|
||||
|
||||
- platform: state
|
||||
entity_id: input_boolean.entryway_occupied
|
||||
to: 'off'
|
||||
|
||||
- platform: state
|
||||
id: light_level
|
||||
entity_id: binary_sensor.entryway_naturally_lit
|
||||
from: 'off'
|
||||
to: 'on'
|
||||
#- platform: time_pattern
|
||||
# minutes: "/5"
|
||||
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.lighting_automations
|
||||
state: 'on'
|
||||
|
||||
- condition: state
|
||||
entity_id: input_boolean.lights_off_manually
|
||||
state: 'off'
|
||||
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.entryway_mode
|
||||
state: 'Off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.entryway_occupied
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.entryway_naturally_lit
|
||||
state: 'on'
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.lighting_automations
|
||||
state: 'on'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.entryway_mode
|
||||
state: 'Off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.entryway_occupied
|
||||
state: 'off'
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.entryway_mode
|
||||
state: 'Manual'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.entryway_naturally_lit
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: scene.turn_on
|
||||
data:
|
||||
transition: 5
|
||||
target:
|
||||
entity_id: scene.entryway_hue_off
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.guest_mode
|
||||
state: 'on'
|
||||
sequence:
|
||||
- alias: "Turn off z-wave switch since all lights are off"
|
||||
service: homeassistant.turn_off
|
||||
target:
|
||||
entity_id: switch.entryway_motion_switch
|
||||
@@ -0,0 +1,162 @@
|
||||
alias: Entryway Lights to On
|
||||
id: automation_entryway_lights_to_on
|
||||
mode: single
|
||||
# Hide warnings when triggered while in delay.
|
||||
max_exceeded: silent
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
id: "mode_change"
|
||||
entity_id:
|
||||
- input_select.entryway_mode
|
||||
- input_select.automatic_light_profile
|
||||
|
||||
- platform: state
|
||||
id: light_level
|
||||
entity_id: binary_sensor.entryway_naturally_lit
|
||||
from: 'on'
|
||||
to: 'off'
|
||||
|
||||
- platform: state
|
||||
id: occupied
|
||||
entity_id:
|
||||
- binary_sensor.entryway_occupied
|
||||
- input_boolean.entryway_occupied
|
||||
to: "on"
|
||||
|
||||
- platform: state
|
||||
id: door
|
||||
entity_id:
|
||||
- binary_sensor.inner_garage_door
|
||||
- binary_sensor.front_door_contact
|
||||
to: "on"
|
||||
|
||||
# Only turn on the lights when necessary
|
||||
condition:
|
||||
- alias: "Home is occupied"
|
||||
condition: state
|
||||
entity_id: input_boolean.home_occupied
|
||||
state: "on"
|
||||
|
||||
- alias: "lighting automations enabled"
|
||||
condition: state
|
||||
entity_id: input_boolean.lighting_automations
|
||||
state: "on"
|
||||
|
||||
- alias: "Check if light should turn on"
|
||||
condition: or
|
||||
conditions:
|
||||
|
||||
- alias: "Guest mode is on"
|
||||
condition: state
|
||||
entity_id: input_boolean.guest_mode
|
||||
state: "on"
|
||||
|
||||
- alias: "Motion or occupancy were detected in a dim room"
|
||||
condition: and
|
||||
conditions:
|
||||
|
||||
- alias: "Light level below trigger amount"
|
||||
condition: state
|
||||
entity_id: binary_sensor.entryway_naturally_lit
|
||||
state: 'off'
|
||||
|
||||
- alias: "Motion or occupancy were detected"
|
||||
condition: or
|
||||
conditions:
|
||||
- alias: "Motion was detected"
|
||||
condition: trigger
|
||||
id: "motion"
|
||||
- alias: "Occupancy was detected"
|
||||
condition: trigger
|
||||
id: "occupied"
|
||||
|
||||
- alias: "A scene changed and the lights are already on"
|
||||
condition: and
|
||||
conditions:
|
||||
- condition: trigger
|
||||
id: "mode_change"
|
||||
|
||||
- condition: state
|
||||
entity_id: input_boolean.entryway_occupied
|
||||
state: "on"
|
||||
|
||||
variables:
|
||||
switch_name: switch.entryway_motion_switch
|
||||
light_name: entryway_hue
|
||||
mode_name: input_select.entryway_mode
|
||||
|
||||
action:
|
||||
- alias: "Make sure Z-Wave switch is turned on"
|
||||
service: homeassistant.turn_on
|
||||
target:
|
||||
entity_id: "{{ switch_name }}"
|
||||
- choose:
|
||||
- alias: "If the room is set to manual, just turn the lights on"
|
||||
conditions:
|
||||
- alias: "Room set to manual"
|
||||
condition: state
|
||||
entity_id: input_select.entryway_mode
|
||||
state: Manual
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.entryway_hue
|
||||
|
||||
- alias: "If the room is set to auto and the lights are on, change to the Automatic Light Profile scene with a transition"
|
||||
conditions:
|
||||
- alias: "Room set to auto"
|
||||
condition: state
|
||||
entity_id: input_select.entryway_mode
|
||||
state: Auto
|
||||
- alias: "Lights are on"
|
||||
condition: state
|
||||
entity_id: light.entryway_hue
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: scene.turn_on
|
||||
data:
|
||||
transition: "{{ states('input_number.light_scene_transition') }}"
|
||||
target:
|
||||
entity_id: "scene.{{light_name}}_{{states('input_select.automatic_light_profile').lower().replace(' ','_')}}"
|
||||
|
||||
- alias: "If the room is set to auto and the lights are off, change to the Automatic Light Profile scene without a transition"
|
||||
conditions:
|
||||
- alias: "Room set to auto"
|
||||
condition: state
|
||||
entity_id: input_select.entryway_mode
|
||||
state: Auto
|
||||
- alias: "Lights are off"
|
||||
condition: state
|
||||
entity_id: light.entryway_hue
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: scene.turn_on
|
||||
target:
|
||||
entity_id: "scene.{{light_name}}_{{states('input_select.automatic_light_profile').lower().replace(' ','_')}}"
|
||||
|
||||
- alias: "If the room is not set to auto and the lights are on, change to the Entryway Mode scene with a transition"
|
||||
conditions:
|
||||
- alias: "Room not manual or auto and lights are on"
|
||||
condition: state
|
||||
entity_id: light.entryway_hue
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: scene.turn_on
|
||||
data:
|
||||
transition: "{{ states('input_number.light_scene_transition') }}"
|
||||
target:
|
||||
entity_id: "scene.{{light_name}}_{{states(mode_name).lower().replace(' ','_')}}"
|
||||
|
||||
- alias: "If the room is not set to auto and the lights are on, change to the Entryway Mode scene without a transition"
|
||||
conditions:
|
||||
- alias: "Room not manual or auto and lights are off"
|
||||
condition: state
|
||||
entity_id: light.entryway_hue
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: scene.turn_on
|
||||
target:
|
||||
entity_id: "scene.{{light_name}}_{{states(mode_name).lower().replace(' ','_')}}"
|
||||
|
||||
- delay: 1
|
||||
@@ -0,0 +1,53 @@
|
||||
alias: 'Entryway Not Occupied'
|
||||
id: automation_entryway_not_occupied
|
||||
mode: restart
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: input_boolean.home_occupied
|
||||
from: 'on'
|
||||
to: 'off'
|
||||
|
||||
- platform: state
|
||||
entity_id:
|
||||
- input_boolean.home_occupied
|
||||
- binary_sensor.entryway_occupied
|
||||
to: 'off'
|
||||
for: '00:05:00'
|
||||
|
||||
# - platform: time_pattern
|
||||
# minutes: "/5"
|
||||
|
||||
condition:
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.home_occupied
|
||||
state: 'off'
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.entryway_occupied
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.entryway_occupied
|
||||
state: 'off'
|
||||
for: '00:05:00'
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.home_occupied
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: input_boolean.entryway_occupied
|
||||
- conditions:
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.house
|
||||
state: 'Manual'
|
||||
sequence:
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: input_boolean.entryway_occupied
|
||||
@@ -0,0 +1,18 @@
|
||||
alias: 'Entryway Occupied'
|
||||
id: automation_entryway_occupied
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- binary_sensor.entryway_occupied
|
||||
to: 'on'
|
||||
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.entryway_occupied
|
||||
state: 'off'
|
||||
|
||||
action:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.entryway_occupied
|
||||
Reference in New Issue
Block a user