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,59 @@
|
||||
alias: Utility Room Lights to Off
|
||||
id: automation_utility_room_lights_to_off
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: input_select.utility_room_mode
|
||||
|
||||
- platform: state
|
||||
entity_id: input_boolean.utility_room_occupied
|
||||
to: 'off'
|
||||
|
||||
#- platform: time_pattern
|
||||
# minutes: "/5"
|
||||
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: light.utility_room_hue
|
||||
state: 'on'
|
||||
|
||||
- condition: state
|
||||
entity_id: input_boolean.lights_off_manually
|
||||
state: 'off'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.utility_room_mode
|
||||
state: 'Off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.utility_room_occupied
|
||||
state: 'off'
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.lighting_automations
|
||||
state: 'on'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.utility_room_mode
|
||||
state: 'Off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.utility_room_occupied
|
||||
state: 'off'
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.utility_room_mode
|
||||
state: 'Manual'
|
||||
sequence:
|
||||
- service: light.turn_off
|
||||
data:
|
||||
entity_id:
|
||||
- light.utility_room_vanity
|
||||
- service: light.turn_off
|
||||
target:
|
||||
entity_id: light.laundry
|
||||
@@ -0,0 +1,56 @@
|
||||
alias: Utility Room Lights to On
|
||||
id: automation_utility_room_lights_to_on
|
||||
mode: single
|
||||
# Hide warnings when triggered while in delay.
|
||||
max_exceeded: silent
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- input_select.utility_room_mode
|
||||
- input_select.automatic_light_profile
|
||||
- platform: state
|
||||
entity_id: input_boolean.utility_room_occupied
|
||||
to: "on"
|
||||
|
||||
# Only turn on the lights when necessary
|
||||
condition:
|
||||
- condition: or
|
||||
conditions:
|
||||
# Either when motion is detected
|
||||
- condition: template
|
||||
value_template: "{{ trigger.entity_id == 'input_boolean.utility_room_occupied' }}"
|
||||
# Or when the scene changes while the lights are already on
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: template
|
||||
value_template: "{{ trigger.entity_id == 'input_select.utility_room_mode' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.entity_id == 'input_select.automatic_light_profile' }}"
|
||||
- condition: state
|
||||
entity_id: light.utility_room_vanity
|
||||
state: "on"
|
||||
|
||||
action:
|
||||
- alias: "Make sure Z-Wave switch is turned on"
|
||||
service: homeassistant.turn_on
|
||||
target:
|
||||
entity_id: switch.utility_room_motion_switch
|
||||
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.utility_room_mode
|
||||
state: Auto
|
||||
sequence:
|
||||
- service: scene.turn_on
|
||||
target:
|
||||
entity_id: "scene.utility_room_hue_{{states('input_select.automatic_light_profile').lower().replace(' ','_')}}"
|
||||
default:
|
||||
- service: scene.turn_on
|
||||
target:
|
||||
entity_id: "scene.utility_room_hue_{{states('input_select.utility_room_mode').lower().replace(' ','_')}}"
|
||||
|
||||
- delay: 1
|
||||
@@ -0,0 +1,59 @@
|
||||
alias: 'Utility Room Not Occupied'
|
||||
id: automation_utility_room_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.utility_room_occupied
|
||||
to: 'off'
|
||||
for: '00:10: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.utility_room_occupied
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.utility_room_occupied
|
||||
state: 'off'
|
||||
for: '00:10:00'
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.home_occupied
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: input_boolean.utility_room_occupied
|
||||
- conditions:
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.house
|
||||
state: 'Auto'
|
||||
- condition: state
|
||||
entity_id: input_select.house
|
||||
state: 'Dad'
|
||||
- condition: state
|
||||
entity_id: input_select.house
|
||||
state: 'Bachelor'
|
||||
sequence:
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: input_boolean.utility_room_occupied
|
||||
@@ -0,0 +1,25 @@
|
||||
alias: Utility Room Occupied
|
||||
id: automation_utility_room_occupied
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- binary_sensor.utility_room_occupied
|
||||
to: 'on'
|
||||
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.utility_room_occupied
|
||||
state: 'off'
|
||||
|
||||
action:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.utility_room_occupied
|
||||
|
||||
- service: logbook.log
|
||||
data_template:
|
||||
name: Utility Room Occupied
|
||||
entity_id: automation.utility_room_occupied
|
||||
message: >
|
||||
{{ states("sensor.date_time_iso") }} Utlity Room Occupied ran
|
||||
Reference in New Issue
Block a user