mirror of
https://github.com/CeeWeasel/fresh-home.git
synced 2026-08-09 18:40:14 -04:00
initial push
This commit is contained in:
@@ -0,0 +1,169 @@
|
||||
alias: Computer Area Lights to On
|
||||
id: automation_computer_area_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.computer_area_mode
|
||||
- input_select.automatic_light_profile
|
||||
|
||||
- platform: state
|
||||
id: light_level
|
||||
entity_id: binary_sensor.computer_area_naturally_lit
|
||||
from: 'on'
|
||||
to: 'off'
|
||||
|
||||
- platform: state
|
||||
id: occupied
|
||||
entity_id:
|
||||
- binary_sensor.computer_area_occupied
|
||||
- input_boolean.computer_area_occupied
|
||||
to: "on"
|
||||
|
||||
# - platform: state
|
||||
# id: motion
|
||||
# entity_id: group.computer_area_motion
|
||||
# to: "on"
|
||||
|
||||
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: "Great Room Light Cycle is off"
|
||||
condition: state
|
||||
entity_id: input_boolean.great_room_light_cycle
|
||||
state: "off"
|
||||
|
||||
- alias: "Computer Area Light Cycle is off"
|
||||
condition: state
|
||||
entity_id: input_boolean.computer_area_light_cycle
|
||||
state: "off"
|
||||
|
||||
- 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: "Room not naturally lit"
|
||||
condition: state
|
||||
entity_id: binary_sensor.computer_area_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.computer_area_occupied
|
||||
state: "on"
|
||||
|
||||
variables:
|
||||
switch_name: switch.great_room_motion_switch
|
||||
light_name: computer_area_hue
|
||||
mode_name: input_select.computer_area_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.computer_area_mode
|
||||
state: Manual
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.computer_area_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.computer_area_mode
|
||||
state: Auto
|
||||
- alias: "Lights are on"
|
||||
condition: state
|
||||
entity_id: light.computer_area_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.computer_area_mode
|
||||
state: Auto
|
||||
- alias: "Lights are off"
|
||||
condition: state
|
||||
entity_id: light.computer_area_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 Computer Area Mode scene with a transition"
|
||||
conditions:
|
||||
- alias: "Room not manual or auto and lights are on"
|
||||
condition: state
|
||||
entity_id: light.computer_area_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 Computer Area Mode scene without a transition"
|
||||
conditions:
|
||||
- alias: "Room not manual or auto and lights are off"
|
||||
condition: state
|
||||
entity_id: light.computer_area_hue
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: scene.turn_on
|
||||
target:
|
||||
entity_id: "scene.{{light_name}}_{{states(mode_name).lower().replace(' ','_')}}"
|
||||
|
||||
- delay: 1
|
||||
Reference in New Issue
Block a user