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,67 @@
|
||||
alias: Blue Room Lights to Off
|
||||
id: automation_blue_room_lights_to_off
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: input_select.blue_room_mode
|
||||
|
||||
- platform: state
|
||||
entity_id: input_boolean.blue_room_occupied
|
||||
to: 'off'
|
||||
|
||||
#- platform: time_pattern
|
||||
# minutes: "/5"
|
||||
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: light.blue_room_hue
|
||||
state: 'on'
|
||||
|
||||
- condition: state
|
||||
entity_id: input_boolean.lights_off_manually
|
||||
state: 'off'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.blue_room_mode
|
||||
state: 'Off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.blue_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.blue_room_mode
|
||||
state: 'Off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.blue_room_occupied
|
||||
state: 'off'
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.blue_room_mode
|
||||
state: 'Manual'
|
||||
sequence:
|
||||
- service: scene.turn_on
|
||||
data:
|
||||
transition: 5
|
||||
target:
|
||||
entity_id: scene.blue_room_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.blue_room_motion_switch
|
||||
@@ -0,0 +1,168 @@
|
||||
alias: Blue Room Lights to On
|
||||
id: automation_blue_room_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.blue_room_mode
|
||||
- input_select.automatic_light_profile
|
||||
|
||||
- platform: state
|
||||
id: occupied
|
||||
entity_id:
|
||||
- binary_sensor.blue_room_occupied
|
||||
- input_boolean.blue_room_occupied
|
||||
to: "on"
|
||||
|
||||
# - platform: state
|
||||
# id: motion
|
||||
# entity_id: group.blue_room_motion
|
||||
# to: "on"
|
||||
|
||||
- platform: state
|
||||
id: light_level
|
||||
entity_id: binary_sensor.blue_room_naturally_lit
|
||||
from: 'on'
|
||||
to: 'off'
|
||||
|
||||
condition:
|
||||
- alias: "Home is occupied"
|
||||
condition: state
|
||||
entity_id: input_boolean.home_occupied
|
||||
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.blue_room_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.blue_room_occupied
|
||||
state: "on"
|
||||
|
||||
- alias: "The light level changed, the room is occupied, and the light is off"
|
||||
condition: and
|
||||
conditions:
|
||||
- condition: trigger
|
||||
id: light_level
|
||||
- condition: state
|
||||
entity_id: input_boolean.blue_room_occupied
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: light.blue_room_hue
|
||||
state: 'off'
|
||||
|
||||
variables:
|
||||
switch_name: switch.blue_room_motion_switch
|
||||
light_name: blue_room_hue
|
||||
mode_name: input_select.blue_room_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.blue_room_mode
|
||||
state: Manual
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.blue_room_hue
|
||||
|
||||
- alias: "If the room is set to auto, the lights are already on, and the room is dim, change to the Automatic Light Profile scene with a transition"
|
||||
conditions:
|
||||
- alias: "Room set to auto"
|
||||
condition: state
|
||||
entity_id: input_select.blue_room_mode
|
||||
state: Auto
|
||||
- alias: "Lights are on"
|
||||
condition: state
|
||||
entity_id: light.blue_room_hue
|
||||
state: 'on'
|
||||
- "{{ states('sensor.blue_room_multisensor_illuminance') | float(default=0) < states('input_number.blue_room_light_level_trigger') | float(default=0) }}"
|
||||
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.blue_room_mode
|
||||
state: Auto
|
||||
- alias: "Lights are off"
|
||||
condition: state
|
||||
entity_id: light.blue_room_hue
|
||||
state: 'off'
|
||||
- "{{ states('sensor.blue_room_multisensor_illuminance') | float(default=0) < states('input_number.blue_room_light_level_trigger') | float(default=0) }}"
|
||||
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 Blue Room Mode scene with a transition"
|
||||
conditions:
|
||||
- alias: "Room not manual or auto and lights are on"
|
||||
condition: state
|
||||
entity_id: light.blue_room_hue
|
||||
state: 'on'
|
||||
- "{{ states('sensor.blue_room_multisensor_illuminance') | float(default=0) < states('input_number.blue_room_light_level_trigger') | float(default=0) }}"
|
||||
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 Blue Room Mode scene without a transition"
|
||||
conditions:
|
||||
- alias: "Room not manual or auto and lights are off"
|
||||
condition: state
|
||||
entity_id: light.blue_room_hue
|
||||
state: 'off'
|
||||
- "{{ states('sensor.blue_room_multisensor_illuminance') | float(default=0) < states('input_number.blue_room_light_level_trigger') | float(default=0) }}"
|
||||
sequence:
|
||||
- service: scene.turn_on
|
||||
target:
|
||||
entity_id: "scene.{{light_name}}_{{states(mode_name).lower().replace(' ','_')}}"
|
||||
|
||||
- delay: 1
|
||||
@@ -0,0 +1,59 @@
|
||||
alias: 'Blue Room Not Occupied'
|
||||
id: automation_blue_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.blue_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.blue_room_occupied
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.blue_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.blue_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.blue_room_occupied
|
||||
@@ -0,0 +1,25 @@
|
||||
alias: Blue Room Occupied
|
||||
id: automation_blue_room_occupied
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- binary_sensor.blue_room_occupied
|
||||
to: 'on'
|
||||
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.blue_room_occupied
|
||||
state: 'off'
|
||||
|
||||
action:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.blue_room_occupied
|
||||
|
||||
- service: logbook.log
|
||||
data_template:
|
||||
name: Blue Room Occupied
|
||||
entity_id: automation.blue_room_occupied
|
||||
message: >
|
||||
{{ states("sensor.date_time_iso") }} Blue Room Occupied ran
|
||||
@@ -0,0 +1,68 @@
|
||||
# alias: Blue Room Lights
|
||||
# id: automation_blue_room_lights
|
||||
# mode: queued
|
||||
|
||||
# trigger:
|
||||
# - platform: state
|
||||
# id: door_open
|
||||
# entity_id: binary_sensor.blue_room_door_contact
|
||||
# from: "off"
|
||||
# to: "on"
|
||||
|
||||
# - platform: state
|
||||
# id: motion_on
|
||||
# entity_id: binary_sensor.blue_room_motion_switch_home_security_motion_detection
|
||||
# from: "off"
|
||||
# to: "on"
|
||||
|
||||
# - platform: state
|
||||
# id: door_closed
|
||||
# entity_id: binary_sensor.blue_room_door_contact
|
||||
# to: "off"
|
||||
# for: "00:10:00"
|
||||
|
||||
# - platform: state
|
||||
# id: motion_off
|
||||
# entity_id: binary_sensor.blue_room_motion_switch_home_security_motion_detection
|
||||
# to: "off"
|
||||
# for: "00:15:00"
|
||||
|
||||
# action:
|
||||
# - choose:
|
||||
# - conditions:
|
||||
# - condition: or
|
||||
# conditions:
|
||||
# - condition: trigger
|
||||
# id: "door_open"
|
||||
# - condition: trigger
|
||||
# id: "motion_on"
|
||||
# - condition: state
|
||||
# entity_id: light.blue_room
|
||||
# state: 'off'
|
||||
# sequence:
|
||||
# - service: light.turn_on
|
||||
# target:
|
||||
# entity_id: light.blue_room
|
||||
# - service: switch.turn_on
|
||||
# target:
|
||||
# entity_id: switch.frigate_cam01_detect
|
||||
# - conditions:
|
||||
# - condition: or
|
||||
# conditions:
|
||||
# - condition: trigger
|
||||
# id: "door_closed"
|
||||
# - condition: trigger
|
||||
# id: "motion_off"
|
||||
# - condition: state
|
||||
# entity_id: binary_sensor.blue_room_motion_switch_home_security_motion_detection
|
||||
# state: "off"
|
||||
# - condition: state
|
||||
# entity_id: light.blue_room
|
||||
# state: 'on'
|
||||
# sequence:
|
||||
# - service: light.turn_off
|
||||
# target:
|
||||
# entity_id: light.blue_room
|
||||
# - service: switch.turn_off
|
||||
# target:
|
||||
# entity_id: switch.frigate_cam01_detect
|
||||
@@ -0,0 +1,131 @@
|
||||
alias: Computer Area Light Cycle
|
||||
id: automation_computer_area_light_cycle
|
||||
|
||||
trigger:
|
||||
- id: light_cycle_on
|
||||
platform: state
|
||||
entity_id: input_boolean.computer_area_light_cycle
|
||||
from: 'off'
|
||||
to: 'on'
|
||||
|
||||
- id: setting_change
|
||||
platform: state
|
||||
entity_id:
|
||||
- input_number.computer_area_light_cycle_transition
|
||||
- input_select.computer_area_color_set
|
||||
- input_boolean.computer_area_cycle_same
|
||||
|
||||
condition: "{{ is_state('input_boolean.computer_area_light_cycle','on') }}"
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.computer_area_light_cycle
|
||||
state: 'on'
|
||||
sequence:
|
||||
|
||||
- repeat:
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions: # If all lights should be the same color and the projector is off, reference the Hue group for all the lights
|
||||
- condition: state
|
||||
entity_id: input_boolean.computer_area_cycle_same
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.computer_area_hue
|
||||
data:
|
||||
brightness: '{{ states("input_number.computer_area_light_cycle_brightness") | int }}'
|
||||
transition: '{{ states("input_number.computer_area_light_cycle_transition") | int }}'
|
||||
profile: >
|
||||
{% if states('input_select.computer_area_color_set') == 'Basic' %}
|
||||
{% set colors = ['white','black','red','orange','yellow','green','blue','purple','pink','brown','gray'] %}
|
||||
{% elif states('input_select.computer_area_color_set') == 'Color Wheel' %}
|
||||
{% set colors = ['red','orange','amber','yellow','chartreuse','green','teal','blue','violet','purple','magenta'] %}
|
||||
{% elif states('input_select.computer_area_color_set') == 'Rainbow' %}
|
||||
{% set colors = ['red','orange','yellow','green','blue','indigo','violet'] %}
|
||||
{% elif states('input_select.computer_area_color_set') == 'Flourescent' %}
|
||||
{% set colors = ['radical_red','wild_watermelon','outrageous_orange','atomic_tangerine','neon_carrot','sunglow','laser_lemon','unmellow_yellow','electric_lime','screamin_green','magic_mint','blizzard_blue','shocking_pink','razzle_dazzle_rose','hot_magenta','purple_pizzazz'] %}
|
||||
{% elif states('input_select.computer_area_color_set') == 'Silver Swirl' %}
|
||||
{% set colors = ['aztec_gold','burnished_brown','cerulean_frost','cinnamon_satin','copper_penny','cosmic_cobalt','glossy_grape','granite_gray','green_sheen','lilac_luster','misty_moss','mystic_maroon','pearly_purple','pewter_blue','polished_pine','quick_silver','rose_dust','rusty_red','shadow_blue','shiny_shamrock','steel_teal','sugar_plum','twilight_lavender','wintergreen_dream'] %}
|
||||
{% elif states('input_select.computer_area_color_set') == 'Gem Tones' %}
|
||||
{% set colors = ['amethyst','citrine','emerald','jade','lapis_lazuli','malachite','rose_quartz','ruby','sapphire','smokey_topaz'] %}
|
||||
{% elif states('input_select.computer_area_color_set') == 'Reds' %}
|
||||
{% set colors = ['auburn','baby_pink','barn_red','burgundy','burnt_umber','cadmium_red','cardinal','chesnut','chili_red','congo_pink','coral_pink','desire','fire_engine_red','imperial_red','new_york_pink','paradise_pink','pastel_pink','pigment_red','rust','salmon_pink','tango_pink','turkey_red','vanilla_ice','wine'] %}
|
||||
{% elif states('input_select.computer_area_color_set') == 'Oranges' %}
|
||||
{% set colors = ['beaver','cadmium_orange','carrot_orange','champagne','chocolate','cocoa_brown','desert_sand','flame','gamboge','international_orange','kobicha','lion','marigold','orange_peel','persian_orange','persimmon','peru','portland_orange','pumpkin','russet','safety_orange','sandy_brown','tan','taupe','tawny','tea_rose','wood_brown'] %}
|
||||
{% elif states('input_select.computer_area_color_set') == 'Yellows' %}
|
||||
{% set colors = ['amber','beige','buff','citrine','cream','cyber_yellow','ecru','harvest_gold','jasmine','jonquil','khaki','lemon','mellow_yellow','mikado_yellow','mustard','naples_yellow','old_gold','process_yellow','royal_yellow','safety_yellow','saffron','school_bus_yellow','straw','vanilla'] %}
|
||||
{% elif states('input_select.computer_area_color_set') == 'Greens' %}
|
||||
{% set colors = ['army_green','artichoke','asparagus','avacado','bottle_green','bright_mint','celadon','emerald','fern_green','forest_green','harlequin','hunter_green','india_green','islamic_green','jade','kelly_green','laurel_green','malachite','mantis','mint_green','moss_green','neon_green','olive','pakistan_green','paris_green','rifle_green','russian_green','sea_green','shamrock_green','slytherin_green'] %}
|
||||
{% elif states('input_select.computer_area_color_set') == 'Cyans' %}
|
||||
{% set colors = ['aqua','aquamarine','brunswick_green','celadon_green','celeste','cerulean','charleston_green','dark_cyan','electric_blue','feldgrau','gray_green','midnight_green','morning_blue','myrtle_green','persian_green','robin_egg_blue','sky_blue','teal','teal_blue','turquoise','verdigris','viridian'] %}
|
||||
{% elif states('input_select.computer_area_color_set') == 'Blues' %}
|
||||
{% set colors = ['azure','baby_blue','blue_gray','capri','cornflower','egyptian_blue','glaucous','independence','indigo','indigo_dye','liberty','light_blue','midnight_blue','navy_blue','periwinkle','powder_blue','resolution_blue','sapphire','space_cadet','steel_blue','ultramarine'] %}
|
||||
{% elif states('input_select.computer_area_color_set') == 'Purples' %}
|
||||
{% set colors = ['byzantium','dark_purple','electric_indigo','eminence','heliotrope','indigo','indigo_dye','mardi_gras','mauve','medium_purple','orchid','pansy_purple','phlox','purpureus','thistle','tropical_indigo','tyrian_purple','royal_purple'] %}
|
||||
{% elif states('input_select.computer_area_color_set') == 'Magentas' %}
|
||||
{% set colors = ['amaranth','antique_fuchsia','baby_pink','cameo_pink','carnation_pink','charm_pink','china_pink','cotton_candy','dark_magenta','fandango','french_fuchsia','french_pink','fuchsia_rose','magenta_haze','mimi_pink','persian_pink','piggy_pink','pink','pink_lace','pink_lavender','plum','queen_pink','rose','rose_quartz','shocking_pink','silver_pink','sky_magenta','super_pink'] %}
|
||||
{% elif states('input_select.computer_area_color_set') == 'Grays' %}
|
||||
{% set colors = ['ash_gray','battleship_gray','cadet_gray','charcoal','dim_gray','gunmetal','jet','marengo','nickel','platinum','rocket_metallic','silver','slate_gray'] %}
|
||||
{% endif %}
|
||||
{{ colors|random }}
|
||||
|
||||
|
||||
- conditions: # If all lights should be different colors, start referencing the individual lights that don't obscure the TV
|
||||
- condition: state
|
||||
entity_id: input_boolean.computer_area_cycle_same
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.basement_1
|
||||
data:
|
||||
brightness: '{{ states("input_number.computer_area_light_cycle_brightness") | int }}'
|
||||
transition: '{{ states("input_number.computer_area_light_cycle_transition") | int }}'
|
||||
profile: >
|
||||
{% if states('input_select.computer_area_color_set') == 'Basic' %}
|
||||
{% set colors = ['white','black','red','orange','yellow','green','blue','purple','pink','brown','gray'] %}
|
||||
{% elif states('input_select.computer_area_color_set') == 'Color Wheel' %}
|
||||
{% set colors = ['red','orange','amber','yellow','chartreuse','green','teal','blue','violet','purple','magenta'] %}
|
||||
{% elif states('input_select.computer_area_color_set') == 'Rainbow' %}
|
||||
{% set colors = ['red','orange','yellow','green','blue','indigo','violet'] %}
|
||||
{% elif states('input_select.computer_area_color_set') == 'Flourescent' %}
|
||||
{% set colors = ['radical_red','wild_watermelon','outrageous_orange','atomic_tangerine','neon_carrot','sunglow','laser_lemon','unmellow_yellow','electric_lime','screamin_green','magic_mint','blizzard_blue','shocking_pink','razzle_dazzle_rose','hot_magenta','purple_pizzazz'] %}
|
||||
{% elif states('input_select.computer_area_color_set') == 'Silver Swirl' %}
|
||||
{% set colors = ['aztec_gold','burnished_brown','cerulean_frost','cinnamon_satin','copper_penny','cosmic_cobalt','glossy_grape','granite_gray','green_sheen','lilac_luster','misty_moss','mystic_maroon','pearly_purple','pewter_blue','polished_pine','quick_silver','rose_dust','rusty_red','shadow_blue','shiny_shamrock','steel_teal','sugar_plum','twilight_lavender','wintergreen_dream'] %}
|
||||
{% elif states('input_select.computer_area_color_set') == 'Gem Tones' %}
|
||||
{% set colors = ['amethyst','citrine','emerald','jade','lapis_lazuli','malachite','rose_quartz','ruby','sapphire','smokey_topaz'] %}
|
||||
{% elif states('input_select.computer_area_color_set') == 'Reds' %}
|
||||
{% set colors = ['auburn','baby_pink','barn_red','burgundy','burnt_umber','cadmium_red','cardinal','chesnut','chili_red','congo_pink','coral_pink','desire','fire_engine_red','imperial_red','new_york_pink','paradise_pink','pastel_pink','pigment_red','rust','salmon_pink','tango_pink','turkey_red','vanilla_ice','wine'] %}
|
||||
{% elif states('input_select.computer_area_color_set') == 'Oranges' %}
|
||||
{% set colors = ['beaver','cadmium_orange','carrot_orange','champagne','chocolate','cocoa_brown','desert_sand','flame','gamboge','international_orange','kobicha','lion','marigold','orange_peel','persian_orange','persimmon','peru','portland_orange','pumpkin','russet','safety_orange','sandy_brown','tan','taupe','tawny','tea_rose','wood_brown'] %}
|
||||
{% elif states('input_select.computer_area_color_set') == 'Yellows' %}
|
||||
{% set colors = ['amber','beige','buff','citrine','cream','cyber_yellow','ecru','harvest_gold','jasmine','jonquil','khaki','lemon','mellow_yellow','mikado_yellow','mustard','naples_yellow','old_gold','process_yellow','royal_yellow','safety_yellow','saffron','school_bus_yellow','straw','vanilla'] %}
|
||||
{% elif states('input_select.computer_area_color_set') == 'Greens' %}
|
||||
{% set colors = ['army_green','artichoke','asparagus','avacado','bottle_green','bright_mint','celadon','emerald','fern_green','forest_green','harlequin','hunter_green','india_green','islamic_green','jade','kelly_green','laurel_green','malachite','mantis','mint_green','moss_green','neon_green','olive','pakistan_green','paris_green','rifle_green','russian_green','sea_green','shamrock_green','slytherin_green'] %}
|
||||
{% elif states('input_select.computer_area_color_set') == 'Cyans' %}
|
||||
{% set colors = ['aqua','aquamarine','brunswick_green','celadon_green','celeste','cerulean','charleston_green','dark_cyan','electric_blue','feldgrau','gray_green','midnight_green','morning_blue','myrtle_green','persian_green','robin_egg_blue','sky_blue','teal','teal_blue','turquoise','verdigris','viridian'] %}
|
||||
{% elif states('input_select.computer_area_color_set') == 'Blues' %}
|
||||
{% set colors = ['azure','baby_blue','blue_gray','capri','cornflower','egyptian_blue','glaucous','independence','indigo','indigo_dye','liberty','light_blue','midnight_blue','navy_blue','periwinkle','powder_blue','resolution_blue','sapphire','space_cadet','steel_blue','ultramarine'] %}
|
||||
{% elif states('input_select.computer_area_color_set') == 'Purples' %}
|
||||
{% set colors = ['byzantium','dark_purple','electric_indigo','eminence','heliotrope','indigo','indigo_dye','mardi_gras','mauve','medium_purple','orchid','pansy_purple','phlox','purpureus','thistle','tropical_indigo','tyrian_purple','royal_purple'] %}
|
||||
{% elif states('input_select.computer_area_color_set') == 'Magentas' %}
|
||||
{% set colors = ['amaranth','antique_fuchsia','baby_pink','cameo_pink','carnation_pink','charm_pink','china_pink','cotton_candy','dark_magenta','fandango','french_fuchsia','french_pink','fuchsia_rose','magenta_haze','mimi_pink','persian_pink','piggy_pink','pink','pink_lace','pink_lavender','plum','queen_pink','rose','rose_quartz','shocking_pink','silver_pink','sky_magenta','super_pink'] %}
|
||||
{% elif states('input_select.computer_area_color_set') == 'Grays' %}
|
||||
{% set colors = ['ash_gray','battleship_gray','cadet_gray','charcoal','dim_gray','gunmetal','jet','marengo','nickel','platinum','rocket_metallic','silver','slate_gray'] %}
|
||||
{% endif %}
|
||||
{{ colors|random }}
|
||||
|
||||
- delay:
|
||||
seconds: '{{ states("input_number.computer_area_light_cycle_transition") | int }}'
|
||||
|
||||
until:
|
||||
- condition: state
|
||||
entity_id: input_boolean.computer_area_light_cycle
|
||||
state: 'off'
|
||||
|
||||
- service: automation.trigger
|
||||
entity_id: automation.computer_area_lights_to_on
|
||||
@@ -0,0 +1,16 @@
|
||||
alias: Computer Area Lights Manual
|
||||
id: automation_computer_area_lights_manual
|
||||
mode: single
|
||||
# Hide warnings when triggered while in delay.
|
||||
max_exceeded: silent
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: switch.great_room_motion_switch
|
||||
|
||||
action:
|
||||
- service: light.turn_on
|
||||
data:
|
||||
profile: concentrate
|
||||
target:
|
||||
entity_id: light.computer_area_hue
|
||||
@@ -0,0 +1,83 @@
|
||||
alias: Computer Area Lights to Off
|
||||
id: automation_computer_area_lights_to_off
|
||||
mode: single
|
||||
# Hide warnings when triggered while in delay.
|
||||
max_exceeded: silent
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: input_select.computer_area_mode
|
||||
|
||||
- platform: state
|
||||
entity_id: input_boolean.computer_area_occupied
|
||||
to: 'off'
|
||||
|
||||
- platform: state
|
||||
id: light_level
|
||||
entity_id: binary_sensor.computer_area_naturally_lit
|
||||
to: 'on'
|
||||
|
||||
condition:
|
||||
- alias: "Not occupied or mode is set to off"
|
||||
condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.computer_area_mode
|
||||
state: 'Off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.computer_area_occupied
|
||||
state: 'off'
|
||||
- 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'
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.lighting_automations
|
||||
state: 'on'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.computer_area_mode
|
||||
state: 'Off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.computer_area_occupied
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.computer_chair_contact_occupied
|
||||
state: 'off'
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.computer_area_mode
|
||||
state: 'Manual'
|
||||
sequence:
|
||||
- service: scene.turn_on
|
||||
data:
|
||||
transition: 5
|
||||
target:
|
||||
entity_id: scene.computer_area_hue_off
|
||||
# - service: light.turn_off
|
||||
# target:
|
||||
# entity_id: light.basement_1
|
||||
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: light.great_room_hue
|
||||
state: 'off'
|
||||
- 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.great_room_motion_switch
|
||||
@@ -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
|
||||
@@ -0,0 +1,68 @@
|
||||
alias: 'Computer Area Not Occupied'
|
||||
id: automation_computer_area_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.computer_area_occupied
|
||||
to: 'off'
|
||||
for: '00:15:00'
|
||||
|
||||
# - platform: time_pattern
|
||||
# minutes: "/5"
|
||||
|
||||
condition:
|
||||
- alias: "Room is considered occupied"
|
||||
condition: state
|
||||
entity_id: input_boolean.computer_area_occupied
|
||||
state: 'on'
|
||||
|
||||
- alias: "Lights are not forced to be turned off manually"
|
||||
condition: state
|
||||
entity_id: input_boolean.lights_off_manually
|
||||
state: 'off'
|
||||
|
||||
- alias: "Either the home is unoccupied, or no presence has been detected in the room for 15 minutes"
|
||||
condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.home_occupied
|
||||
state: 'off'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.computer_area_person_occupancy
|
||||
state: 'off'
|
||||
for:
|
||||
minutes: 15
|
||||
- condition: state
|
||||
entity_id: binary_sensor.computer_area_occupied
|
||||
state: 'off'
|
||||
for:
|
||||
minutes: 15
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.home_occupied
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: input_boolean.computer_area_occupied
|
||||
- conditions:
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.house
|
||||
state: 'Manual'
|
||||
sequence:
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: input_boolean.computer_area_occupied
|
||||
@@ -0,0 +1,33 @@
|
||||
alias: 'Computer Area Occupied'
|
||||
id: automation_computer_area_occupied
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- binary_sensor.computer_area_occupied
|
||||
to: 'on'
|
||||
condition:
|
||||
# Computer area was not already occupied or computer area light is off while not set to manual or off
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.computer_area_occupied
|
||||
state: 'off'
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: light.computer_area_hue
|
||||
state: 'off'
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.computer_area_mode
|
||||
state: 'Off'
|
||||
- condition: state
|
||||
entity_id: input_select.computer_area_mode
|
||||
state: 'Manual'
|
||||
|
||||
action:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.computer_area_occupied
|
||||
@@ -0,0 +1,80 @@
|
||||
alias: Dining Room Lights to Off
|
||||
id: automation_dining_room_lights_to_off
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: input_select.dining_room_mode
|
||||
|
||||
- platform: state
|
||||
entity_id: input_boolean.dining_room_occupied
|
||||
to: 'off'
|
||||
|
||||
- platform: state
|
||||
id: light_level
|
||||
entity_id: binary_sensor.dining_room_naturally_lit
|
||||
from: 'off'
|
||||
to: 'on'
|
||||
|
||||
#- platform: time_pattern
|
||||
# minutes: "/5"
|
||||
|
||||
condition:
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.dining_room_mode
|
||||
state: 'Off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.dining_room_occupied
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.dining_room_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.dining_room_mode
|
||||
state: 'Off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.dining_room_occupied
|
||||
state: 'off'
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.dining_room_mode
|
||||
state: 'Manual'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.dining_room_naturally_lit
|
||||
state: 'on'
|
||||
sequence:
|
||||
- alias: "Turn off z-wave switch since all lights are off"
|
||||
service: homeassistant.turn_off
|
||||
target:
|
||||
entity_id: switch.dining_room_switch
|
||||
# - service: scene.turn_on
|
||||
# data:
|
||||
# transition: 5
|
||||
# target:
|
||||
# entity_id: scene.dining_room_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.dining_room_switch
|
||||
@@ -0,0 +1,161 @@
|
||||
alias: Dining Room Lights to On
|
||||
id: automation_dining_room_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.dining_room_mode
|
||||
- input_select.automatic_light_profile
|
||||
|
||||
- platform: state
|
||||
id: light_level
|
||||
entity_id: binary_sensor.dining_room_naturally_lit
|
||||
from: 'on'
|
||||
to: 'off'
|
||||
|
||||
- platform: state
|
||||
id: occupied
|
||||
entity_id: input_boolean.dining_room_occupied
|
||||
to: "on"
|
||||
|
||||
# - platform: state
|
||||
# id: motion
|
||||
# entity_id: group.dining_room_motion
|
||||
# to: "on"
|
||||
|
||||
condition:
|
||||
- alias: "Home is occupied"
|
||||
condition: state
|
||||
entity_id: input_boolean.home_occupied
|
||||
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.dining_room_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.dining_room_occupied
|
||||
state: "on"
|
||||
|
||||
- alias: "The room is not set to 'Off'"
|
||||
condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.dining_room_mode
|
||||
state: "Off"
|
||||
|
||||
# variables:
|
||||
# switch_name: switch.dining_room_switch
|
||||
# light_name: dining_room_hue
|
||||
# mode_name: input_select.dining_room_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.dining_room_mode
|
||||
# state: Manual
|
||||
# sequence:
|
||||
# - service: light.turn_on
|
||||
# target:
|
||||
# entity_id: light.dining_room_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.dining_room_mode
|
||||
# state: Auto
|
||||
# - alias: "Lights are on"
|
||||
# condition: state
|
||||
# entity_id: light.dining_room_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.dining_room_mode
|
||||
# state: Auto
|
||||
# - alias: "Lights are off"
|
||||
# condition: state
|
||||
# entity_id: light.dining_room_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 Dining Room Mode scene with a transition"
|
||||
# conditions:
|
||||
# - alias: "Room not manual or auto and lights are on"
|
||||
# condition: state
|
||||
# entity_id: light.dining_room_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 Dining Room Mode scene without a transition"
|
||||
# conditions:
|
||||
# - alias: "Room not manual or auto and lights are off"
|
||||
# condition: state
|
||||
# entity_id: light.dining_room_hue
|
||||
# state: 'off'
|
||||
# sequence:
|
||||
# - service: scene.turn_on
|
||||
# target:
|
||||
# entity_id: "scene.{{light_name}}_{{states(mode_name).lower().replace(' ','_')}}"
|
||||
|
||||
action:
|
||||
- alias: "Make sure Z-Wave switch is turned on"
|
||||
service: homeassistant.turn_on
|
||||
target:
|
||||
entity_id: switch.dining_room_switch
|
||||
|
||||
- delay: 1
|
||||
@@ -0,0 +1,65 @@
|
||||
alias: 'Dining Room Not Occupied'
|
||||
id: automation_dining_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.dining_room_occupied
|
||||
to: 'off'
|
||||
for: '00:15:00'
|
||||
|
||||
# - platform: time_pattern
|
||||
# minutes: "/5"
|
||||
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.dining_room_occupied
|
||||
state: 'on'
|
||||
|
||||
- condition: state
|
||||
entity_id: input_boolean.lights_off_manually
|
||||
state: 'off'
|
||||
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.home_occupied
|
||||
state: 'off'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.dining_room_person_occupancy
|
||||
state: 'off'
|
||||
for:
|
||||
minutes: 5
|
||||
- condition: state
|
||||
entity_id: binary_sensor.dining_room_occupied
|
||||
state: 'off'
|
||||
for:
|
||||
minutes: 5
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.home_occupied
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: input_boolean.dining_room_occupied
|
||||
- conditions:
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.house
|
||||
state: 'Manual'
|
||||
sequence:
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: input_boolean.dining_room_occupied
|
||||
@@ -0,0 +1,18 @@
|
||||
alias: 'Dining Room Occupied'
|
||||
id: automation_dining_room_occupied
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- binary_sensor.dining_room_occupied
|
||||
to: 'on'
|
||||
condition:
|
||||
# Dining Room was not already occupied
|
||||
- condition: state
|
||||
entity_id: input_boolean.dining_room_occupied
|
||||
state: 'off'
|
||||
|
||||
action:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.dining_room_occupied
|
||||
@@ -0,0 +1,70 @@
|
||||
alias: Driveway Lights
|
||||
id: automation_driveway_lights
|
||||
mode: queued
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
id: motion_on
|
||||
entity_id:
|
||||
- binary_sensor.from_street_vehicle_occupancy
|
||||
- binary_sensor.driveway_person_occupancy
|
||||
- binary_sensor.front_yard_person_occupancy
|
||||
- binary_sensor.front_yard_animal_occupancy
|
||||
- binary_sensor.garage_door
|
||||
from: "off"
|
||||
to: "on"
|
||||
|
||||
- platform: state
|
||||
id: motion_off
|
||||
entity_id:
|
||||
- binary_sensor.from_street_vehicle_occupancy
|
||||
- binary_sensor.driveway_person_occupancy
|
||||
- binary_sensor.front_yard_person_occupancy
|
||||
- binary_sensor.front_yard_animal_occupancy
|
||||
- binary_sensor.garage_door
|
||||
from: "on"
|
||||
to: "off"
|
||||
for: "00:01:00"
|
||||
|
||||
- platform: state
|
||||
id: got_bright
|
||||
entity_id: binary_sensor.is_dark
|
||||
to: "on"
|
||||
|
||||
- platform: state
|
||||
id: got_dark
|
||||
entity_id: binary_sensor.is_dark
|
||||
to: "off"
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id: "motion_on"
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
alias: "It is dark outside"
|
||||
entity_id: binary_sensor.is_dark
|
||||
state: 'on'
|
||||
- condition: state
|
||||
alias: "Front porch light is on"
|
||||
entity_id: light.front_porch_overhead
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: light.driveway
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.driveway
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id: "motion_off"
|
||||
- condition: state
|
||||
entity_id: light.driveway
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: light.turn_off
|
||||
target:
|
||||
entity_id: light.driveway
|
||||
@@ -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
|
||||
@@ -0,0 +1,111 @@
|
||||
alias: Front Porch Lights
|
||||
id: automation_front_porch_lights
|
||||
mode: queued
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
id: motion_on
|
||||
entity_id:
|
||||
- binary_sensor.front_porch_motion
|
||||
- binary_sensor.front_porch_person_occupancy
|
||||
to: "on"
|
||||
|
||||
- platform: state
|
||||
id: motion_off
|
||||
entity_id: binary_sensor.front_porch_motion, binary_sensor.front_porch_person_occupancy
|
||||
to: "off"
|
||||
for:
|
||||
minutes: 1
|
||||
|
||||
- platform: state
|
||||
id: door_open
|
||||
entity_id: binary_sensor.outer_garage_door, binary_sensor.garage_door
|
||||
to: "on"
|
||||
|
||||
- platform: state
|
||||
id: door_shut
|
||||
entity_id: binary_sensor.outer_garage_door
|
||||
to: "off"
|
||||
for:
|
||||
minutes: 1
|
||||
|
||||
- platform: state
|
||||
id: too_dark
|
||||
entity_id: binary_sensor.front_porch_naturally_lit
|
||||
to: "off"
|
||||
|
||||
- platform: state
|
||||
id: too_bright
|
||||
entity_id: binary_sensor.front_porch_naturally_lit
|
||||
to: "on"
|
||||
|
||||
condition:
|
||||
- condition: or
|
||||
conditions:
|
||||
- alias: "Front porch not naturally lit"
|
||||
condition: state
|
||||
entity_id: binary_sensor.front_porch_naturally_lit
|
||||
state: 'off'
|
||||
|
||||
- alias: "Light is already on"
|
||||
condition: state
|
||||
entity_id: light.front_porch_overhead
|
||||
state: 'on'
|
||||
|
||||
- alias: "It is not late evening"
|
||||
condition: state
|
||||
entity_id: binary_sensor.late_evening
|
||||
state: 'off'
|
||||
|
||||
- alias: "It is not night"
|
||||
condition: state
|
||||
entity_id: binary_sensor.night
|
||||
state: 'off'
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id: "door_open"
|
||||
|
||||
- condition: state
|
||||
entity_id: light.front_porch_overhead
|
||||
state: 'off'
|
||||
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.front_porch_overhead
|
||||
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id: "motion_on"
|
||||
|
||||
- condition: state
|
||||
entity_id: light.front_porch_overhead
|
||||
state: 'off'
|
||||
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.front_porch_overhead
|
||||
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.front_porch_motion
|
||||
state: "off"
|
||||
for:
|
||||
minutes: 1
|
||||
|
||||
- condition: state
|
||||
entity_id: binary_sensor.outer_garage_door
|
||||
state: 'off'
|
||||
|
||||
- condition: state
|
||||
entity_id: light.front_porch_overhead
|
||||
state: 'on'
|
||||
|
||||
sequence:
|
||||
- service: light.turn_off
|
||||
target:
|
||||
entity_id: light.front_porch_overhead
|
||||
@@ -0,0 +1,12 @@
|
||||
alias: Baby Monitor off Front Room display
|
||||
id: automation_baby_monitor_off_front_room_hub
|
||||
|
||||
trigger:
|
||||
platform: event
|
||||
event_type: timer.finished
|
||||
event_data:
|
||||
entity_id: timer.nursery_camera_on_hub
|
||||
action:
|
||||
service: media_player.turn_off
|
||||
data:
|
||||
entity_id: media_player.front_room_hub
|
||||
@@ -0,0 +1,31 @@
|
||||
alias: Baby Monitor off Front Room TV
|
||||
id: automation_baby_monitor_off_front_room_tv
|
||||
|
||||
trigger:
|
||||
- platform: event
|
||||
event_type: timer.finished
|
||||
event_data:
|
||||
entity_id: timer.nursery_camera_on_tv
|
||||
|
||||
- platform: state
|
||||
entity_id: media_player.front_room_tv
|
||||
attribute: source
|
||||
from: 'IP Camera Viewer - Pro'
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: media_player.front_room_tv
|
||||
attribute: source
|
||||
state: 'IP Camera Viewer - Pro'
|
||||
sequence:
|
||||
- service: timer.cancel
|
||||
data:
|
||||
entity_id: timer.nursery_camera_on_tv
|
||||
default:
|
||||
service: media_player.turn_off
|
||||
data:
|
||||
entity_id: media_player.front_room_tv
|
||||
@@ -0,0 +1,69 @@
|
||||
alias: Baby Monitor on Front Room display
|
||||
id: automation_baby_monitor_on_hub
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: binary_sensor.black_bed_occupied
|
||||
to: 'off'
|
||||
for: '00:00:03'
|
||||
|
||||
- platform: state
|
||||
entity_id: binary_sensor.white_bed_occupied
|
||||
to: 'off'
|
||||
for: '00:00:03'
|
||||
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.kids_at_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: group.kids_in_bed
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.home_occupied
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.front_room_person_occupancy
|
||||
state: 'on'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: media_player.front_room_hub
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: media_player.front_room_hub
|
||||
state: 'idle'
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: timer.nursery_camera_on_hub
|
||||
state: 'idle'
|
||||
sequence:
|
||||
- service: media_player.volume_set
|
||||
data:
|
||||
entity_id: media_player.front_room_hub
|
||||
volume_level: 0.1
|
||||
|
||||
- service: media_player.play_media
|
||||
target:
|
||||
entity_id: media_player.front_room_hub
|
||||
data:
|
||||
media_content_id: camera-casting-yml/nursery-camera
|
||||
media_content_type: lovelace
|
||||
metadata:
|
||||
title: Nursery Camera
|
||||
thumbnail: https://brands.home-assistant.io/_/lovelace/logo.png
|
||||
media_class: app
|
||||
children_media_class: null
|
||||
navigateIds:
|
||||
- {}
|
||||
- media_content_type: lovelace
|
||||
media_content_id: ''
|
||||
- media_content_type: lovelace
|
||||
media_content_id: camera-casting-yml
|
||||
|
||||
- service: timer.start
|
||||
data:
|
||||
entity_id: timer.nursery_camera_on_hub
|
||||
@@ -0,0 +1,94 @@
|
||||
alias: Baby Monitor on TV
|
||||
id: automation_baby_monitor_on_tv
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: binary_sensor.black_bed_occupied
|
||||
to: 'off'
|
||||
for: '00:00:03'
|
||||
- platform: state
|
||||
entity_id: binary_sensor.white_bed_occupied
|
||||
to: 'off'
|
||||
for: '00:00:03'
|
||||
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.home_occupied
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.front_room_occupied
|
||||
state: 'on'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: media_player.front_room_tv
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: media_player.front_room_tv
|
||||
state: 'standby'
|
||||
- condition: state
|
||||
entity_id: input_boolean.computer_area_occupied
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.master_bed_occupied
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.master_bedroom_occupied
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.master_bedroom_occupied
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.master_bedroom_asleep
|
||||
state: 'off'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.emmett_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.emmett_in_bed
|
||||
state: 'on'
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.bridget_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.bridget_in_bed
|
||||
state: 'on'
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.ebin_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.ebin_in_bed
|
||||
state: 'on'
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: media_player.front_room_tv
|
||||
state: playing
|
||||
- condition: state
|
||||
entity_id: media_player.front_room_tv
|
||||
state: paused
|
||||
- condition: state
|
||||
entity_id: media_player.front_room_tv
|
||||
attribute: source
|
||||
state: 'IP Camera Viewer - Pro'
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: timer.nursery_camera_on_hub
|
||||
state: 'idle'
|
||||
sequence:
|
||||
- service: rest_command.nursery_on_roku_1
|
||||
|
||||
- service: timer.start
|
||||
data:
|
||||
entity_id: timer.nursery_camera_on_tv
|
||||
@@ -0,0 +1,169 @@
|
||||
alias: Front Room Light Cycle
|
||||
id: automation_front_room_light_cycle
|
||||
trigger:
|
||||
- id: light_cycle_on
|
||||
platform: state
|
||||
entity_id: input_boolean.front_room_light_cycle
|
||||
from: 'off'
|
||||
to: 'on'
|
||||
|
||||
- id: setting_change
|
||||
platform: state
|
||||
entity_id:
|
||||
- input_number.front_room_light_cycle_transition
|
||||
- input_select.front_room_color_set
|
||||
- input_boolean.front_room_cycle_same
|
||||
|
||||
condition: "{{ is_state('input_boolean.front_room_light_cycle','on') }}"
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.front_room_light_cycle
|
||||
state: 'on'
|
||||
sequence:
|
||||
|
||||
- repeat:
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions: # If all lights should be the same color and the projector is off, reference the Hue group for all the lights
|
||||
- condition: state
|
||||
entity_id: input_boolean.front_room_cycle_same
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.front_room_hue
|
||||
data:
|
||||
brightness: '{{ states("input_number.front_room_light_cycle_brightness") | int }}'
|
||||
transition: '{{ states("input_number.front_room_light_cycle_transition") | int }}'
|
||||
profile: >
|
||||
{% if states('input_select.front_room_color_set') == 'Basic' %}
|
||||
{% set colors = ['white','black','red','orange','yellow','green','blue','purple','pink','brown','gray'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Color Wheel' %}
|
||||
{% set colors = ['red','orange','amber','yellow','chartreuse','green','teal','blue','violet','purple','magenta'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Rainbow' %}
|
||||
{% set colors = ['red','orange','yellow','green','blue','indigo','violet'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Flourescent' %}
|
||||
{% set colors = ['radical_red','wild_watermelon','outrageous_orange','atomic_tangerine','neon_carrot','sunglow','laser_lemon','unmellow_yellow','electric_lime','screamin_green','magic_mint','blizzard_blue','shocking_pink','razzle_dazzle_rose','hot_magenta','purple_pizzazz'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Silver Swirl' %}
|
||||
{% set colors = ['aztec_gold','burnished_brown','cerulean_frost','cinnamon_satin','copper_penny','cosmic_cobalt','glossy_grape','granite_gray','green_sheen','lilac_luster','misty_moss','mystic_maroon','pearly_purple','pewter_blue','polished_pine','quick_silver','rose_dust','rusty_red','shadow_blue','shiny_shamrock','steel_teal','sugar_plum','twilight_lavender','wintergreen_dream'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Gem Tones' %}
|
||||
{% set colors = ['amethyst','citrine','emerald','jade','lapis_lazuli','malachite','rose_quartz','ruby','sapphire','smokey_topaz'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Reds' %}
|
||||
{% set colors = ['auburn','baby_pink','barn_red','burgundy','burnt_umber','cadmium_red','cardinal','chesnut','chili_red','congo_pink','coral_pink','desire','fire_engine_red','imperial_red','new_york_pink','paradise_pink','pastel_pink','pigment_red','rust','salmon_pink','tango_pink','turkey_red','vanilla_ice','wine'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Oranges' %}
|
||||
{% set colors = ['beaver','cadmium_orange','carrot_orange','champagne','chocolate','cocoa_brown','desert_sand','flame','gamboge','international_orange','kobicha','lion','marigold','orange_peel','persian_orange','persimmon','peru','portland_orange','pumpkin','russet','safety_orange','sandy_brown','tan','taupe','tawny','tea_rose','wood_brown'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Yellows' %}
|
||||
{% set colors = ['amber','beige','buff','citrine','cream','cyber_yellow','ecru','harvest_gold','jasmine','jonquil','khaki','lemon','mellow_yellow','mikado_yellow','mustard','naples_yellow','old_gold','process_yellow','royal_yellow','safety_yellow','saffron','school_bus_yellow','straw','vanilla'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Greens' %}
|
||||
{% set colors = ['army_green','artichoke','asparagus','avacado','bottle_green','bright_mint','celadon','emerald','fern_green','forest_green','harlequin','hunter_green','india_green','islamic_green','jade','kelly_green','laurel_green','malachite','mantis','mint_green','moss_green','neon_green','olive','pakistan_green','paris_green','rifle_green','russian_green','sea_green','shamrock_green','slytherin_green'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Cyans' %}
|
||||
{% set colors = ['aqua','aquamarine','brunswick_green','celadon_green','celeste','cerulean','charleston_green','dark_cyan','electric_blue','feldgrau','gray_green','midnight_green','morning_blue','myrtle_green','persian_green','robin_egg_blue','sky_blue','teal','teal_blue','turquoise','verdigris','viridian'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Blues' %}
|
||||
{% set colors = ['azure','baby_blue','blue_gray','capri','cornflower','egyptian_blue','glaucous','independence','indigo','indigo_dye','liberty','light_blue','midnight_blue','navy_blue','periwinkle','powder_blue','resolution_blue','sapphire','space_cadet','steel_blue','ultramarine'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Purples' %}
|
||||
{% set colors = ['byzantium','dark_purple','electric_indigo','eminence','heliotrope','indigo','indigo_dye','mardi_gras','mauve','medium_purple','orchid','pansy_purple','phlox','purpureus','thistle','tropical_indigo','tyrian_purple','royal_purple'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Magentas' %}
|
||||
{% set colors = ['amaranth','antique_fuchsia','baby_pink','cameo_pink','carnation_pink','charm_pink','china_pink','cotton_candy','dark_magenta','fandango','french_fuchsia','french_pink','fuchsia_rose','magenta_haze','mimi_pink','persian_pink','piggy_pink','pink','pink_lace','pink_lavender','plum','queen_pink','rose','rose_quartz','shocking_pink','silver_pink','sky_magenta','super_pink'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Grays' %}
|
||||
{% set colors = ['ash_gray','battleship_gray','cadet_gray','charcoal','dim_gray','gunmetal','jet','marengo','nickel','platinum','rocket_metallic','silver','slate_gray'] %}
|
||||
{% endif %}
|
||||
{{ colors|random }}
|
||||
|
||||
- conditions: # If all lights should be different colors, start referencing the individual lights that don't obscure the TV
|
||||
- condition: state
|
||||
entity_id: input_boolean.front_room_cycle_same
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.front_room_splash_left
|
||||
data:
|
||||
brightness: '{{ states("input_number.front_room_light_cycle_brightness") | int }}'
|
||||
transition: '{{ states("input_number.front_room_light_cycle_transition") | int }}'
|
||||
profile: >
|
||||
{% if states('input_select.front_room_color_set') == 'Basic' %}
|
||||
{% set colors = ['white','black','red','orange','yellow','green','blue','purple','pink','brown','gray'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Color Wheel' %}
|
||||
{% set colors = ['red','orange','amber','yellow','chartreuse','green','teal','blue','violet','purple','magenta'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Rainbow' %}
|
||||
{% set colors = ['red','orange','yellow','green','blue','indigo','violet'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Flourescent' %}
|
||||
{% set colors = ['radical_red','wild_watermelon','outrageous_orange','atomic_tangerine','neon_carrot','sunglow','laser_lemon','unmellow_yellow','electric_lime','screamin_green','magic_mint','blizzard_blue','shocking_pink','razzle_dazzle_rose','hot_magenta','purple_pizzazz'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Silver Swirl' %}
|
||||
{% set colors = ['aztec_gold','burnished_brown','cerulean_frost','cinnamon_satin','copper_penny','cosmic_cobalt','glossy_grape','granite_gray','green_sheen','lilac_luster','misty_moss','mystic_maroon','pearly_purple','pewter_blue','polished_pine','quick_silver','rose_dust','rusty_red','shadow_blue','shiny_shamrock','steel_teal','sugar_plum','twilight_lavender','wintergreen_dream'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Gem Tones' %}
|
||||
{% set colors = ['amethyst','citrine','emerald','jade','lapis_lazuli','malachite','rose_quartz','ruby','sapphire','smokey_topaz'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Reds' %}
|
||||
{% set colors = ['auburn','baby_pink','barn_red','burgundy','burnt_umber','cadmium_red','cardinal','chesnut','chili_red','congo_pink','coral_pink','desire','fire_engine_red','imperial_red','new_york_pink','paradise_pink','pastel_pink','pigment_red','rust','salmon_pink','tango_pink','turkey_red','vanilla_ice','wine'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Oranges' %}
|
||||
{% set colors = ['beaver','cadmium_orange','carrot_orange','champagne','chocolate','cocoa_brown','desert_sand','flame','gamboge','international_orange','kobicha','lion','marigold','orange_peel','persian_orange','persimmon','peru','portland_orange','pumpkin','russet','safety_orange','sandy_brown','tan','taupe','tawny','tea_rose','wood_brown'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Yellows' %}
|
||||
{% set colors = ['amber','beige','buff','citrine','cream','cyber_yellow','ecru','harvest_gold','jasmine','jonquil','khaki','lemon','mellow_yellow','mikado_yellow','mustard','naples_yellow','old_gold','process_yellow','royal_yellow','safety_yellow','saffron','school_bus_yellow','straw','vanilla'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Greens' %}
|
||||
{% set colors = ['army_green','artichoke','asparagus','avacado','bottle_green','bright_mint','celadon','emerald','fern_green','forest_green','harlequin','hunter_green','india_green','islamic_green','jade','kelly_green','laurel_green','malachite','mantis','mint_green','moss_green','neon_green','olive','pakistan_green','paris_green','rifle_green','russian_green','sea_green','shamrock_green','slytherin_green'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Cyans' %}
|
||||
{% set colors = ['aqua','aquamarine','brunswick_green','celadon_green','celeste','cerulean','charleston_green','dark_cyan','electric_blue','feldgrau','gray_green','midnight_green','morning_blue','myrtle_green','persian_green','robin_egg_blue','sky_blue','teal','teal_blue','turquoise','verdigris','viridian'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Blues' %}
|
||||
{% set colors = ['azure','baby_blue','blue_gray','capri','cornflower','egyptian_blue','glaucous','independence','indigo','indigo_dye','liberty','light_blue','midnight_blue','navy_blue','periwinkle','powder_blue','resolution_blue','sapphire','space_cadet','steel_blue','ultramarine'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Purples' %}
|
||||
{% set colors = ['byzantium','dark_purple','electric_indigo','eminence','heliotrope','indigo','indigo_dye','mardi_gras','mauve','medium_purple','orchid','pansy_purple','phlox','purpureus','thistle','tropical_indigo','tyrian_purple','royal_purple'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Magentas' %}
|
||||
{% set colors = ['amaranth','antique_fuchsia','baby_pink','cameo_pink','carnation_pink','charm_pink','china_pink','cotton_candy','dark_magenta','fandango','french_fuchsia','french_pink','fuchsia_rose','magenta_haze','mimi_pink','persian_pink','piggy_pink','pink','pink_lace','pink_lavender','plum','queen_pink','rose','rose_quartz','shocking_pink','silver_pink','sky_magenta','super_pink'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Grays' %}
|
||||
{% set colors = ['ash_gray','battleship_gray','cadet_gray','charcoal','dim_gray','gunmetal','jet','marengo','nickel','platinum','rocket_metallic','silver','slate_gray'] %}
|
||||
{% endif %}
|
||||
{{ colors|random }}
|
||||
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.front_room_splash_left
|
||||
data:
|
||||
brightness: '{{ states("input_number.front_room_light_cycle_brightness") | int }}'
|
||||
transition: '{{ states("input_number.front_room_light_cycle_transition") | int }}'
|
||||
profile: >
|
||||
{% if states('input_select.front_room_color_set') == 'Basic' %}
|
||||
{% set colors = ['white','black','red','orange','yellow','green','blue','purple','pink','brown','gray'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Color Wheel' %}
|
||||
{% set colors = ['red','orange','amber','yellow','chartreuse','green','teal','blue','violet','purple','magenta'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Rainbow' %}
|
||||
{% set colors = ['red','orange','yellow','green','blue','indigo','violet'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Flourescent' %}
|
||||
{% set colors = ['radical_red','wild_watermelon','outrageous_orange','atomic_tangerine','neon_carrot','sunglow','laser_lemon','unmellow_yellow','electric_lime','screamin_green','magic_mint','blizzard_blue','shocking_pink','razzle_dazzle_rose','hot_magenta','purple_pizzazz'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Silver Swirl' %}
|
||||
{% set colors = ['aztec_gold','burnished_brown','cerulean_frost','cinnamon_satin','copper_penny','cosmic_cobalt','glossy_grape','granite_gray','green_sheen','lilac_luster','misty_moss','mystic_maroon','pearly_purple','pewter_blue','polished_pine','quick_silver','rose_dust','rusty_red','shadow_blue','shiny_shamrock','steel_teal','sugar_plum','twilight_lavender','wintergreen_dream'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Gem Tones' %}
|
||||
{% set colors = ['amethyst','citrine','emerald','jade','lapis_lazuli','malachite','rose_quartz','ruby','sapphire','smokey_topaz'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Reds' %}
|
||||
{% set colors = ['auburn','baby_pink','barn_red','burgundy','burnt_umber','cadmium_red','cardinal','chesnut','chili_red','congo_pink','coral_pink','desire','fire_engine_red','imperial_red','new_york_pink','paradise_pink','pastel_pink','pigment_red','rust','salmon_pink','tango_pink','turkey_red','vanilla_ice','wine'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Oranges' %}
|
||||
{% set colors = ['beaver','cadmium_orange','carrot_orange','champagne','chocolate','cocoa_brown','desert_sand','flame','gamboge','international_orange','kobicha','lion','marigold','orange_peel','persian_orange','persimmon','peru','portland_orange','pumpkin','russet','safety_orange','sandy_brown','tan','taupe','tawny','tea_rose','wood_brown'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Yellows' %}
|
||||
{% set colors = ['amber','beige','buff','citrine','cream','cyber_yellow','ecru','harvest_gold','jasmine','jonquil','khaki','lemon','mellow_yellow','mikado_yellow','mustard','naples_yellow','old_gold','process_yellow','royal_yellow','safety_yellow','saffron','school_bus_yellow','straw','vanilla'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Greens' %}
|
||||
{% set colors = ['army_green','artichoke','asparagus','avacado','bottle_green','bright_mint','celadon','emerald','fern_green','forest_green','harlequin','hunter_green','india_green','islamic_green','jade','kelly_green','laurel_green','malachite','mantis','mint_green','moss_green','neon_green','olive','pakistan_green','paris_green','rifle_green','russian_green','sea_green','shamrock_green','slytherin_green'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Cyans' %}
|
||||
{% set colors = ['aqua','aquamarine','brunswick_green','celadon_green','celeste','cerulean','charleston_green','dark_cyan','electric_blue','feldgrau','gray_green','midnight_green','morning_blue','myrtle_green','persian_green','robin_egg_blue','sky_blue','teal','teal_blue','turquoise','verdigris','viridian'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Blues' %}
|
||||
{% set colors = ['azure','baby_blue','blue_gray','capri','cornflower','egyptian_blue','glaucous','independence','indigo','indigo_dye','liberty','light_blue','midnight_blue','navy_blue','periwinkle','powder_blue','resolution_blue','sapphire','space_cadet','steel_blue','ultramarine'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Purples' %}
|
||||
{% set colors = ['byzantium','dark_purple','electric_indigo','eminence','heliotrope','indigo','indigo_dye','mardi_gras','mauve','medium_purple','orchid','pansy_purple','phlox','purpureus','thistle','tropical_indigo','tyrian_purple','royal_purple'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Magentas' %}
|
||||
{% set colors = ['amaranth','antique_fuchsia','baby_pink','cameo_pink','carnation_pink','charm_pink','china_pink','cotton_candy','dark_magenta','fandango','french_fuchsia','french_pink','fuchsia_rose','magenta_haze','mimi_pink','persian_pink','piggy_pink','pink','pink_lace','pink_lavender','plum','queen_pink','rose','rose_quartz','shocking_pink','silver_pink','sky_magenta','super_pink'] %}
|
||||
{% elif states('input_select.front_room_color_set') == 'Grays' %}
|
||||
{% set colors = ['ash_gray','battleship_gray','cadet_gray','charcoal','dim_gray','gunmetal','jet','marengo','nickel','platinum','rocket_metallic','silver','slate_gray'] %}
|
||||
{% endif %}
|
||||
{{ colors|random }}
|
||||
|
||||
- delay:
|
||||
seconds: '{{ states("input_number.front_room_light_cycle_transition") | int }}'
|
||||
|
||||
until:
|
||||
- condition: state
|
||||
entity_id: input_boolean.front_room_light_cycle
|
||||
state: 'off'
|
||||
|
||||
- service: automation.trigger
|
||||
entity_id: automation.front_room_lights_to_on
|
||||
@@ -0,0 +1,77 @@
|
||||
alias: Front Room Lights to Off
|
||||
id: automation_front_room_lights_to_off
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: input_select.front_room_mode
|
||||
|
||||
- platform: state
|
||||
entity_id: input_boolean.front_room_occupied
|
||||
to: 'off'
|
||||
|
||||
- platform: state
|
||||
entity_id: binary_sensor.front_room_naturally_lit
|
||||
from: 'off'
|
||||
to: 'on'
|
||||
|
||||
#- platform: time_pattern
|
||||
# minutes: "/5"
|
||||
|
||||
condition:
|
||||
|
||||
- alias: "Front room light cycle not on"
|
||||
condition: state
|
||||
entity_id: input_boolean.front_room_light_cycle
|
||||
state: "off"
|
||||
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.front_room_mode
|
||||
state: 'Off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.front_room_occupied
|
||||
state: 'off'
|
||||
- "{{ is_state('binary_sensor.front_room_naturally_lit','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.front_room_mode
|
||||
state: 'Off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.front_room_occupied
|
||||
state: 'off'
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.front_room_mode
|
||||
state: 'Manual'
|
||||
- "{{ is_state('binary_sensor.front_room_naturally_lit','on') }}"
|
||||
sequence:
|
||||
- service: scene.turn_on
|
||||
data:
|
||||
transition: 5
|
||||
target:
|
||||
entity_id: scene.front_room_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.front_room_motion_switch
|
||||
@@ -0,0 +1,173 @@
|
||||
alias: Front Room Lights to On
|
||||
id: automation_front_room_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.front_room_mode
|
||||
- input_select.automatic_light_profile
|
||||
|
||||
- platform: state
|
||||
id: occupied
|
||||
entity_id:
|
||||
- binary_sensor.front_room_occupied
|
||||
- input_boolean.front_room_occupied
|
||||
to: "on"
|
||||
|
||||
# - platform: state
|
||||
# id: motion
|
||||
# entity_id: group.front_room_motion
|
||||
# to: "on"
|
||||
|
||||
- platform: state
|
||||
id: light_level
|
||||
entity_id: binary_sensor.front_room_naturally_lit
|
||||
from: 'on'
|
||||
to: 'off'
|
||||
|
||||
condition:
|
||||
- alias: "Home is occupied"
|
||||
condition: state
|
||||
entity_id: input_boolean.home_occupied
|
||||
state: "on"
|
||||
|
||||
- alias: "Front room light cycle not on"
|
||||
condition: state
|
||||
entity_id: input_boolean.front_room_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: "Light level below trigger amount"
|
||||
condition: state
|
||||
entity_id: binary_sensor.front_room_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.front_room_occupied
|
||||
state: "on"
|
||||
|
||||
- alias: "The light level changed, the room is occupied, and the light is off"
|
||||
condition: and
|
||||
conditions:
|
||||
- condition: trigger
|
||||
id: light_level
|
||||
- condition: state
|
||||
entity_id: input_boolean.front_room_occupied
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: light.front_room_hue
|
||||
state: 'off'
|
||||
|
||||
variables:
|
||||
switch_name: switch.front_room_motion_switch
|
||||
light_name: front_room_hue
|
||||
mode_name: input_select.front_room_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.front_room_mode
|
||||
state: Manual
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.front_room_hue
|
||||
|
||||
- alias: "If the room is set to auto, the lights are already on, and the room is dim, change to the Automatic Light Profile scene with a transition"
|
||||
conditions:
|
||||
- alias: "Room set to auto"
|
||||
condition: state
|
||||
entity_id: input_select.front_room_mode
|
||||
state: Auto
|
||||
- alias: "Lights are on"
|
||||
condition: state
|
||||
entity_id: light.front_room_hue
|
||||
state: 'on'
|
||||
- "{{ states('sensor.front_room_light_level') | float(default=0) < states('input_number.front_room_light_level_trigger') | float(default=0) }}"
|
||||
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.front_room_mode
|
||||
state: Auto
|
||||
- alias: "Lights are off"
|
||||
condition: state
|
||||
entity_id: light.front_room_hue
|
||||
state: 'off'
|
||||
- "{{ states('sensor.front_room_light_level') | float(default=0) < states('input_number.front_room_light_level_trigger') | float(default=0) }}"
|
||||
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 Front Room Mode scene with a transition"
|
||||
conditions:
|
||||
- alias: "Room not manual or auto and lights are on"
|
||||
condition: state
|
||||
entity_id: light.front_room_hue
|
||||
state: 'on'
|
||||
- "{{ states('sensor.front_room_light_level') | float(default=0) < states('input_number.front_room_light_level_trigger') | float(default=0) }}"
|
||||
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 Front Room Mode scene without a transition"
|
||||
conditions:
|
||||
- alias: "Room not manual or auto and lights are off"
|
||||
condition: state
|
||||
entity_id: light.front_room_hue
|
||||
state: 'off'
|
||||
- "{{ states('sensor.front_room_light_level') | float(default=0) < states('input_number.front_room_light_level_trigger') | float(default=0) }}"
|
||||
sequence:
|
||||
- service: scene.turn_on
|
||||
target:
|
||||
entity_id: "scene.{{light_name}}_{{states(mode_name).lower().replace(' ','_')}}"
|
||||
|
||||
- delay: 1
|
||||
@@ -0,0 +1,65 @@
|
||||
alias: 'Front Room Not Occupied'
|
||||
id: automation_front_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.front_room_occupied
|
||||
to: 'off'
|
||||
for: '00:05:00'
|
||||
|
||||
# - platform: time_pattern
|
||||
# minutes: "/5"
|
||||
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.front_room_occupied
|
||||
state: 'on'
|
||||
|
||||
- condition: state
|
||||
entity_id: input_boolean.lights_off_manually
|
||||
state: 'off'
|
||||
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.home_occupied
|
||||
state: 'off'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.front_room_person_occupancy
|
||||
state: 'off'
|
||||
for:
|
||||
minutes: 5
|
||||
- condition: state
|
||||
entity_id: binary_sensor.front_room_occupied
|
||||
state: 'off'
|
||||
for:
|
||||
minutes: 5
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.home_occupied
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: input_boolean.front_room_occupied
|
||||
- conditions:
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.house
|
||||
state: 'Manual'
|
||||
sequence:
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: input_boolean.front_room_occupied
|
||||
@@ -0,0 +1,18 @@
|
||||
alias: 'Front Room Occupied'
|
||||
id: automation_front_room_occupied
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- binary_sensor.front_room_occupied
|
||||
to: 'on'
|
||||
condition:
|
||||
# Computer area was not already occupied
|
||||
- condition: state
|
||||
entity_id: input_boolean.front_room_occupied
|
||||
state: 'off'
|
||||
|
||||
action:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.front_room_occupied
|
||||
@@ -0,0 +1,24 @@
|
||||
alias: Front Room TV Paused
|
||||
id: automation_front_room_tv_paused
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: media_player.front_room_tv
|
||||
from: 'playing'
|
||||
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.lighting_automations
|
||||
state: 'on'
|
||||
|
||||
- condition: state
|
||||
entity_id: sun.sun
|
||||
state: 'below_horizon'
|
||||
|
||||
action:
|
||||
- service: input_select.select_option
|
||||
data_template:
|
||||
entity_id: input_select.front_room_mode
|
||||
option: "{{ states('input_text.front_room_mode') }}"
|
||||
|
||||
- service: automation.trigger
|
||||
entity_id: automation.front_room_lights_to_on
|
||||
@@ -0,0 +1,42 @@
|
||||
alias: Front Room TV Playing
|
||||
id: automation_front_room_tv_playing
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: media_player.front_room_tv
|
||||
to: 'playing'
|
||||
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.lighting_automations
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: light.front_room_hue
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: sun.sun
|
||||
state: 'below_horizon'
|
||||
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: media_player.front_room_tv
|
||||
attribute: 'source'
|
||||
state: 'PBS KIDS'
|
||||
- condition: state
|
||||
entity_id: media_player.front_room_tv
|
||||
attribute: 'source'
|
||||
state: 'YouTube'
|
||||
action:
|
||||
- service: input_text.set_value
|
||||
data_template:
|
||||
entity_id: input_text.front_room_mode
|
||||
value: "{{ states('input_select.front_room_mode') }}"
|
||||
|
||||
- service: input_select.select_option
|
||||
data:
|
||||
entity_id: input_select.front_room_mode
|
||||
option: Dimmed
|
||||
|
||||
- service: automation.trigger
|
||||
entity_id: automation.front_room_lights_to_on
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
alias: Front Room TV Standby
|
||||
id: automation_front_room_tv_standby
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: media_player.front_room_tv
|
||||
to: 'standby'
|
||||
for: '00:05:00'
|
||||
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.lighting_automations
|
||||
state: 'on'
|
||||
action:
|
||||
- service: input_select.select_option
|
||||
data_template:
|
||||
entity_id: input_select.front_room_mode
|
||||
option: "{{ states('input_text.front_room_mode') }}"
|
||||
|
||||
- service: automation.trigger
|
||||
entity_id: automation.front_room_lights_to_on
|
||||
@@ -0,0 +1,18 @@
|
||||
alias: Furnace Room Water Sensor On
|
||||
id: automation_front_room_water_sensor_on
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: binary_sensor.furnace_room_water_sensor_water_alarm_water_leak_detected
|
||||
to: "on"
|
||||
for: "00:00:10"
|
||||
|
||||
action:
|
||||
- service: tts.google_translate_say
|
||||
entity_id: media_player.front_room_hub, media_player.bathroom_mini, media_player.kitchen, media_player.master_bedroom_clock
|
||||
data:
|
||||
message: Attention! A water leak has been detected on the furnace room floor!
|
||||
|
||||
- service: notify.mobile_app_pixel_7
|
||||
data:
|
||||
message: Attention! A water leak has been detected on the furnace room floor!
|
||||
@@ -0,0 +1,48 @@
|
||||
alias: Furnace Room Lights
|
||||
id: automation_furnace_room_lights
|
||||
mode: queued
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
id: door_open
|
||||
entity_id: binary_sensor.furnace_room_door
|
||||
from: "off"
|
||||
to: "on"
|
||||
|
||||
- platform: state
|
||||
id: door_closed
|
||||
entity_id: binary_sensor.furnace_room_door
|
||||
to: "off"
|
||||
for: "00:10:00"
|
||||
|
||||
- platform: state
|
||||
id: motion_off
|
||||
entity_id: binary_sensor.furnace_room_motion_switch_home_security_motion_detection
|
||||
to: "off"
|
||||
for: "00:15:00"
|
||||
|
||||
action:
|
||||
- choose:
|
||||
# - conditions:
|
||||
# - condition: trigger
|
||||
# id: "door_open"
|
||||
# - condition: state
|
||||
# entity_id: light.furnace_room
|
||||
# state: 'off'
|
||||
# sequence:
|
||||
# - service: light.turn_on
|
||||
# target:
|
||||
# entity_id: light.furnace_room
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id: "door_closed"
|
||||
- condition: state
|
||||
entity_id: binary_sensor.furnace_room_motion_switch_home_security_motion_detection
|
||||
state: "off"
|
||||
- condition: state
|
||||
entity_id: light.furnace_room
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: light.turn_off
|
||||
target:
|
||||
entity_id: light.furnace_room
|
||||
@@ -0,0 +1,43 @@
|
||||
alias: Garage Lights to Off
|
||||
id: automation_garage_lights_to_off
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: input_boolean.garage_occupied
|
||||
to: 'off'
|
||||
|
||||
- platform: state
|
||||
entity_id:
|
||||
- binary_sensor.inner_garage_door
|
||||
- binary_sensor.outer_garage_door
|
||||
- binary_sensor.garage_door
|
||||
to: 'off'
|
||||
for: '00:10:00'
|
||||
|
||||
- platform: state
|
||||
entity_id: binary_sensor.garage_naturally_lit
|
||||
from: 'off'
|
||||
to: 'on'
|
||||
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.lighting_automations
|
||||
state: 'on'
|
||||
|
||||
- condition: state
|
||||
entity_id: light.garage_overhead
|
||||
state: 'on'
|
||||
|
||||
- condition: state
|
||||
entity_id:
|
||||
- binary_sensor.inner_garage_door
|
||||
- binary_sensor.outer_garage_door
|
||||
#- binary_sensor.garage_door
|
||||
- input_boolean.garage_occupied
|
||||
state: 'off'
|
||||
|
||||
action:
|
||||
- service: light.turn_off
|
||||
data:
|
||||
entity_id: light.garage_overhead
|
||||
@@ -0,0 +1,132 @@
|
||||
alias: Garage Lights to On
|
||||
id: automation_garage_lights_to_on
|
||||
mode: single
|
||||
# Hide warnings when triggered while in delay.
|
||||
max_exceeded: silent
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
id: "occupied"
|
||||
entity_id: input_boolean.garage_occupied
|
||||
to: "on"
|
||||
|
||||
- platform: state
|
||||
id: "too_dim"
|
||||
entity_id: binary_sensor.garage_naturally_lit
|
||||
from: "on"
|
||||
to: "off"
|
||||
|
||||
# - platform: state
|
||||
# id: "motion"
|
||||
# entity_id: group.garage_motion
|
||||
# from: "off"
|
||||
# to: "on"
|
||||
|
||||
- platform: state
|
||||
id: "garage_door_opened"
|
||||
entity_id: binary_sensor.garage_door
|
||||
from: "off"
|
||||
to: "on"
|
||||
|
||||
- platform: state
|
||||
id: "garage_door_closed"
|
||||
entity_id: binary_sensor.garage_door
|
||||
from: "on"
|
||||
to: "off"
|
||||
|
||||
- platform: state
|
||||
id: "doors_open"
|
||||
entity_id:
|
||||
- binary_sensor.inner_garage_door
|
||||
- binary_sensor.outer_garage_door
|
||||
from: "off"
|
||||
to: "on"
|
||||
|
||||
- platform: state
|
||||
id: "doors_closed"
|
||||
entity_id:
|
||||
- binary_sensor.inner_garage_door
|
||||
- binary_sensor.outer_garage_door
|
||||
from: "on"
|
||||
to: "off"
|
||||
|
||||
- platform: state
|
||||
id: "workshop_motion"
|
||||
entity_id: group.workshop_motion
|
||||
from: "off"
|
||||
to: "on"
|
||||
|
||||
# Only turn on the lights when necessary
|
||||
condition:
|
||||
- alias: Check if the lights should turn on
|
||||
condition: or
|
||||
conditions:
|
||||
- alias: "Garage door was opened"
|
||||
condition: trigger
|
||||
id: "garage_door_opened"
|
||||
|
||||
- alias: Check if the light should turn on when the home is occupied
|
||||
condition: and
|
||||
conditions:
|
||||
|
||||
- alias: "Home is occupied"
|
||||
condition: state
|
||||
entity_id: input_boolean.home_occupied
|
||||
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 in dark garage, or workshop regardless of light level"
|
||||
condition: or
|
||||
conditions:
|
||||
|
||||
- alias: "Motion or occupancy were detected in a dim room"
|
||||
condition: and
|
||||
conditions:
|
||||
|
||||
- alias: "Room not naturally lit"
|
||||
condition: state
|
||||
entity_id: binary_sensor.garage_naturally_lit
|
||||
state: 'off'
|
||||
|
||||
- alias: "Motion, occupancy, or door opening were detected"
|
||||
condition: or
|
||||
conditions:
|
||||
- alias: "Motion was detected"
|
||||
condition: trigger
|
||||
id: "motion"
|
||||
- alias: "Occupancy was detected"
|
||||
condition: trigger
|
||||
id: "occupied"
|
||||
- alias: "Occupancy was detected"
|
||||
condition: trigger
|
||||
id: "doors_open"
|
||||
|
||||
- condition: state
|
||||
entity_id: input_boolean.garage_occupied
|
||||
state: "on"
|
||||
|
||||
- alias: "Motion in the workshop"
|
||||
condition: and
|
||||
conditions:
|
||||
- condition: trigger
|
||||
id: "workshop_motion"
|
||||
|
||||
- condition: state
|
||||
entity_id: input_boolean.garage_occupied
|
||||
state: "on"
|
||||
|
||||
action:
|
||||
- alias: "Make sure Z-Wave switch is turned on"
|
||||
service: homeassistant.turn_on
|
||||
target:
|
||||
entity_id: switch.garage_switch
|
||||
|
||||
- delay: 1
|
||||
@@ -0,0 +1,78 @@
|
||||
alias: 'Garage Not Occupied'
|
||||
id: automation_garage_not_occupied
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- binary_sensor.garage_occupied
|
||||
- binary_sensor.walkway_person_occupancy
|
||||
- binary_sensor.workshop_person_occupancy
|
||||
to: 'off'
|
||||
for: '00:05:00'
|
||||
|
||||
condition:
|
||||
|
||||
- condition: state
|
||||
entity_id: input_boolean.lights_off_manually
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.garage_occupied
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.garage_occupied
|
||||
state: 'off'
|
||||
|
||||
action:
|
||||
- repeat:
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.garage_occupied
|
||||
state: 'off'
|
||||
for: '00:01:00'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.house
|
||||
state: 'Bachelor'
|
||||
- condition: state
|
||||
entity_id: input_boolean.kids_asleep
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: input_boolean.garage_occupied
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.garage_occupied
|
||||
state: 'off'
|
||||
for: '00:05:00'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.house
|
||||
state: 'Auto'
|
||||
- condition: state
|
||||
entity_id: input_select.house
|
||||
state: 'Dad'
|
||||
sequence:
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: input_boolean.garage_occupied
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.garage_naturally_lit
|
||||
state: 'on'
|
||||
for: '00:00:10'
|
||||
|
||||
sequence:
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: input_boolean.garage_occupied
|
||||
|
||||
- delay:
|
||||
minutes: 5
|
||||
|
||||
until:
|
||||
- condition: state
|
||||
entity_id: input_boolean.garage_occupied
|
||||
state: 'off'
|
||||
@@ -0,0 +1,17 @@
|
||||
alias: 'Garage Occupied'
|
||||
id: automation_garage_occupied
|
||||
mode: restart
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: binary_sensor.garage_occupied
|
||||
to: 'on'
|
||||
condition:
|
||||
# Computer area was not already occupied
|
||||
- condition: state
|
||||
entity_id: input_boolean.garage_occupied
|
||||
state: 'off'
|
||||
|
||||
action:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.garage_occupied
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
alias: 'Garage open nobody home'
|
||||
id: automation_garage_open_nobody_home
|
||||
initial_state: 'on'
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: binary_sensor.garage_open_nobody_home
|
||||
to: 'on'
|
||||
|
||||
condition:
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.home_occupied
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: cover.garage_door
|
||||
state: 'on'
|
||||
|
||||
action:
|
||||
- service: notify.mobile_app_pixel_7
|
||||
data:
|
||||
message: The garage is open, but nobody is home
|
||||
@@ -0,0 +1,405 @@
|
||||
alias: Great Room Light Cycle
|
||||
id: automation_great_room_light_cycle
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- id: light_cycle_on
|
||||
platform: state
|
||||
entity_id: input_boolean.great_room_light_cycle
|
||||
from: 'off'
|
||||
to: 'on'
|
||||
|
||||
- id: light_cycle_off
|
||||
platform: state
|
||||
entity_id: input_boolean.great_room_light_cycle
|
||||
from: 'on'
|
||||
to: 'off'
|
||||
|
||||
- id: projector_off
|
||||
platform: state
|
||||
entity_id: switch.shelly_projector
|
||||
from: 'on'
|
||||
to: 'off'
|
||||
|
||||
- id: projector_on
|
||||
platform: state
|
||||
entity_id: switch.shelly_projector
|
||||
from: 'off'
|
||||
to: 'on'
|
||||
|
||||
- id: setting_change
|
||||
platform: state
|
||||
entity_id:
|
||||
- input_number.great_room_light_cycle_transition
|
||||
- input_select.great_room_color_set
|
||||
- input_boolean.great_room_cycle_same
|
||||
|
||||
condition: "{{ is_state('input_boolean.great_room_light_cycle','on') }}"
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: switch.shelly_projector
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: light.turn_off
|
||||
target:
|
||||
entity_id: light.basement_2, light.basement_4
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.great_room_light_cycle
|
||||
state: 'on'
|
||||
sequence:
|
||||
|
||||
- repeat:
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions: # If all lights should be the same color and the projector is off, reference the Hue group for all the lights
|
||||
- condition: state
|
||||
entity_id: input_boolean.great_room_cycle_same
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: switch.shelly_projector
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.downstairs
|
||||
data:
|
||||
brightness: '{{ states("input_number.great_room_light_cycle_brightness") | int }}'
|
||||
transition: '{{ states("input_number.great_room_light_cycle_transition") | int }}'
|
||||
profile: >
|
||||
{% if states('input_select.great_room_color_set') == 'Basic' %}
|
||||
{% set colors = ['white','black','red','orange','yellow','green','blue','purple','pink','brown','gray'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Color Wheel' %}
|
||||
{% set colors = ['red','orange','amber','yellow','chartreuse','green','teal','blue','violet','purple','magenta'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Rainbow' %}
|
||||
{% set colors = ['red','orange','yellow','green','blue','indigo','violet'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Flourescent' %}
|
||||
{% set colors = ['radical_red','wild_watermelon','outrageous_orange','atomic_tangerine','neon_carrot','sunglow','laser_lemon','unmellow_yellow','electric_lime','screamin_green','magic_mint','blizzard_blue','shocking_pink','razzle_dazzle_rose','hot_magenta','purple_pizzazz'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Silver Swirl' %}
|
||||
{% set colors = ['aztec_gold','burnished_brown','cerulean_frost','cinnamon_satin','copper_penny','cosmic_cobalt','glossy_grape','granite_gray','green_sheen','lilac_luster','misty_moss','mystic_maroon','pearly_purple','pewter_blue','polished_pine','quick_silver','rose_dust','rusty_red','shadow_blue','shiny_shamrock','steel_teal','sugar_plum','twilight_lavender','wintergreen_dream'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Gem Tones' %}
|
||||
{% set colors = ['amethyst','citrine','emerald','jade','lapis_lazuli','malachite','rose_quartz','ruby','sapphire','smokey_topaz'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Reds' %}
|
||||
{% set colors = ['auburn','baby_pink','barn_red','burgundy','burnt_umber','cadmium_red','cardinal','chesnut','chili_red','congo_pink','coral_pink','desire','fire_engine_red','imperial_red','new_york_pink','paradise_pink','pastel_pink','pigment_red','rust','salmon_pink','tango_pink','turkey_red','vanilla_ice','wine'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Oranges' %}
|
||||
{% set colors = ['beaver','cadmium_orange','carrot_orange','champagne','chocolate','cocoa_brown','desert_sand','flame','gamboge','international_orange','kobicha','lion','marigold','orange_peel','persian_orange','persimmon','peru','portland_orange','pumpkin','russet','safety_orange','sandy_brown','tan','taupe','tawny','tea_rose','wood_brown'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Yellows' %}
|
||||
{% set colors = ['amber','beige','buff','citrine','cream','cyber_yellow','ecru','harvest_gold','jasmine','jonquil','khaki','lemon','mellow_yellow','mikado_yellow','mustard','naples_yellow','old_gold','process_yellow','royal_yellow','safety_yellow','saffron','school_bus_yellow','straw','vanilla'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Greens' %}
|
||||
{% set colors = ['army_green','artichoke','asparagus','avacado','bottle_green','bright_mint','celadon','emerald','fern_green','forest_green','harlequin','hunter_green','india_green','islamic_green','jade','kelly_green','laurel_green','malachite','mantis','mint_green','moss_green','neon_green','olive','pakistan_green','paris_green','rifle_green','russian_green','sea_green','shamrock_green','slytherin_green'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Cyans' %}
|
||||
{% set colors = ['aqua','aquamarine','brunswick_green','celadon_green','celeste','cerulean','charleston_green','dark_cyan','electric_blue','feldgrau','gray_green','midnight_green','morning_blue','myrtle_green','persian_green','robin_egg_blue','sky_blue','teal','teal_blue','turquoise','verdigris','viridian'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Blues' %}
|
||||
{% set colors = ['azure','baby_blue','blue_gray','capri','cornflower','egyptian_blue','glaucous','independence','indigo','indigo_dye','liberty','light_blue','midnight_blue','navy_blue','periwinkle','powder_blue','resolution_blue','sapphire','space_cadet','steel_blue','ultramarine'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Purples' %}
|
||||
{% set colors = ['byzantium','dark_purple','electric_indigo','eminence','heliotrope','indigo','indigo_dye','mardi_gras','mauve','medium_purple','orchid','pansy_purple','phlox','purpureus','thistle','tropical_indigo','tyrian_purple','royal_purple'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Magentas' %}
|
||||
{% set colors = ['amaranth','antique_fuchsia','baby_pink','cameo_pink','carnation_pink','charm_pink','china_pink','cotton_candy','dark_magenta','fandango','french_fuchsia','french_pink','fuchsia_rose','magenta_haze','mimi_pink','persian_pink','piggy_pink','pink','pink_lace','pink_lavender','plum','queen_pink','rose','rose_quartz','shocking_pink','silver_pink','sky_magenta','super_pink'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Grays' %}
|
||||
{% set colors = ['ash_gray','battleship_gray','cadet_gray','charcoal','dim_gray','gunmetal','jet','marengo','nickel','platinum','rocket_metallic','silver','slate_gray'] %}
|
||||
{% endif %}
|
||||
{{ colors|random }}
|
||||
|
||||
- conditions: # If all lights should be the same color and the projector is on, reference the specific lights that don't obscure the tv
|
||||
- condition: state
|
||||
entity_id: input_boolean.great_room_cycle_same
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: switch.shelly_projector
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.basement_1, light.basement_3, light.basement_5
|
||||
data:
|
||||
brightness: '{{ states("input_number.great_room_light_cycle_brightness") | int }}'
|
||||
transition: '{{ states("input_number.great_room_light_cycle_transition") | int }}'
|
||||
profile: >
|
||||
{% if states('input_select.great_room_color_set') == 'Basic' %}
|
||||
{% set colors = ['white','black','red','orange','yellow','green','blue','purple','pink','brown','gray'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Color Wheel' %}
|
||||
{% set colors = ['red','orange','amber','yellow','chartreuse','green','teal','blue','violet','purple','magenta'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Rainbow' %}
|
||||
{% set colors = ['red','orange','yellow','green','blue','indigo','violet'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Flourescent' %}
|
||||
{% set colors = ['radical_red','wild_watermelon','outrageous_orange','atomic_tangerine','neon_carrot','sunglow','laser_lemon','unmellow_yellow','electric_lime','screamin_green','magic_mint','blizzard_blue','shocking_pink','razzle_dazzle_rose','hot_magenta','purple_pizzazz'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Silver Swirl' %}
|
||||
{% set colors = ['aztec_gold','burnished_brown','cerulean_frost','cinnamon_satin','copper_penny','cosmic_cobalt','glossy_grape','granite_gray','green_sheen','lilac_luster','misty_moss','mystic_maroon','pearly_purple','pewter_blue','polished_pine','quick_silver','rose_dust','rusty_red','shadow_blue','shiny_shamrock','steel_teal','sugar_plum','twilight_lavender','wintergreen_dream'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Gem Tones' %}
|
||||
{% set colors = ['amethyst','citrine','emerald','jade','lapis_lazuli','malachite','rose_quartz','ruby','sapphire','smokey_topaz'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Reds' %}
|
||||
{% set colors = ['auburn','baby_pink','barn_red','burgundy','burnt_umber','cadmium_red','cardinal','chesnut','chili_red','congo_pink','coral_pink','desire','fire_engine_red','imperial_red','new_york_pink','paradise_pink','pastel_pink','pigment_red','rust','salmon_pink','tango_pink','turkey_red','vanilla_ice','wine'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Oranges' %}
|
||||
{% set colors = ['beaver','cadmium_orange','carrot_orange','champagne','chocolate','cocoa_brown','desert_sand','flame','gamboge','international_orange','kobicha','lion','marigold','orange_peel','persian_orange','persimmon','peru','portland_orange','pumpkin','russet','safety_orange','sandy_brown','tan','taupe','tawny','tea_rose','wood_brown'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Yellows' %}
|
||||
{% set colors = ['amber','beige','buff','citrine','cream','cyber_yellow','ecru','harvest_gold','jasmine','jonquil','khaki','lemon','mellow_yellow','mikado_yellow','mustard','naples_yellow','old_gold','process_yellow','royal_yellow','safety_yellow','saffron','school_bus_yellow','straw','vanilla'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Greens' %}
|
||||
{% set colors = ['army_green','artichoke','asparagus','avacado','bottle_green','bright_mint','celadon','emerald','fern_green','forest_green','harlequin','hunter_green','india_green','islamic_green','jade','kelly_green','laurel_green','malachite','mantis','mint_green','moss_green','neon_green','olive','pakistan_green','paris_green','rifle_green','russian_green','sea_green','shamrock_green','slytherin_green'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Cyans' %}
|
||||
{% set colors = ['aqua','aquamarine','brunswick_green','celadon_green','celeste','cerulean','charleston_green','dark_cyan','electric_blue','feldgrau','gray_green','midnight_green','morning_blue','myrtle_green','persian_green','robin_egg_blue','sky_blue','teal','teal_blue','turquoise','verdigris','viridian'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Blues' %}
|
||||
{% set colors = ['azure','baby_blue','blue_gray','capri','cornflower','egyptian_blue','glaucous','independence','indigo','indigo_dye','liberty','light_blue','midnight_blue','navy_blue','periwinkle','powder_blue','resolution_blue','sapphire','space_cadet','steel_blue','ultramarine'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Purples' %}
|
||||
{% set colors = ['byzantium','dark_purple','electric_indigo','eminence','heliotrope','indigo','indigo_dye','mardi_gras','mauve','medium_purple','orchid','pansy_purple','phlox','purpureus','thistle','tropical_indigo','tyrian_purple','royal_purple'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Magentas' %}
|
||||
{% set colors = ['amaranth','antique_fuchsia','baby_pink','cameo_pink','carnation_pink','charm_pink','china_pink','cotton_candy','dark_magenta','fandango','french_fuchsia','french_pink','fuchsia_rose','magenta_haze','mimi_pink','persian_pink','piggy_pink','pink','pink_lace','pink_lavender','plum','queen_pink','rose','rose_quartz','shocking_pink','silver_pink','sky_magenta','super_pink'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Grays' %}
|
||||
{% set colors = ['ash_gray','battleship_gray','cadet_gray','charcoal','dim_gray','gunmetal','jet','marengo','nickel','platinum','rocket_metallic','silver','slate_gray'] %}
|
||||
{% endif %}
|
||||
{{ colors|random }}
|
||||
|
||||
- conditions: # If all lights should be different colors, start referencing the individual lights that don't obscure the TV
|
||||
- condition: state
|
||||
entity_id: input_boolean.great_room_cycle_same
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.basement_1
|
||||
data:
|
||||
brightness: '{{ states("input_number.great_room_light_cycle_brightness") | int }}'
|
||||
transition: '{{ states("input_number.great_room_light_cycle_transition") | int }}'
|
||||
profile: >
|
||||
{% if states('input_select.great_room_color_set') == 'Basic' %}
|
||||
{% set colors = ['white','black','red','orange','yellow','green','blue','purple','pink','brown','gray'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Color Wheel' %}
|
||||
{% set colors = ['red','orange','amber','yellow','chartreuse','green','teal','blue','violet','purple','magenta'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Rainbow' %}
|
||||
{% set colors = ['red','orange','yellow','green','blue','indigo','violet'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Flourescent' %}
|
||||
{% set colors = ['radical_red','wild_watermelon','outrageous_orange','atomic_tangerine','neon_carrot','sunglow','laser_lemon','unmellow_yellow','electric_lime','screamin_green','magic_mint','blizzard_blue','shocking_pink','razzle_dazzle_rose','hot_magenta','purple_pizzazz'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Silver Swirl' %}
|
||||
{% set colors = ['aztec_gold','burnished_brown','cerulean_frost','cinnamon_satin','copper_penny','cosmic_cobalt','glossy_grape','granite_gray','green_sheen','lilac_luster','misty_moss','mystic_maroon','pearly_purple','pewter_blue','polished_pine','quick_silver','rose_dust','rusty_red','shadow_blue','shiny_shamrock','steel_teal','sugar_plum','twilight_lavender','wintergreen_dream'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Gem Tones' %}
|
||||
{% set colors = ['amethyst','citrine','emerald','jade','lapis_lazuli','malachite','rose_quartz','ruby','sapphire','smokey_topaz'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Reds' %}
|
||||
{% set colors = ['auburn','baby_pink','barn_red','burgundy','burnt_umber','cadmium_red','cardinal','chesnut','chili_red','congo_pink','coral_pink','desire','fire_engine_red','imperial_red','new_york_pink','paradise_pink','pastel_pink','pigment_red','rust','salmon_pink','tango_pink','turkey_red','vanilla_ice','wine'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Oranges' %}
|
||||
{% set colors = ['beaver','cadmium_orange','carrot_orange','champagne','chocolate','cocoa_brown','desert_sand','flame','gamboge','international_orange','kobicha','lion','marigold','orange_peel','persian_orange','persimmon','peru','portland_orange','pumpkin','russet','safety_orange','sandy_brown','tan','taupe','tawny','tea_rose','wood_brown'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Yellows' %}
|
||||
{% set colors = ['amber','beige','buff','citrine','cream','cyber_yellow','ecru','harvest_gold','jasmine','jonquil','khaki','lemon','mellow_yellow','mikado_yellow','mustard','naples_yellow','old_gold','process_yellow','royal_yellow','safety_yellow','saffron','school_bus_yellow','straw','vanilla'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Greens' %}
|
||||
{% set colors = ['army_green','artichoke','asparagus','avacado','bottle_green','bright_mint','celadon','emerald','fern_green','forest_green','harlequin','hunter_green','india_green','islamic_green','jade','kelly_green','laurel_green','malachite','mantis','mint_green','moss_green','neon_green','olive','pakistan_green','paris_green','rifle_green','russian_green','sea_green','shamrock_green','slytherin_green'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Cyans' %}
|
||||
{% set colors = ['aqua','aquamarine','brunswick_green','celadon_green','celeste','cerulean','charleston_green','dark_cyan','electric_blue','feldgrau','gray_green','midnight_green','morning_blue','myrtle_green','persian_green','robin_egg_blue','sky_blue','teal','teal_blue','turquoise','verdigris','viridian'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Blues' %}
|
||||
{% set colors = ['azure','baby_blue','blue_gray','capri','cornflower','egyptian_blue','glaucous','independence','indigo','indigo_dye','liberty','light_blue','midnight_blue','navy_blue','periwinkle','powder_blue','resolution_blue','sapphire','space_cadet','steel_blue','ultramarine'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Purples' %}
|
||||
{% set colors = ['byzantium','dark_purple','electric_indigo','eminence','heliotrope','indigo','indigo_dye','mardi_gras','mauve','medium_purple','orchid','pansy_purple','phlox','purpureus','thistle','tropical_indigo','tyrian_purple','royal_purple'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Magentas' %}
|
||||
{% set colors = ['amaranth','antique_fuchsia','baby_pink','cameo_pink','carnation_pink','charm_pink','china_pink','cotton_candy','dark_magenta','fandango','french_fuchsia','french_pink','fuchsia_rose','magenta_haze','mimi_pink','persian_pink','piggy_pink','pink','pink_lace','pink_lavender','plum','queen_pink','rose','rose_quartz','shocking_pink','silver_pink','sky_magenta','super_pink'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Grays' %}
|
||||
{% set colors = ['ash_gray','battleship_gray','cadet_gray','charcoal','dim_gray','gunmetal','jet','marengo','nickel','platinum','rocket_metallic','silver','slate_gray'] %}
|
||||
{% endif %}
|
||||
{{ colors|random }}
|
||||
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.basement_3
|
||||
data:
|
||||
brightness: '{{ states("input_number.great_room_light_cycle_brightness") | int }}'
|
||||
transition: '{{ states("input_number.great_room_light_cycle_transition") | int }}'
|
||||
profile: >
|
||||
{% if states('input_select.great_room_color_set') == 'Basic' %}
|
||||
{% set colors = ['white','black','red','orange','yellow','green','blue','purple','pink','brown','gray'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Color Wheel' %}
|
||||
{% set colors = ['red','orange','amber','yellow','chartreuse','green','teal','blue','violet','purple','magenta'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Rainbow' %}
|
||||
{% set colors = ['red','orange','yellow','green','blue','indigo','violet'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Flourescent' %}
|
||||
{% set colors = ['radical_red','wild_watermelon','outrageous_orange','atomic_tangerine','neon_carrot','sunglow','laser_lemon','unmellow_yellow','electric_lime','screamin_green','magic_mint','blizzard_blue','shocking_pink','razzle_dazzle_rose','hot_magenta','purple_pizzazz'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Silver Swirl' %}
|
||||
{% set colors = ['aztec_gold','burnished_brown','cerulean_frost','cinnamon_satin','copper_penny','cosmic_cobalt','glossy_grape','granite_gray','green_sheen','lilac_luster','misty_moss','mystic_maroon','pearly_purple','pewter_blue','polished_pine','quick_silver','rose_dust','rusty_red','shadow_blue','shiny_shamrock','steel_teal','sugar_plum','twilight_lavender','wintergreen_dream'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Gem Tones' %}
|
||||
{% set colors = ['amethyst','citrine','emerald','jade','lapis_lazuli','malachite','rose_quartz','ruby','sapphire','smokey_topaz'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Reds' %}
|
||||
{% set colors = ['auburn','baby_pink','barn_red','burgundy','burnt_umber','cadmium_red','cardinal','chesnut','chili_red','congo_pink','coral_pink','desire','fire_engine_red','imperial_red','new_york_pink','paradise_pink','pastel_pink','pigment_red','rust','salmon_pink','tango_pink','turkey_red','vanilla_ice','wine'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Oranges' %}
|
||||
{% set colors = ['beaver','cadmium_orange','carrot_orange','champagne','chocolate','cocoa_brown','desert_sand','flame','gamboge','international_orange','kobicha','lion','marigold','orange_peel','persian_orange','persimmon','peru','portland_orange','pumpkin','russet','safety_orange','sandy_brown','tan','taupe','tawny','tea_rose','wood_brown'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Yellows' %}
|
||||
{% set colors = ['amber','beige','buff','citrine','cream','cyber_yellow','ecru','harvest_gold','jasmine','jonquil','khaki','lemon','mellow_yellow','mikado_yellow','mustard','naples_yellow','old_gold','process_yellow','royal_yellow','safety_yellow','saffron','school_bus_yellow','straw','vanilla'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Greens' %}
|
||||
{% set colors = ['army_green','artichoke','asparagus','avacado','bottle_green','bright_mint','celadon','emerald','fern_green','forest_green','harlequin','hunter_green','india_green','islamic_green','jade','kelly_green','laurel_green','malachite','mantis','mint_green','moss_green','neon_green','olive','pakistan_green','paris_green','rifle_green','russian_green','sea_green','shamrock_green','slytherin_green'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Cyans' %}
|
||||
{% set colors = ['aqua','aquamarine','brunswick_green','celadon_green','celeste','cerulean','charleston_green','dark_cyan','electric_blue','feldgrau','gray_green','midnight_green','morning_blue','myrtle_green','persian_green','robin_egg_blue','sky_blue','teal','teal_blue','turquoise','verdigris','viridian'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Blues' %}
|
||||
{% set colors = ['azure','baby_blue','blue_gray','capri','cornflower','egyptian_blue','glaucous','independence','indigo','indigo_dye','liberty','light_blue','midnight_blue','navy_blue','periwinkle','powder_blue','resolution_blue','sapphire','space_cadet','steel_blue','ultramarine'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Purples' %}
|
||||
{% set colors = ['byzantium','dark_purple','electric_indigo','eminence','heliotrope','indigo','indigo_dye','mardi_gras','mauve','medium_purple','orchid','pansy_purple','phlox','purpureus','thistle','tropical_indigo','tyrian_purple','royal_purple'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Magentas' %}
|
||||
{% set colors = ['amaranth','antique_fuchsia','baby_pink','cameo_pink','carnation_pink','charm_pink','china_pink','cotton_candy','dark_magenta','fandango','french_fuchsia','french_pink','fuchsia_rose','magenta_haze','mimi_pink','persian_pink','piggy_pink','pink','pink_lace','pink_lavender','plum','queen_pink','rose','rose_quartz','shocking_pink','silver_pink','sky_magenta','super_pink'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Grays' %}
|
||||
{% set colors = ['ash_gray','battleship_gray','cadet_gray','charcoal','dim_gray','gunmetal','jet','marengo','nickel','platinum','rocket_metallic','silver','slate_gray'] %}
|
||||
{% endif %}
|
||||
{{ colors|random }}
|
||||
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.basement_5
|
||||
data:
|
||||
brightness: '{{ states("input_number.great_room_light_cycle_brightness") | int }}'
|
||||
transition: '{{ states("input_number.great_room_light_cycle_transition") | int }}'
|
||||
profile: >
|
||||
{% if states('input_select.great_room_color_set') == 'Basic' %}
|
||||
{% set colors = ['white','black','red','orange','yellow','green','blue','purple','pink','brown','gray'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Color Wheel' %}
|
||||
{% set colors = ['red','orange','amber','yellow','chartreuse','green','teal','blue','violet','purple','magenta'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Rainbow' %}
|
||||
{% set colors = ['red','orange','yellow','green','blue','indigo','violet'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Flourescent' %}
|
||||
{% set colors = ['radical_red','wild_watermelon','outrageous_orange','atomic_tangerine','neon_carrot','sunglow','laser_lemon','unmellow_yellow','electric_lime','screamin_green','magic_mint','blizzard_blue','shocking_pink','razzle_dazzle_rose','hot_magenta','purple_pizzazz'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Silver Swirl' %}
|
||||
{% set colors = ['aztec_gold','burnished_brown','cerulean_frost','cinnamon_satin','copper_penny','cosmic_cobalt','glossy_grape','granite_gray','green_sheen','lilac_luster','misty_moss','mystic_maroon','pearly_purple','pewter_blue','polished_pine','quick_silver','rose_dust','rusty_red','shadow_blue','shiny_shamrock','steel_teal','sugar_plum','twilight_lavender','wintergreen_dream'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Gem Tones' %}
|
||||
{% set colors = ['amethyst','citrine','emerald','jade','lapis_lazuli','malachite','rose_quartz','ruby','sapphire','smokey_topaz'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Reds' %}
|
||||
{% set colors = ['auburn','baby_pink','barn_red','burgundy','burnt_umber','cadmium_red','cardinal','chesnut','chili_red','congo_pink','coral_pink','desire','fire_engine_red','imperial_red','new_york_pink','paradise_pink','pastel_pink','pigment_red','rust','salmon_pink','tango_pink','turkey_red','vanilla_ice','wine'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Oranges' %}
|
||||
{% set colors = ['beaver','cadmium_orange','carrot_orange','champagne','chocolate','cocoa_brown','desert_sand','flame','gamboge','international_orange','kobicha','lion','marigold','orange_peel','persian_orange','persimmon','peru','portland_orange','pumpkin','russet','safety_orange','sandy_brown','tan','taupe','tawny','tea_rose','wood_brown'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Yellows' %}
|
||||
{% set colors = ['amber','beige','buff','citrine','cream','cyber_yellow','ecru','harvest_gold','jasmine','jonquil','khaki','lemon','mellow_yellow','mikado_yellow','mustard','naples_yellow','old_gold','process_yellow','royal_yellow','safety_yellow','saffron','school_bus_yellow','straw','vanilla'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Greens' %}
|
||||
{% set colors = ['army_green','artichoke','asparagus','avacado','bottle_green','bright_mint','celadon','emerald','fern_green','forest_green','harlequin','hunter_green','india_green','islamic_green','jade','kelly_green','laurel_green','malachite','mantis','mint_green','moss_green','neon_green','olive','pakistan_green','paris_green','rifle_green','russian_green','sea_green','shamrock_green','slytherin_green'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Cyans' %}
|
||||
{% set colors = ['aqua','aquamarine','brunswick_green','celadon_green','celeste','cerulean','charleston_green','dark_cyan','electric_blue','feldgrau','gray_green','midnight_green','morning_blue','myrtle_green','persian_green','robin_egg_blue','sky_blue','teal','teal_blue','turquoise','verdigris','viridian'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Blues' %}
|
||||
{% set colors = ['azure','baby_blue','blue_gray','capri','cornflower','egyptian_blue','glaucous','independence','indigo','indigo_dye','liberty','light_blue','midnight_blue','navy_blue','periwinkle','powder_blue','resolution_blue','sapphire','space_cadet','steel_blue','ultramarine'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Purples' %}
|
||||
{% set colors = ['byzantium','dark_purple','electric_indigo','eminence','heliotrope','indigo','indigo_dye','mardi_gras','mauve','medium_purple','orchid','pansy_purple','phlox','purpureus','thistle','tropical_indigo','tyrian_purple','royal_purple'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Magentas' %}
|
||||
{% set colors = ['amaranth','antique_fuchsia','baby_pink','cameo_pink','carnation_pink','charm_pink','china_pink','cotton_candy','dark_magenta','fandango','french_fuchsia','french_pink','fuchsia_rose','magenta_haze','mimi_pink','persian_pink','piggy_pink','pink','pink_lace','pink_lavender','plum','queen_pink','rose','rose_quartz','shocking_pink','silver_pink','sky_magenta','super_pink'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Grays' %}
|
||||
{% set colors = ['ash_gray','battleship_gray','cadet_gray','charcoal','dim_gray','gunmetal','jet','marengo','nickel','platinum','rocket_metallic','silver','slate_gray'] %}
|
||||
{% endif %}
|
||||
{{ colors|random }}
|
||||
|
||||
- choose: # If the projector is off, go ahead and reference all the lights
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: switch.shelly_projector
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
data_template:
|
||||
entity_id: light.basement_2
|
||||
brightness: '{{ states("input_number.great_room_light_cycle_brightness") | int }}'
|
||||
transition: '{{ states("input_number.great_room_light_cycle_transition") | int }}'
|
||||
profile: >
|
||||
{% if states('input_select.great_room_color_set') == 'Basic' %}
|
||||
{% set colors = ['white','black','red','orange','yellow','green','blue','purple','pink','brown','gray'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Color Wheel' %}
|
||||
{% set colors = ['red','orange','amber','yellow','chartreuse','green','teal','blue','violet','purple','magenta'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Rainbow' %}
|
||||
{% set colors = ['red','orange','yellow','green','blue','indigo','violet'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Flourescent' %}
|
||||
{% set colors = ['radical_red','wild_watermelon','outrageous_orange','atomic_tangerine','neon_carrot','sunglow','laser_lemon','unmellow_yellow','electric_lime','screamin_green','magic_mint','blizzard_blue','shocking_pink','razzle_dazzle_rose','hot_magenta','purple_pizzazz'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Silver Swirl' %}
|
||||
{% set colors = ['aztec_gold','burnished_brown','cerulean_frost','cinnamon_satin','copper_penny','cosmic_cobalt','glossy_grape','granite_gray','green_sheen','lilac_luster','misty_moss','mystic_maroon','pearly_purple','pewter_blue','polished_pine','quick_silver','rose_dust','rusty_red','shadow_blue','shiny_shamrock','steel_teal','sugar_plum','twilight_lavender','wintergreen_dream'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Gem Tones' %}
|
||||
{% set colors = ['amethyst','citrine','emerald','jade','lapis_lazuli','malachite','rose_quartz','ruby','sapphire','smokey_topaz'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Reds' %}
|
||||
{% set colors = ['auburn','baby_pink','barn_red','burgundy','burnt_umber','cadmium_red','cardinal','chesnut','chili_red','congo_pink','coral_pink','desire','fire_engine_red','imperial_red','new_york_pink','paradise_pink','pastel_pink','pigment_red','rust','salmon_pink','tango_pink','turkey_red','vanilla_ice','wine'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Oranges' %}
|
||||
{% set colors = ['beaver','cadmium_orange','carrot_orange','champagne','chocolate','cocoa_brown','desert_sand','flame','gamboge','international_orange','kobicha','lion','marigold','orange_peel','persian_orange','persimmon','peru','portland_orange','pumpkin','russet','safety_orange','sandy_brown','tan','taupe','tawny','tea_rose','wood_brown'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Yellows' %}
|
||||
{% set colors = ['amber','beige','buff','citrine','cream','cyber_yellow','ecru','harvest_gold','jasmine','jonquil','khaki','lemon','mellow_yellow','mikado_yellow','mustard','naples_yellow','old_gold','process_yellow','royal_yellow','safety_yellow','saffron','school_bus_yellow','straw','vanilla'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Greens' %}
|
||||
{% set colors = ['army_green','artichoke','asparagus','avacado','bottle_green','bright_mint','celadon','emerald','fern_green','forest_green','harlequin','hunter_green','india_green','islamic_green','jade','kelly_green','laurel_green','malachite','mantis','mint_green','moss_green','neon_green','olive','pakistan_green','paris_green','rifle_green','russian_green','sea_green','shamrock_green','slytherin_green'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Cyans' %}
|
||||
{% set colors = ['aqua','aquamarine','brunswick_green','celadon_green','celeste','cerulean','charleston_green','dark_cyan','electric_blue','feldgrau','gray_green','midnight_green','morning_blue','myrtle_green','persian_green','robin_egg_blue','sky_blue','teal','teal_blue','turquoise','verdigris','viridian'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Blues' %}
|
||||
{% set colors = ['azure','baby_blue','blue_gray','capri','cornflower','egyptian_blue','glaucous','independence','indigo','indigo_dye','liberty','light_blue','midnight_blue','navy_blue','periwinkle','powder_blue','resolution_blue','sapphire','space_cadet','steel_blue','ultramarine'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Purples' %}
|
||||
{% set colors = ['byzantium','dark_purple','electric_indigo','eminence','heliotrope','indigo','indigo_dye','mardi_gras','mauve','medium_purple','orchid','pansy_purple','phlox','purpureus','thistle','tropical_indigo','tyrian_purple','royal_purple'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Magentas' %}
|
||||
{% set colors = ['amaranth','antique_fuchsia','baby_pink','cameo_pink','carnation_pink','charm_pink','china_pink','cotton_candy','dark_magenta','fandango','french_fuchsia','french_pink','fuchsia_rose','magenta_haze','mimi_pink','persian_pink','piggy_pink','pink','pink_lace','pink_lavender','plum','queen_pink','rose','rose_quartz','shocking_pink','silver_pink','sky_magenta','super_pink'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Grays' %}
|
||||
{% set colors = ['ash_gray','battleship_gray','cadet_gray','charcoal','dim_gray','gunmetal','jet','marengo','nickel','platinum','rocket_metallic','silver','slate_gray'] %}
|
||||
{% endif %}
|
||||
{{ colors|random }}
|
||||
|
||||
- service: light.turn_on
|
||||
data_template:
|
||||
entity_id: light.basement_4
|
||||
brightness: '{{ states("input_number.great_room_light_cycle_brightness") | int }}'
|
||||
transition: '{{ states("input_number.great_room_light_cycle_transition") | int }}'
|
||||
profile: >
|
||||
{% if states('input_select.great_room_color_set') == 'Basic' %}
|
||||
{% set colors = ['white','black','red','orange','yellow','green','blue','purple','pink','brown','gray'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Color Wheel' %}
|
||||
{% set colors = ['red','orange','amber','yellow','chartreuse','green','teal','blue','violet','purple','magenta'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Rainbow' %}
|
||||
{% set colors = ['red','orange','yellow','green','blue','indigo','violet'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Flourescent' %}
|
||||
{% set colors = ['radical_red','wild_watermelon','outrageous_orange','atomic_tangerine','neon_carrot','sunglow','laser_lemon','unmellow_yellow','electric_lime','screamin_green','magic_mint','blizzard_blue','shocking_pink','razzle_dazzle_rose','hot_magenta','purple_pizzazz'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Silver Swirl' %}
|
||||
{% set colors = ['aztec_gold','burnished_brown','cerulean_frost','cinnamon_satin','copper_penny','cosmic_cobalt','glossy_grape','granite_gray','green_sheen','lilac_luster','misty_moss','mystic_maroon','pearly_purple','pewter_blue','polished_pine','quick_silver','rose_dust','rusty_red','shadow_blue','shiny_shamrock','steel_teal','sugar_plum','twilight_lavender','wintergreen_dream'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Gem Tones' %}
|
||||
{% set colors = ['amethyst','citrine','emerald','jade','lapis_lazuli','malachite','rose_quartz','ruby','sapphire','smokey_topaz'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Reds' %}
|
||||
{% set colors = ['auburn','baby_pink','barn_red','burgundy','burnt_umber','cadmium_red','cardinal','chesnut','chili_red','congo_pink','coral_pink','desire','fire_engine_red','imperial_red','new_york_pink','paradise_pink','pastel_pink','pigment_red','rust','salmon_pink','tango_pink','turkey_red','vanilla_ice','wine'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Oranges' %}
|
||||
{% set colors = ['beaver','cadmium_orange','carrot_orange','champagne','chocolate','cocoa_brown','desert_sand','flame','gamboge','international_orange','kobicha','lion','marigold','orange_peel','persian_orange','persimmon','peru','portland_orange','pumpkin','russet','safety_orange','sandy_brown','tan','taupe','tawny','tea_rose','wood_brown'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Yellows' %}
|
||||
{% set colors = ['amber','beige','buff','citrine','cream','cyber_yellow','ecru','harvest_gold','jasmine','jonquil','khaki','lemon','mellow_yellow','mikado_yellow','mustard','naples_yellow','old_gold','process_yellow','royal_yellow','safety_yellow','saffron','school_bus_yellow','straw','vanilla'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Greens' %}
|
||||
{% set colors = ['army_green','artichoke','asparagus','avacado','bottle_green','bright_mint','celadon','emerald','fern_green','forest_green','harlequin','hunter_green','india_green','islamic_green','jade','kelly_green','laurel_green','malachite','mantis','mint_green','moss_green','neon_green','olive','pakistan_green','paris_green','rifle_green','russian_green','sea_green','shamrock_green','slytherin_green'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Cyans' %}
|
||||
{% set colors = ['aqua','aquamarine','brunswick_green','celadon_green','celeste','cerulean','charleston_green','dark_cyan','electric_blue','feldgrau','gray_green','midnight_green','morning_blue','myrtle_green','persian_green','robin_egg_blue','sky_blue','teal','teal_blue','turquoise','verdigris','viridian'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Blues' %}
|
||||
{% set colors = ['azure','baby_blue','blue_gray','capri','cornflower','egyptian_blue','glaucous','independence','indigo','indigo_dye','liberty','light_blue','midnight_blue','navy_blue','periwinkle','powder_blue','resolution_blue','sapphire','space_cadet','steel_blue','ultramarine'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Purples' %}
|
||||
{% set colors = ['byzantium','dark_purple','electric_indigo','eminence','heliotrope','indigo','indigo_dye','mardi_gras','mauve','medium_purple','orchid','pansy_purple','phlox','purpureus','thistle','tropical_indigo','tyrian_purple','royal_purple'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Magentas' %}
|
||||
{% set colors = ['amaranth','antique_fuchsia','baby_pink','cameo_pink','carnation_pink','charm_pink','china_pink','cotton_candy','dark_magenta','fandango','french_fuchsia','french_pink','fuchsia_rose','magenta_haze','mimi_pink','persian_pink','piggy_pink','pink','pink_lace','pink_lavender','plum','queen_pink','rose','rose_quartz','shocking_pink','silver_pink','sky_magenta','super_pink'] %}
|
||||
{% elif states('input_select.great_room_color_set') == 'Grays' %}
|
||||
{% set colors = ['ash_gray','battleship_gray','cadet_gray','charcoal','dim_gray','gunmetal','jet','marengo','nickel','platinum','rocket_metallic','silver','slate_gray'] %}
|
||||
{% endif %}
|
||||
{{ colors|random }}
|
||||
|
||||
- delay:
|
||||
seconds: '{{ states("input_number.great_room_light_cycle_transition") | int }}'
|
||||
|
||||
until:
|
||||
- condition: state
|
||||
entity_id: input_boolean.great_room_light_cycle
|
||||
state: 'off'
|
||||
|
||||
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.great_room_occupied
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: automation.trigger
|
||||
entity_id: automation.great_room_lights_to_on
|
||||
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.great_room_occupied
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: automation.trigger
|
||||
entity_id: automation.great_room_lights_to_off
|
||||
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.computer_area_occupied
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: automation.trigger
|
||||
entity_id: automation.computer_area_lights_to_on
|
||||
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.computer_area_occupied
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: automation.trigger
|
||||
entity_id: automation.computer_area_lights_to_off
|
||||
@@ -0,0 +1,60 @@
|
||||
alias: Great Room Light Switch
|
||||
description: 'Handles button presses for the Great Room Motion Switch'
|
||||
id: automation.great_room_light_switch
|
||||
mode: single
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- switch.great_room_motion_switch
|
||||
from: "on"
|
||||
to: "off"
|
||||
id: turned_off
|
||||
- platform: state
|
||||
entity_id:
|
||||
- switch.great_room_motion_switch
|
||||
from: "off"
|
||||
to: "on"
|
||||
id: turned_on
|
||||
condition: []
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id: turned_off
|
||||
- condition: state
|
||||
entity_id: switch.great_room_motion_switch
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: input_select.select_option
|
||||
data:
|
||||
option: Manual
|
||||
target:
|
||||
entity_id: input_select.great_room_mode
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id: turned_on
|
||||
- condition: state
|
||||
entity_id: switch.great_room_motion_switch
|
||||
state: 'on'
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.great_room_mode
|
||||
state: Manual
|
||||
sequence:
|
||||
- service: input_select.select_option
|
||||
data:
|
||||
option: Auto
|
||||
target:
|
||||
entity_id: input_select.great_room_mode
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.great_room_mode
|
||||
state: Auto
|
||||
sequence:
|
||||
- service: input_select.select_option
|
||||
data:
|
||||
option: Bright
|
||||
target:
|
||||
entity_id: input_select.great_room_mode
|
||||
@@ -0,0 +1,79 @@
|
||||
alias: Great Room Lights to Off
|
||||
id: automation_great_room_lights_to_off
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: input_select.great_room_mode
|
||||
|
||||
- platform: state
|
||||
entity_id: input_boolean.great_room_occupied
|
||||
to: 'off'
|
||||
|
||||
- platform: state
|
||||
id: light_level
|
||||
entity_id: binary_sensor.great_room_naturally_lit
|
||||
from: 'off'
|
||||
to: 'on'
|
||||
|
||||
#- platform: time_pattern
|
||||
# minutes: "/5"
|
||||
|
||||
condition:
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.great_room_mode
|
||||
state: 'Off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.great_room_occupied
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.great_room_light_cycle
|
||||
state: 'off'
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.lighting_automations
|
||||
state: 'on'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.great_room_mode
|
||||
state: 'Off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.great_room_occupied
|
||||
state: 'off'
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.great_room_mode
|
||||
state: 'Manual'
|
||||
sequence:
|
||||
- service: scene.turn_on
|
||||
data:
|
||||
transition: 5
|
||||
target:
|
||||
entity_id: scene.great_room_hue_off
|
||||
# - service: light.turn_off
|
||||
# target:
|
||||
# entity_id: light.basement_2, light.basement_3, light.basement_4, light.basement_5
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: light.computer_area_hue
|
||||
state: 'off'
|
||||
- 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.great_room_motion_switch
|
||||
default:
|
||||
- service: light.turn_off
|
||||
target:
|
||||
entity_id: light.great_room_hue
|
||||
@@ -0,0 +1,164 @@
|
||||
alias: Great Room Lights to On
|
||||
id: automation_great_room_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.great_room_mode
|
||||
- input_select.automatic_light_profile
|
||||
|
||||
- platform: state
|
||||
id: light_level
|
||||
entity_id: binary_sensor.great_room_naturally_lit
|
||||
from: 'on'
|
||||
to: 'off'
|
||||
|
||||
- platform: state
|
||||
id: occupied
|
||||
entity_id:
|
||||
- binary_sensor.great_room_occupied
|
||||
- input_boolean.great_room_occupied
|
||||
to: "on"
|
||||
|
||||
# - platform: state
|
||||
# id: motion
|
||||
# entity_id: group.great_room_motion
|
||||
# to: "on"
|
||||
|
||||
condition:
|
||||
- alias: "Home is occupied"
|
||||
condition: state
|
||||
entity_id: input_boolean.home_occupied
|
||||
state: "on"
|
||||
|
||||
- alias: "Great Room Light Cycle is off"
|
||||
condition: state
|
||||
entity_id: input_boolean.great_room_light_cycle
|
||||
state: "off"
|
||||
|
||||
- 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.great_room_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.great_room_occupied
|
||||
state: "on"
|
||||
|
||||
variables:
|
||||
switch_name: switch.great_room_motion_switch
|
||||
light_name: great_room_hue
|
||||
mode_name: input_select.great_room_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.great_room_mode
|
||||
state: Manual
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.great_room_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.great_room_mode
|
||||
state: Auto
|
||||
- alias: "Lights are on"
|
||||
condition: state
|
||||
entity_id: light.great_room_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.great_room_mode
|
||||
state: Auto
|
||||
- alias: "Lights are off"
|
||||
condition: state
|
||||
entity_id: light.great_room_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 Great Room Mode scene with a transition"
|
||||
conditions:
|
||||
- alias: "Room not manual or auto and lights are on"
|
||||
condition: state
|
||||
entity_id: light.great_room_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 Great Room Mode scene without a transition"
|
||||
conditions:
|
||||
- alias: "Room not manual or auto and lights are off"
|
||||
condition: state
|
||||
entity_id: light.great_room_hue
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: scene.turn_on
|
||||
target:
|
||||
entity_id: "scene.{{light_name}}_{{states(mode_name).lower().replace(' ','_')}}"
|
||||
|
||||
- delay: 1
|
||||
@@ -0,0 +1,65 @@
|
||||
alias: 'Great Room Not Occupied'
|
||||
id: automation_great_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.great_room_occupied
|
||||
to: 'off'
|
||||
for: '00:15:00'
|
||||
|
||||
# - platform: time_pattern
|
||||
# minutes: "/5"
|
||||
|
||||
condition:
|
||||
|
||||
- condition: state
|
||||
entity_id: input_boolean.lights_off_manually
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.great_room_occupied
|
||||
state: 'on'
|
||||
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.home_occupied
|
||||
state: 'off'
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.great_room_person_occupancy
|
||||
state: 'off'
|
||||
for:
|
||||
minutes: 15
|
||||
- condition: state
|
||||
entity_id: binary_sensor.great_room_occupied
|
||||
state: 'off'
|
||||
for:
|
||||
minutes: 15
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.home_occupied
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: input_boolean.great_room_occupied
|
||||
- conditions:
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.house
|
||||
state: 'Manual'
|
||||
sequence:
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: input_boolean.great_room_occupied
|
||||
@@ -0,0 +1,18 @@
|
||||
alias: 'Great Room Occupied'
|
||||
id: automation_great_room_occupied
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- binary_sensor.great_room_occupied
|
||||
to: 'on'
|
||||
condition:
|
||||
# Computer area was not already occupied
|
||||
- condition: state
|
||||
entity_id: input_boolean.great_room_occupied
|
||||
state: 'off'
|
||||
|
||||
action:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.great_room_occupied
|
||||
@@ -0,0 +1,69 @@
|
||||
alias: Great Room Projector
|
||||
id: automation_great_room_projector
|
||||
mode: single
|
||||
trigger:
|
||||
- platform: state
|
||||
id: idle_five_min
|
||||
entity_id: media_player.downstairs_roku
|
||||
not_from: 'unavailable'
|
||||
to: 'idle'
|
||||
for: '00:05:00'
|
||||
- platform: state
|
||||
id: home_fifteen_min
|
||||
entity_id: media_player.downstairs_roku
|
||||
not_from: 'unavailable'
|
||||
to: 'home'
|
||||
for: '00:15:00'
|
||||
- platform: state
|
||||
id: playing_fifteen_min
|
||||
entity_id: media_player.downstairs_roku
|
||||
from: 'playing'
|
||||
for: '00:15:00'
|
||||
- platform: state
|
||||
id: from_idle
|
||||
entity_id: media_player.downstairs_roku
|
||||
from: 'idle'
|
||||
|
||||
condition:
|
||||
alias: "Roku not unavailable"
|
||||
condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: media_player.downstairs_roku
|
||||
state: unavailable
|
||||
|
||||
action:
|
||||
- choose:
|
||||
# The project turns on at seemingly random times.
|
||||
# commenting this out to see if that fixes the problem
|
||||
# - alias: "Roku no longer idle, turn on projector"
|
||||
# conditions:
|
||||
# - condition: trigger
|
||||
# id: from_idle
|
||||
# - condition: state
|
||||
# entity_id: switch.shelly_projector
|
||||
# state: 'off'
|
||||
# sequence:
|
||||
# - service: switch.turn_on
|
||||
# data:
|
||||
# entity_id: switch.shelly_projector
|
||||
- alias: "Roku idle or unused, turn off projector"
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: switch.shelly_projector
|
||||
state: 'on'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: trigger
|
||||
id: idle_five_min
|
||||
- condition: trigger
|
||||
id: home_fifteen_min
|
||||
sequence:
|
||||
- service: switch.turn_off
|
||||
target:
|
||||
entity_id: switch.shelly_projector
|
||||
- service: input_boolean.turn_off
|
||||
data: {}
|
||||
target:
|
||||
entity_id: input_boolean.great_room_light_cycle
|
||||
default: []
|
||||
@@ -0,0 +1,58 @@
|
||||
alias: Great Room TV Off
|
||||
id: automation_great_room_tv_off
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: media_player.downstairs_roku
|
||||
from: 'playing'
|
||||
to: 'idle'
|
||||
for: '00:00:30'
|
||||
- platform: state
|
||||
entity_id: media_player.downstairs_roku
|
||||
from: 'playing'
|
||||
to: 'on'
|
||||
for: '00:00:30'
|
||||
- platform: state
|
||||
entity_id: media_player.downstairs_roku
|
||||
from: 'playing'
|
||||
to: 'home'
|
||||
for: '00:00:30'
|
||||
- platform: state
|
||||
entity_id: media_player.downstairs_roku
|
||||
from: 'paused'
|
||||
to: 'idle'
|
||||
for: '00:00:30'
|
||||
- platform: state
|
||||
entity_id: media_player.downstairs_roku
|
||||
from: 'paused'
|
||||
to: 'home'
|
||||
for: '00:00:30'
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.lighting_automations
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.great_room_light_cycle
|
||||
state: 'on'
|
||||
action:
|
||||
- choose:
|
||||
- conditions: "{{is_state('input_boolean.great_room_light_cycle','on')}}"
|
||||
sequence:
|
||||
- service: input_boolean.turn_off
|
||||
data: {}
|
||||
target:
|
||||
entity_id: input_boolean.great_room_light_cycle
|
||||
|
||||
- choose:
|
||||
- conditions: "{{is_state('input_boolean.computer_area_light_cycle','on')}}"
|
||||
sequence:
|
||||
- service: input_boolean.turn_off
|
||||
data: {}
|
||||
target:
|
||||
entity_id: input_boolean.computer_area_light_cycle
|
||||
|
||||
# - service: input_select.select_option
|
||||
# target:
|
||||
# entity_id: input_select.nursery_mode
|
||||
# data:
|
||||
# option: "Nightlight"
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
alias: Great Room TV Paused
|
||||
id: automation_great_room_tv_paused
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: media_player.downstairs_roku
|
||||
from: 'playing'
|
||||
to: 'idle'
|
||||
- platform: state
|
||||
entity_id: media_player.downstairs_roku
|
||||
from: 'playing'
|
||||
to: 'home'
|
||||
- platform: state
|
||||
entity_id: media_player.downstairs_roku
|
||||
from: 'paused'
|
||||
to: 'idle'
|
||||
- platform: state
|
||||
entity_id: media_player.downstairs_roku
|
||||
from: 'paused'
|
||||
to: 'home'
|
||||
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.lighting_automations
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.great_room_light_cycle
|
||||
state: 'on'
|
||||
action:
|
||||
- service: input_number.set_value
|
||||
data:
|
||||
value: 30
|
||||
target:
|
||||
entity_id: input_number.great_room_light_cycle_brightness
|
||||
@@ -0,0 +1,117 @@
|
||||
alias: Great Room TV Playing
|
||||
id: automation_great_room_tv_playing
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: media_player.downstairs_roku
|
||||
to: 'playing'
|
||||
|
||||
- platform: state
|
||||
entity_id: input_select.time_of_day
|
||||
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
|
||||
- platform: event
|
||||
event_type: automation_reloaded
|
||||
|
||||
condition:
|
||||
- alias: Something besides YouTube is playing
|
||||
condition: and
|
||||
conditions:
|
||||
- condition: not
|
||||
conditions:
|
||||
- alias: "The kids aren't watching YouTube"
|
||||
condition: state
|
||||
entity_id: media_player.downstairs_roku
|
||||
attribute: source
|
||||
state: 'YouTube'
|
||||
- condition: state
|
||||
entity_id: media_player.downstairs_roku
|
||||
state: 'playing'
|
||||
- condition: state
|
||||
entity_id: input_boolean.lighting_automations
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: light.great_room_hue
|
||||
state: 'on'
|
||||
- alias: It is later in the day/evening
|
||||
condition: template
|
||||
value_template: "{{ is_state('binary_sensor.early_evening','on') or is_state('binary_sensor.evening','on') or is_state('binary_sensor.late_evening','on') or is_state('binary_sensor.night','on') or is_state('binary_sensor.early_morning','on') or is_state('binary_sensor.late_afternoon','on')}}"
|
||||
|
||||
- condition: or
|
||||
conditions:
|
||||
- alias: "Kids home and awake"
|
||||
condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.kids_away
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.kids_asleep
|
||||
state: 'off'
|
||||
- alias: "Kids home and asleep"
|
||||
condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.kids_away
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.kids_asleep
|
||||
state: 'on'
|
||||
- alias: "Kids away"
|
||||
condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.kids_away
|
||||
state: 'on'
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.time_of_day
|
||||
state: 'Late Afternoon'
|
||||
sequence:
|
||||
- service: input_number.set_value
|
||||
data:
|
||||
value: 100
|
||||
target:
|
||||
entity_id: input_number.great_room_light_cycle_brightness
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.time_of_day
|
||||
state: 'Early Evening'
|
||||
sequence:
|
||||
- service: input_number.set_value
|
||||
data:
|
||||
value: 75
|
||||
target:
|
||||
entity_id: input_number.great_room_light_cycle_brightness
|
||||
default:
|
||||
- service: input_number.set_value
|
||||
data:
|
||||
value: 55
|
||||
target:
|
||||
entity_id: input_number.great_room_light_cycle_brightness
|
||||
- service: input_number.set_value
|
||||
data:
|
||||
value: 30
|
||||
target:
|
||||
entity_id: input_number.great_room_light_cycle_transition
|
||||
- service: input_select.select_option
|
||||
data:
|
||||
option: Silver Swirl
|
||||
target:
|
||||
entity_id: input_select.great_room_color_set
|
||||
- service: input_boolean.turn_off
|
||||
data: {}
|
||||
target:
|
||||
entity_id: input_boolean.great_room_cycle_same
|
||||
- service: input_boolean.turn_on
|
||||
data: {}
|
||||
target:
|
||||
entity_id: input_boolean.great_room_light_cycle
|
||||
|
||||
#b 15
|
||||
#t 30
|
||||
#Silver Swirl
|
||||
#
|
||||
@@ -0,0 +1,82 @@
|
||||
alias: Kitchen Lights to Off
|
||||
id: automation_kitchen_lights_to_off
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: input_select.kitchen_mode
|
||||
|
||||
- platform: state
|
||||
entity_id: input_boolean.kitchen_occupied
|
||||
to: 'off'
|
||||
|
||||
- platform: state
|
||||
id: light_level
|
||||
entity_id: binary_sensor.kitchen_naturally_lit
|
||||
from: 'off'
|
||||
to: 'on'
|
||||
|
||||
#- platform: time_pattern
|
||||
# minutes: "/5"
|
||||
|
||||
condition:
|
||||
|
||||
- condition: state
|
||||
entity_id: input_boolean.lights_off_manually
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.lighting_automations
|
||||
state: 'on'
|
||||
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.kitchen_mode
|
||||
state: 'Off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.kitchen_occupied
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.kitchen_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.kitchen_mode
|
||||
state: 'Off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.kitchen_occupied
|
||||
state: 'off'
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.kitchen_mode
|
||||
state: 'Manual'
|
||||
- "{{ states('sensor.bar_light_level') | float(default=0) >= states('input_number.kitchen_light_level_trigger') | float(default=0) }}"
|
||||
sequence:
|
||||
- service: scene.turn_on
|
||||
data:
|
||||
transition: 5
|
||||
target:
|
||||
entity_id: scene.kitchen_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.kitchen_switch
|
||||
@@ -0,0 +1,159 @@
|
||||
alias: Kitchen Lights to On
|
||||
id: automation_kitchen_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.kitchen_mode
|
||||
- input_select.automatic_light_profile
|
||||
|
||||
- platform: state
|
||||
id: light_level
|
||||
entity_id: binary_sensor.kitchen_naturally_lit
|
||||
from: 'on'
|
||||
to: 'off'
|
||||
|
||||
- platform: state
|
||||
id: occupied
|
||||
entity_id:
|
||||
- binary_sensor.kitchen_occupied
|
||||
- input_boolean.kitchen_occupied
|
||||
to: "on"
|
||||
|
||||
# - platform: state
|
||||
# id: motion
|
||||
# entity_id: group.kitchen_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: "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.kitchen_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.kitchen_occupied
|
||||
state: "on"
|
||||
|
||||
variables:
|
||||
switch_name: switch.kitchen_switch
|
||||
light_name: kitchen_hue
|
||||
mode_name: input_select.kitchen_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.kitchen_mode
|
||||
state: Manual
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.kitchen_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.kitchen_mode
|
||||
state: Auto
|
||||
- alias: "Lights are on"
|
||||
condition: state
|
||||
entity_id: light.kitchen_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.kitchen_mode
|
||||
state: Auto
|
||||
- alias: "Lights are off"
|
||||
condition: state
|
||||
entity_id: light.kitchen_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 Kitchen Mode scene with a transition"
|
||||
conditions:
|
||||
- alias: "Room not manual or auto and lights are on"
|
||||
condition: state
|
||||
entity_id: light.kitchen_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 Kitchen Mode scene without a transition"
|
||||
conditions:
|
||||
- alias: "Room not manual or auto and lights are off"
|
||||
condition: state
|
||||
entity_id: light.kitchen_hue
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: scene.turn_on
|
||||
target:
|
||||
entity_id: "scene.{{light_name}}_{{states(mode_name).lower().replace(' ','_')}}"
|
||||
|
||||
- delay: 1
|
||||
@@ -0,0 +1,61 @@
|
||||
alias: 'Kitchen Not Occupied'
|
||||
id: automation_kitchen_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.kitchen_occupied
|
||||
to: 'off'
|
||||
for: '00:05:00'
|
||||
|
||||
# - platform: time_pattern
|
||||
# minutes: "/5"
|
||||
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.kitchen_occupied
|
||||
state: 'on'
|
||||
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.home_occupied
|
||||
state: 'off'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.kitchen_person_occupancy
|
||||
state: 'off'
|
||||
for:
|
||||
minutes: 5
|
||||
- condition: state
|
||||
entity_id: binary_sensor.kitchen_occupied
|
||||
state: 'off'
|
||||
for:
|
||||
minutes: 5
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.home_occupied
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: input_boolean.kitchen_occupied
|
||||
- conditions:
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.house
|
||||
state: 'Manual'
|
||||
sequence:
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: input_boolean.kitchen_occupied
|
||||
@@ -0,0 +1,19 @@
|
||||
alias: 'Kitchen Occupied'
|
||||
id: automation_kitchen_occupied
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- binary_sensor.kitchen_occupied
|
||||
to: 'on'
|
||||
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.kitchen_occupied
|
||||
state: 'off'
|
||||
|
||||
action:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.kitchen_occupied
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
alias: Mancave Lights
|
||||
id: automation_mancave_lights
|
||||
mode: queued
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
id: door_open
|
||||
entity_id: binary_sensor.mancave_door_contact
|
||||
from: "off"
|
||||
to: "on"
|
||||
|
||||
- platform: state
|
||||
id: door_closed
|
||||
entity_id: binary_sensor.mancave_door_contact
|
||||
from: "on"
|
||||
to: "off"
|
||||
for: "00:10:00"
|
||||
|
||||
- platform: state
|
||||
id: motion_off
|
||||
entity_id: binary_sensor.mancave_motion_switch_home_security_motion_detection
|
||||
to: "off"
|
||||
for: "00:15:00"
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id: "door_open"
|
||||
- condition: state
|
||||
entity_id: light.mancave
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.mancave
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id: "door_closed"
|
||||
- condition: state
|
||||
entity_id: binary_sensor.mancave_motion_switch_home_security_motion_detection
|
||||
state: "off"
|
||||
- condition: state
|
||||
entity_id: light.mancave
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: light.turn_off
|
||||
target:
|
||||
entity_id: light.mancave
|
||||
@@ -0,0 +1,66 @@
|
||||
alias: Master Bathroom Lights to Off
|
||||
id: automation_master_bathrom_lights_to_off
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: input_select.master_bathroom_mode
|
||||
|
||||
- platform: state
|
||||
entity_id: input_boolean.master_bathroom_occupied
|
||||
to: "off"
|
||||
|
||||
#- platform: time_pattern
|
||||
# minutes: "/5"
|
||||
|
||||
condition:
|
||||
|
||||
- condition: state
|
||||
entity_id: input_boolean.lights_off_manually
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: light.master_bathroom_hue
|
||||
state: "on"
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.master_bathroom_mode
|
||||
state: "Off"
|
||||
- condition: state
|
||||
entity_id: input_boolean.master_bathroom_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.master_bathroom_mode
|
||||
state: 'Off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.master_bathroom_occupied
|
||||
state: 'off'
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.master_bathroom_mode
|
||||
state: "Manual"
|
||||
sequence:
|
||||
- service: scene.turn_on
|
||||
data:
|
||||
transition: 5
|
||||
target:
|
||||
entity_id: scene.master_bathroom_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.master_bathroom_motion_switch, switch.shower_switch
|
||||
@@ -0,0 +1,116 @@
|
||||
alias: Master Bathroom Lights to On
|
||||
id: automation_master_bathroom_lights_to_on
|
||||
mode: single
|
||||
# Hide warnings when triggered while in delay.
|
||||
max_exceeded: silent
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- input_select.master_bathroom_mode
|
||||
- input_select.automatic_light_profile
|
||||
- platform: state
|
||||
entity_id: input_boolean.master_bathroom_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.master_bathroom_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.master_bathroom_mode' }}"
|
||||
- condition: template
|
||||
value_template: "{{ trigger.entity_id == 'input_select.automatic_light_profile' }}"
|
||||
- condition: state
|
||||
entity_id: input_boolean.master_bathroom_occupied
|
||||
state: "on"
|
||||
|
||||
variables:
|
||||
switch_name: switch.master_bathroom_motion_switch
|
||||
light_name: master_bathroom_hue
|
||||
mode_name: input_select.master_bathroom_mode
|
||||
|
||||
action:
|
||||
- alias: "Make sure Z-Wave switch is turned on"
|
||||
service: homeassistant.turn_on
|
||||
target:
|
||||
entity_id:
|
||||
- switch.master_bathroom_motion_switch
|
||||
- switch.shower_switch
|
||||
- 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.master_bathroom_mode
|
||||
state: Manual
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.master_bathroom_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.master_bathroom_mode
|
||||
state: Auto
|
||||
- alias: "Lights are on"
|
||||
condition: state
|
||||
entity_id: light.master_bathroom_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.master_bathroom_mode
|
||||
state: Auto
|
||||
- alias: "Lights are off"
|
||||
condition: state
|
||||
entity_id: light.master_bathroom_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 Master Bathroom Mode scene with a transition"
|
||||
conditions:
|
||||
- alias: "Room not manual or auto and lights are on"
|
||||
condition: state
|
||||
entity_id: light.master_bathroom_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 Master Bathroom Mode scene without a transition"
|
||||
conditions:
|
||||
- alias: "Room not manual or auto and lights are off"
|
||||
condition: state
|
||||
entity_id: light.master_bathroom_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: 'Master Bathroom Not Occupied'
|
||||
id: automation_master_bathroom_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.master_bathroom_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.master_bathroom_occupied
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.master_bathroom_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.master_bathroom_occupied
|
||||
- conditions:
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.house
|
||||
state: 'Manual'
|
||||
sequence:
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: input_boolean.master_bathroom_occupied
|
||||
@@ -0,0 +1,18 @@
|
||||
alias: Master Bathroom Occupied
|
||||
id: automation_master_bathroom_occupied
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- binary_sensor.master_bathroom_occupied
|
||||
to: 'on'
|
||||
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.master_bathroom_occupied
|
||||
state: 'off'
|
||||
|
||||
action:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.master_bathroom_occupied
|
||||
@@ -0,0 +1,35 @@
|
||||
alias: Continue White Noise
|
||||
id: automation_continue_white_noise
|
||||
initial_state: "on"
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: media_player.master_bedroom_clock
|
||||
to: "off"
|
||||
for: "00:00:02"
|
||||
- platform: state
|
||||
entity_id: media_player.master_bedroom_clock
|
||||
to: "idle"
|
||||
for: "00:00:02"
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.master_bedroom_asleep
|
||||
state: 'on'
|
||||
|
||||
action:
|
||||
#- service: input_select.select_option
|
||||
# data:
|
||||
# entity_id: input_select.master_bedroom_mode
|
||||
# option: 'Off'
|
||||
- service: input_select.select_option
|
||||
data:
|
||||
entity_id: input_select.google_home
|
||||
option: 'Master Bedroom'
|
||||
- service: input_select.select_option
|
||||
data:
|
||||
entity_id: input_select.ambient_sound
|
||||
option: 'Thunderstorm'
|
||||
- service: input_number.set_value
|
||||
data:
|
||||
entity_id: input_number.volume_ambientsounds
|
||||
value: '0.3'
|
||||
- service: script.ambientsounds
|
||||
@@ -0,0 +1,55 @@
|
||||
alias: Master Bedroom Asleep
|
||||
id: automation_master_bedroom_asleep
|
||||
initial_state: 'off'
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: sensor.pixel_7_charger_type
|
||||
to: "wireless"
|
||||
|
||||
- platform: state
|
||||
entity_id: binary_sensor.master_bedroom_person_occupancy
|
||||
to: 'on'
|
||||
for: '00:00:30'
|
||||
|
||||
- platform: state
|
||||
entity_id: binary_sensor.master_bed_occupied
|
||||
to: 'on'
|
||||
for: '00:00:05'
|
||||
|
||||
condition:
|
||||
- alias: "Adult Home"
|
||||
condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.kristy_home
|
||||
state: 'on'
|
||||
|
||||
- alias: "After 10:00PM and before 4:00AM"
|
||||
condition: time
|
||||
after: '21:00:00'
|
||||
before: '04:00:00'
|
||||
|
||||
- alias: "Clint's phone charging or someone on master bed"
|
||||
condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: sensor.pixel_7_charger_type
|
||||
state: 'wireless'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.master_bed_occupied
|
||||
state: 'on'
|
||||
|
||||
|
||||
- alias: "The room is currently awake"
|
||||
condition: state
|
||||
entity_id: input_boolean.master_bedroom_asleep
|
||||
state: 'off'
|
||||
|
||||
action:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.master_bedroom_asleep
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
alias: Master Bedroom Awake
|
||||
id: automation_master_bedroom_awake
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: binary_sensor.master_bed_occupied
|
||||
to: 'off'
|
||||
for: '00:10:00'
|
||||
|
||||
condition:
|
||||
- alias: "Adult Home"
|
||||
condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.kristy_home
|
||||
state: 'on'
|
||||
|
||||
- alias: "Before 10:00PM and after 4:00AM"
|
||||
condition: time
|
||||
before: '21:00:00'
|
||||
after: '04:00:00'
|
||||
|
||||
- alias: "No one on master bed"
|
||||
condition: state
|
||||
entity_id: binary_sensor.master_bed_occupied
|
||||
state: 'off'
|
||||
|
||||
- alias: "The boolean is currently on"
|
||||
condition: state
|
||||
entity_id: input_boolean.master_bedroom_asleep
|
||||
state: 'on'
|
||||
|
||||
action:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.master_bedroom_asleep
|
||||
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.master_bedroom_mode
|
||||
state: 'Manual'
|
||||
sequence:
|
||||
- service: input_select.select_option
|
||||
data:
|
||||
option: Auto
|
||||
target:
|
||||
entity_id: input_select.master_bedroom_mode
|
||||
@@ -0,0 +1,198 @@
|
||||
alias: Master Bedroom Dimmer LEDs
|
||||
id: automation_master_bedroom_dimmer_leds
|
||||
mode: single
|
||||
# Hide warnings when triggered while in delay.
|
||||
max_exceeded: silent
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: light.master_bedroom_hue
|
||||
attribute: brightness
|
||||
|
||||
- platform: state
|
||||
entity_id: light.master_bedroom_hue
|
||||
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- alias: "Light off"
|
||||
condition: state
|
||||
entity_id: light.master_bedroom_hue
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '19'
|
||||
value: '3'
|
||||
target:
|
||||
device_id: 201b960a4203135c454f9acb3f035021
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '21'
|
||||
value: '3'
|
||||
target:
|
||||
device_id: 201b960a4203135c454f9acb3f035021
|
||||
|
||||
- conditions:
|
||||
- alias: "Light brightness below 78"
|
||||
condition: numeric_state
|
||||
entity_id: light.master_bedroom_hue
|
||||
attribute: brightness
|
||||
below: 78
|
||||
sequence:
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '19'
|
||||
value: '3'
|
||||
target:
|
||||
device_id: 201b960a4203135c454f9acb3f035021
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '21'
|
||||
value: '3'
|
||||
target:
|
||||
device_id: 201b960a4203135c454f9acb3f035021
|
||||
|
||||
- conditions:
|
||||
- alias: "Light brightness below 104"
|
||||
condition: numeric_state
|
||||
entity_id: light.master_bedroom_hue
|
||||
attribute: brightness
|
||||
below: 104
|
||||
sequence:
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '19'
|
||||
value: '4'
|
||||
target:
|
||||
device_id: 201b960a4203135c454f9acb3f035021
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '21'
|
||||
value: '4'
|
||||
target:
|
||||
device_id: 201b960a4203135c454f9acb3f035021
|
||||
|
||||
- conditions:
|
||||
- alias: "Light brightness below 130"
|
||||
condition: numeric_state
|
||||
entity_id: light.master_bedroom_hue
|
||||
attribute: brightness
|
||||
below: 130
|
||||
sequence:
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '19'
|
||||
value: '5'
|
||||
target:
|
||||
device_id: 201b960a4203135c454f9acb3f035021
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '21'
|
||||
value: '5'
|
||||
target:
|
||||
device_id: 201b960a4203135c454f9acb3f035021
|
||||
|
||||
- conditions:
|
||||
- alias: "Light brightness below 156"
|
||||
condition: numeric_state
|
||||
entity_id: light.master_bedroom_hue
|
||||
attribute: brightness
|
||||
below: 156
|
||||
sequence:
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '19'
|
||||
value: '6'
|
||||
target:
|
||||
device_id: 201b960a4203135c454f9acb3f035021
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '21'
|
||||
value: '6'
|
||||
target:
|
||||
device_id: 201b960a4203135c454f9acb3f035021
|
||||
|
||||
- conditions:
|
||||
- alias: "Light brightness below 182"
|
||||
condition: numeric_state
|
||||
entity_id: light.master_bedroom_hue
|
||||
attribute: brightness
|
||||
below: 182
|
||||
sequence:
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '19'
|
||||
value: '7'
|
||||
target:
|
||||
device_id: 201b960a4203135c454f9acb3f035021
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '21'
|
||||
value: '7'
|
||||
target:
|
||||
device_id: 201b960a4203135c454f9acb3f035021
|
||||
|
||||
- conditions:
|
||||
- alias: "Light brightness below 208"
|
||||
condition: numeric_state
|
||||
entity_id: light.master_bedroom_hue
|
||||
attribute: brightness
|
||||
below: 208
|
||||
sequence:
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '19'
|
||||
value: '8'
|
||||
target:
|
||||
device_id: 201b960a4203135c454f9acb3f035021
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '21'
|
||||
value: '8'
|
||||
target:
|
||||
device_id: 201b960a4203135c454f9acb3f035021
|
||||
|
||||
- conditions:
|
||||
- alias: "Light brightness below 234"
|
||||
condition: numeric_state
|
||||
entity_id: light.master_bedroom_hue
|
||||
attribute: brightness
|
||||
below: 234
|
||||
sequence:
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '19'
|
||||
value: '9'
|
||||
target:
|
||||
device_id: 201b960a4203135c454f9acb3f035021
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '21'
|
||||
value: '9'
|
||||
target:
|
||||
device_id: 201b960a4203135c454f9acb3f035021
|
||||
|
||||
default:
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '19'
|
||||
value: '10'
|
||||
target:
|
||||
device_id: 201b960a4203135c454f9acb3f035021
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '21'
|
||||
value: '10'
|
||||
target:
|
||||
device_id: 201b960a4203135c454f9acb3f035021
|
||||
|
||||
|
||||
- delay:
|
||||
hours: 0
|
||||
minutes: 0
|
||||
seconds: 1
|
||||
milliseconds: 0
|
||||
@@ -0,0 +1,59 @@
|
||||
alias: Master Bedroom Humidifier
|
||||
id: automation_master_bedroom_humidifier
|
||||
|
||||
trigger:
|
||||
- platform: numeric_state
|
||||
id: low_humidity
|
||||
entity_id: sensor.master_bedroom_multisensor_humidity
|
||||
below: input_number.master_bedroom_humidifier_on
|
||||
|
||||
- platform: numeric_state
|
||||
id: high_humidity
|
||||
entity_id: sensor.master_bedroom_multisensor_humidity
|
||||
above: input_number.master_bedroom_humidifier_off
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- alias: "Humidity too high via trigger"
|
||||
conditions:
|
||||
- condition: trigger
|
||||
id: high_humidity
|
||||
sequence:
|
||||
- service: fan.turn_off
|
||||
target:
|
||||
entity_id: fan.master_bedroom
|
||||
|
||||
- alias: "Humidity too high via manual run"
|
||||
conditions:
|
||||
- condition: numeric_state
|
||||
entity_id: sensor.master_bedroom_multisensor_humidity
|
||||
above: input_number.master_bedroom_humidifier_off
|
||||
sequence:
|
||||
- service: fan.turn_off
|
||||
target:
|
||||
entity_id: fan.master_bedroom
|
||||
|
||||
- alias: "Humidity too low via trigger"
|
||||
conditions:
|
||||
- condition: trigger
|
||||
id: low_humidity
|
||||
sequence:
|
||||
|
||||
- service: fan.turn_on
|
||||
data:
|
||||
percentage: 33
|
||||
target:
|
||||
entity_id: fan.master_bedroom
|
||||
|
||||
- alias: "Humidity too low via manual run"
|
||||
conditions:
|
||||
- condition: numeric_state
|
||||
entity_id: sensor.master_bedroom_multisensor_humidity
|
||||
below: input_number.master_bedroom_humidifier_on
|
||||
sequence:
|
||||
|
||||
- service: fan.turn_on
|
||||
data:
|
||||
percentage: 33
|
||||
target:
|
||||
entity_id: fan.master_bedroom
|
||||
@@ -0,0 +1,209 @@
|
||||
alias: Master Bedroom Light Cycle
|
||||
id: automation_master_bedroom_light_cycle
|
||||
trigger:
|
||||
- id: light_cycle_on
|
||||
platform: state
|
||||
entity_id: input_boolean.master_bedroom_light_cycle
|
||||
from: 'off'
|
||||
to: 'on'
|
||||
|
||||
- id: setting_change
|
||||
platform: state
|
||||
entity_id:
|
||||
- input_number.master_bedroom_light_cycle_transition
|
||||
- input_select.master_bedroom_color_set
|
||||
- input_boolean.master_bedroom_cycle_same
|
||||
|
||||
condition: "{{ is_state('input_boolean.master_bedroom_light_cycle','on') }}"
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.master_bedroom_light_cycle
|
||||
state: 'on'
|
||||
sequence:
|
||||
|
||||
- repeat:
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions: # If all lights should be the same color and the projector is off, reference the Hue group for all the lights
|
||||
- condition: state
|
||||
entity_id: input_boolean.master_bedroom_cycle_same
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.master_bedroom_ceiling_hue
|
||||
data:
|
||||
brightness: '{{ states("input_number.master_bedroom_light_cycle_brightness") | int }}'
|
||||
transition: '{{ states("input_number.master_bedroom_light_cycle_transition") | int }}'
|
||||
profile: >
|
||||
{% if states('input_select.master_bedroom_color_set') == 'Basic' %}
|
||||
{% set colors = ['white','black','red','orange','yellow','green','blue','purple','pink','brown','gray'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Color Wheel' %}
|
||||
{% set colors = ['red','orange','amber','yellow','chartreuse','green','teal','blue','violet','purple','magenta'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Rainbow' %}
|
||||
{% set colors = ['red','orange','yellow','green','blue','indigo','violet'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Flourescent' %}
|
||||
{% set colors = ['radical_red','wild_watermelon','outrageous_orange','atomic_tangerine','neon_carrot','sunglow','laser_lemon','unmellow_yellow','electric_lime','screamin_green','magic_mint','blizzard_blue','shocking_pink','razzle_dazzle_rose','hot_magenta','purple_pizzazz'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Silver Swirl' %}
|
||||
{% set colors = ['aztec_gold','burnished_brown','cerulean_frost','cinnamon_satin','copper_penny','cosmic_cobalt','glossy_grape','granite_gray','green_sheen','lilac_luster','misty_moss','mystic_maroon','pearly_purple','pewter_blue','polished_pine','quick_silver','rose_dust','rusty_red','shadow_blue','shiny_shamrock','steel_teal','sugar_plum','twilight_lavender','wintergreen_dream'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Gem Tones' %}
|
||||
{% set colors = ['amethyst','citrine','emerald','jade','lapis_lazuli','malachite','rose_quartz','ruby','sapphire','smokey_topaz'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Reds' %}
|
||||
{% set colors = ['auburn','baby_pink','barn_red','burgundy','burnt_umber','cadmium_red','cardinal','chesnut','chili_red','congo_pink','coral_pink','desire','fire_engine_red','imperial_red','new_york_pink','paradise_pink','pastel_pink','pigment_red','rust','salmon_pink','tango_pink','turkey_red','vanilla_ice','wine'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Oranges' %}
|
||||
{% set colors = ['beaver','cadmium_orange','carrot_orange','champagne','chocolate','cocoa_brown','desert_sand','flame','gamboge','international_orange','kobicha','lion','marigold','orange_peel','persian_orange','persimmon','peru','portland_orange','pumpkin','russet','safety_orange','sandy_brown','tan','taupe','tawny','tea_rose','wood_brown'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Yellows' %}
|
||||
{% set colors = ['amber','beige','buff','citrine','cream','cyber_yellow','ecru','harvest_gold','jasmine','jonquil','khaki','lemon','mellow_yellow','mikado_yellow','mustard','naples_yellow','old_gold','process_yellow','royal_yellow','safety_yellow','saffron','school_bus_yellow','straw','vanilla'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Greens' %}
|
||||
{% set colors = ['army_green','artichoke','asparagus','avacado','bottle_green','bright_mint','celadon','emerald','fern_green','forest_green','harlequin','hunter_green','india_green','islamic_green','jade','kelly_green','laurel_green','malachite','mantis','mint_green','moss_green','neon_green','olive','pakistan_green','paris_green','rifle_green','russian_green','sea_green','shamrock_green','slytherin_green'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Cyans' %}
|
||||
{% set colors = ['aqua','aquamarine','brunswick_green','celadon_green','celeste','cerulean','charleston_green','dark_cyan','electric_blue','feldgrau','gray_green','midnight_green','morning_blue','myrtle_green','persian_green','robin_egg_blue','sky_blue','teal','teal_blue','turquoise','verdigris','viridian'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Blues' %}
|
||||
{% set colors = ['azure','baby_blue','blue_gray','capri','cornflower','egyptian_blue','glaucous','independence','indigo','indigo_dye','liberty','light_blue','midnight_blue','navy_blue','periwinkle','powder_blue','resolution_blue','sapphire','space_cadet','steel_blue','ultramarine'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Purples' %}
|
||||
{% set colors = ['byzantium','dark_purple','electric_indigo','eminence','heliotrope','indigo','indigo_dye','mardi_gras','mauve','medium_purple','orchid','pansy_purple','phlox','purpureus','thistle','tropical_indigo','tyrian_purple','royal_purple'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Magentas' %}
|
||||
{% set colors = ['amaranth','antique_fuchsia','baby_pink','cameo_pink','carnation_pink','charm_pink','china_pink','cotton_candy','dark_magenta','fandango','french_fuchsia','french_pink','fuchsia_rose','magenta_haze','mimi_pink','persian_pink','piggy_pink','pink','pink_lace','pink_lavender','plum','queen_pink','rose','rose_quartz','shocking_pink','silver_pink','sky_magenta','super_pink'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Grays' %}
|
||||
{% set colors = ['ash_gray','battleship_gray','cadet_gray','charcoal','dim_gray','gunmetal','jet','marengo','nickel','platinum','rocket_metallic','silver','slate_gray'] %}
|
||||
{% endif %}
|
||||
{{ colors|random }}
|
||||
|
||||
- conditions: # If all lights should be different colors, start referencing the individual lights that don't obscure the TV
|
||||
- condition: state
|
||||
entity_id: input_boolean.master_bedroom_cycle_same
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.master_bedroom_1
|
||||
data:
|
||||
brightness: '{{ states("input_number.master_bedroom_light_cycle_brightness") | int }}'
|
||||
transition: '{{ states("input_number.master_bedroom_light_cycle_transition") | int }}'
|
||||
profile: >
|
||||
{% if states('input_select.master_bedroom_color_set') == 'Basic' %}
|
||||
{% set colors = ['white','black','red','orange','yellow','green','blue','purple','pink','brown','gray'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Color Wheel' %}
|
||||
{% set colors = ['red','orange','amber','yellow','chartreuse','green','teal','blue','violet','purple','magenta'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Rainbow' %}
|
||||
{% set colors = ['red','orange','yellow','green','blue','indigo','violet'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Flourescent' %}
|
||||
{% set colors = ['radical_red','wild_watermelon','outrageous_orange','atomic_tangerine','neon_carrot','sunglow','laser_lemon','unmellow_yellow','electric_lime','screamin_green','magic_mint','blizzard_blue','shocking_pink','razzle_dazzle_rose','hot_magenta','purple_pizzazz'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Silver Swirl' %}
|
||||
{% set colors = ['aztec_gold','burnished_brown','cerulean_frost','cinnamon_satin','copper_penny','cosmic_cobalt','glossy_grape','granite_gray','green_sheen','lilac_luster','misty_moss','mystic_maroon','pearly_purple','pewter_blue','polished_pine','quick_silver','rose_dust','rusty_red','shadow_blue','shiny_shamrock','steel_teal','sugar_plum','twilight_lavender','wintergreen_dream'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Gem Tones' %}
|
||||
{% set colors = ['amethyst','citrine','emerald','jade','lapis_lazuli','malachite','rose_quartz','ruby','sapphire','smokey_topaz'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Reds' %}
|
||||
{% set colors = ['auburn','baby_pink','barn_red','burgundy','burnt_umber','cadmium_red','cardinal','chesnut','chili_red','congo_pink','coral_pink','desire','fire_engine_red','imperial_red','new_york_pink','paradise_pink','pastel_pink','pigment_red','rust','salmon_pink','tango_pink','turkey_red','vanilla_ice','wine'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Oranges' %}
|
||||
{% set colors = ['beaver','cadmium_orange','carrot_orange','champagne','chocolate','cocoa_brown','desert_sand','flame','gamboge','international_orange','kobicha','lion','marigold','orange_peel','persian_orange','persimmon','peru','portland_orange','pumpkin','russet','safety_orange','sandy_brown','tan','taupe','tawny','tea_rose','wood_brown'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Yellows' %}
|
||||
{% set colors = ['amber','beige','buff','citrine','cream','cyber_yellow','ecru','harvest_gold','jasmine','jonquil','khaki','lemon','mellow_yellow','mikado_yellow','mustard','naples_yellow','old_gold','process_yellow','royal_yellow','safety_yellow','saffron','school_bus_yellow','straw','vanilla'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Greens' %}
|
||||
{% set colors = ['army_green','artichoke','asparagus','avacado','bottle_green','bright_mint','celadon','emerald','fern_green','forest_green','harlequin','hunter_green','india_green','islamic_green','jade','kelly_green','laurel_green','malachite','mantis','mint_green','moss_green','neon_green','olive','pakistan_green','paris_green','rifle_green','russian_green','sea_green','shamrock_green','slytherin_green'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Cyans' %}
|
||||
{% set colors = ['aqua','aquamarine','brunswick_green','celadon_green','celeste','cerulean','charleston_green','dark_cyan','electric_blue','feldgrau','gray_green','midnight_green','morning_blue','myrtle_green','persian_green','robin_egg_blue','sky_blue','teal','teal_blue','turquoise','verdigris','viridian'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Blues' %}
|
||||
{% set colors = ['azure','baby_blue','blue_gray','capri','cornflower','egyptian_blue','glaucous','independence','indigo','indigo_dye','liberty','light_blue','midnight_blue','navy_blue','periwinkle','powder_blue','resolution_blue','sapphire','space_cadet','steel_blue','ultramarine'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Purples' %}
|
||||
{% set colors = ['byzantium','dark_purple','electric_indigo','eminence','heliotrope','indigo','indigo_dye','mardi_gras','mauve','medium_purple','orchid','pansy_purple','phlox','purpureus','thistle','tropical_indigo','tyrian_purple','royal_purple'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Magentas' %}
|
||||
{% set colors = ['amaranth','antique_fuchsia','baby_pink','cameo_pink','carnation_pink','charm_pink','china_pink','cotton_candy','dark_magenta','fandango','french_fuchsia','french_pink','fuchsia_rose','magenta_haze','mimi_pink','persian_pink','piggy_pink','pink','pink_lace','pink_lavender','plum','queen_pink','rose','rose_quartz','shocking_pink','silver_pink','sky_magenta','super_pink'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Grays' %}
|
||||
{% set colors = ['ash_gray','battleship_gray','cadet_gray','charcoal','dim_gray','gunmetal','jet','marengo','nickel','platinum','rocket_metallic','silver','slate_gray'] %}
|
||||
{% endif %}
|
||||
{{ colors|random }}
|
||||
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.master_bedroom_2
|
||||
data:
|
||||
brightness: '{{ states("input_number.master_bedroom_light_cycle_brightness") | int }}'
|
||||
transition: '{{ states("input_number.master_bedroom_light_cycle_transition") | int }}'
|
||||
profile: >
|
||||
{% if states('input_select.master_bedroom_color_set') == 'Basic' %}
|
||||
{% set colors = ['white','black','red','orange','yellow','green','blue','purple','pink','brown','gray'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Color Wheel' %}
|
||||
{% set colors = ['red','orange','amber','yellow','chartreuse','green','teal','blue','violet','purple','magenta'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Rainbow' %}
|
||||
{% set colors = ['red','orange','yellow','green','blue','indigo','violet'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Flourescent' %}
|
||||
{% set colors = ['radical_red','wild_watermelon','outrageous_orange','atomic_tangerine','neon_carrot','sunglow','laser_lemon','unmellow_yellow','electric_lime','screamin_green','magic_mint','blizzard_blue','shocking_pink','razzle_dazzle_rose','hot_magenta','purple_pizzazz'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Silver Swirl' %}
|
||||
{% set colors = ['aztec_gold','burnished_brown','cerulean_frost','cinnamon_satin','copper_penny','cosmic_cobalt','glossy_grape','granite_gray','green_sheen','lilac_luster','misty_moss','mystic_maroon','pearly_purple','pewter_blue','polished_pine','quick_silver','rose_dust','rusty_red','shadow_blue','shiny_shamrock','steel_teal','sugar_plum','twilight_lavender','wintergreen_dream'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Gem Tones' %}
|
||||
{% set colors = ['amethyst','citrine','emerald','jade','lapis_lazuli','malachite','rose_quartz','ruby','sapphire','smokey_topaz'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Reds' %}
|
||||
{% set colors = ['auburn','baby_pink','barn_red','burgundy','burnt_umber','cadmium_red','cardinal','chesnut','chili_red','congo_pink','coral_pink','desire','fire_engine_red','imperial_red','new_york_pink','paradise_pink','pastel_pink','pigment_red','rust','salmon_pink','tango_pink','turkey_red','vanilla_ice','wine'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Oranges' %}
|
||||
{% set colors = ['beaver','cadmium_orange','carrot_orange','champagne','chocolate','cocoa_brown','desert_sand','flame','gamboge','international_orange','kobicha','lion','marigold','orange_peel','persian_orange','persimmon','peru','portland_orange','pumpkin','russet','safety_orange','sandy_brown','tan','taupe','tawny','tea_rose','wood_brown'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Yellows' %}
|
||||
{% set colors = ['amber','beige','buff','citrine','cream','cyber_yellow','ecru','harvest_gold','jasmine','jonquil','khaki','lemon','mellow_yellow','mikado_yellow','mustard','naples_yellow','old_gold','process_yellow','royal_yellow','safety_yellow','saffron','school_bus_yellow','straw','vanilla'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Greens' %}
|
||||
{% set colors = ['army_green','artichoke','asparagus','avacado','bottle_green','bright_mint','celadon','emerald','fern_green','forest_green','harlequin','hunter_green','india_green','islamic_green','jade','kelly_green','laurel_green','malachite','mantis','mint_green','moss_green','neon_green','olive','pakistan_green','paris_green','rifle_green','russian_green','sea_green','shamrock_green','slytherin_green'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Cyans' %}
|
||||
{% set colors = ['aqua','aquamarine','brunswick_green','celadon_green','celeste','cerulean','charleston_green','dark_cyan','electric_blue','feldgrau','gray_green','midnight_green','morning_blue','myrtle_green','persian_green','robin_egg_blue','sky_blue','teal','teal_blue','turquoise','verdigris','viridian'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Blues' %}
|
||||
{% set colors = ['azure','baby_blue','blue_gray','capri','cornflower','egyptian_blue','glaucous','independence','indigo','indigo_dye','liberty','light_blue','midnight_blue','navy_blue','periwinkle','powder_blue','resolution_blue','sapphire','space_cadet','steel_blue','ultramarine'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Purples' %}
|
||||
{% set colors = ['byzantium','dark_purple','electric_indigo','eminence','heliotrope','indigo','indigo_dye','mardi_gras','mauve','medium_purple','orchid','pansy_purple','phlox','purpureus','thistle','tropical_indigo','tyrian_purple','royal_purple'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Magentas' %}
|
||||
{% set colors = ['amaranth','antique_fuchsia','baby_pink','cameo_pink','carnation_pink','charm_pink','china_pink','cotton_candy','dark_magenta','fandango','french_fuchsia','french_pink','fuchsia_rose','magenta_haze','mimi_pink','persian_pink','piggy_pink','pink','pink_lace','pink_lavender','plum','queen_pink','rose','rose_quartz','shocking_pink','silver_pink','sky_magenta','super_pink'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Grays' %}
|
||||
{% set colors = ['ash_gray','battleship_gray','cadet_gray','charcoal','dim_gray','gunmetal','jet','marengo','nickel','platinum','rocket_metallic','silver','slate_gray'] %}
|
||||
{% endif %}
|
||||
{{ colors|random }}
|
||||
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.master_bedroom_3
|
||||
data:
|
||||
brightness: '{{ states("input_number.master_bedroom_light_cycle_brightness") | int }}'
|
||||
transition: '{{ states("input_number.master_bedroom_light_cycle_transition") | int }}'
|
||||
profile: >
|
||||
{% if states('input_select.master_bedroom_color_set') == 'Basic' %}
|
||||
{% set colors = ['white','black','red','orange','yellow','green','blue','purple','pink','brown','gray'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Color Wheel' %}
|
||||
{% set colors = ['red','orange','amber','yellow','chartreuse','green','teal','blue','violet','purple','magenta'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Rainbow' %}
|
||||
{% set colors = ['red','orange','yellow','green','blue','indigo','violet'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Flourescent' %}
|
||||
{% set colors = ['radical_red','wild_watermelon','outrageous_orange','atomic_tangerine','neon_carrot','sunglow','laser_lemon','unmellow_yellow','electric_lime','screamin_green','magic_mint','blizzard_blue','shocking_pink','razzle_dazzle_rose','hot_magenta','purple_pizzazz'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Silver Swirl' %}
|
||||
{% set colors = ['aztec_gold','burnished_brown','cerulean_frost','cinnamon_satin','copper_penny','cosmic_cobalt','glossy_grape','granite_gray','green_sheen','lilac_luster','misty_moss','mystic_maroon','pearly_purple','pewter_blue','polished_pine','quick_silver','rose_dust','rusty_red','shadow_blue','shiny_shamrock','steel_teal','sugar_plum','twilight_lavender','wintergreen_dream'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Gem Tones' %}
|
||||
{% set colors = ['amethyst','citrine','emerald','jade','lapis_lazuli','malachite','rose_quartz','ruby','sapphire','smokey_topaz'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Reds' %}
|
||||
{% set colors = ['auburn','baby_pink','barn_red','burgundy','burnt_umber','cadmium_red','cardinal','chesnut','chili_red','congo_pink','coral_pink','desire','fire_engine_red','imperial_red','new_york_pink','paradise_pink','pastel_pink','pigment_red','rust','salmon_pink','tango_pink','turkey_red','vanilla_ice','wine'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Oranges' %}
|
||||
{% set colors = ['beaver','cadmium_orange','carrot_orange','champagne','chocolate','cocoa_brown','desert_sand','flame','gamboge','international_orange','kobicha','lion','marigold','orange_peel','persian_orange','persimmon','peru','portland_orange','pumpkin','russet','safety_orange','sandy_brown','tan','taupe','tawny','tea_rose','wood_brown'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Yellows' %}
|
||||
{% set colors = ['amber','beige','buff','citrine','cream','cyber_yellow','ecru','harvest_gold','jasmine','jonquil','khaki','lemon','mellow_yellow','mikado_yellow','mustard','naples_yellow','old_gold','process_yellow','royal_yellow','safety_yellow','saffron','school_bus_yellow','straw','vanilla'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Greens' %}
|
||||
{% set colors = ['army_green','artichoke','asparagus','avacado','bottle_green','bright_mint','celadon','emerald','fern_green','forest_green','harlequin','hunter_green','india_green','islamic_green','jade','kelly_green','laurel_green','malachite','mantis','mint_green','moss_green','neon_green','olive','pakistan_green','paris_green','rifle_green','russian_green','sea_green','shamrock_green','slytherin_green'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Cyans' %}
|
||||
{% set colors = ['aqua','aquamarine','brunswick_green','celadon_green','celeste','cerulean','charleston_green','dark_cyan','electric_blue','feldgrau','gray_green','midnight_green','morning_blue','myrtle_green','persian_green','robin_egg_blue','sky_blue','teal','teal_blue','turquoise','verdigris','viridian'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Blues' %}
|
||||
{% set colors = ['azure','baby_blue','blue_gray','capri','cornflower','egyptian_blue','glaucous','independence','indigo','indigo_dye','liberty','light_blue','midnight_blue','navy_blue','periwinkle','powder_blue','resolution_blue','sapphire','space_cadet','steel_blue','ultramarine'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Purples' %}
|
||||
{% set colors = ['byzantium','dark_purple','electric_indigo','eminence','heliotrope','indigo','indigo_dye','mardi_gras','mauve','medium_purple','orchid','pansy_purple','phlox','purpureus','thistle','tropical_indigo','tyrian_purple','royal_purple'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Magentas' %}
|
||||
{% set colors = ['amaranth','antique_fuchsia','baby_pink','cameo_pink','carnation_pink','charm_pink','china_pink','cotton_candy','dark_magenta','fandango','french_fuchsia','french_pink','fuchsia_rose','magenta_haze','mimi_pink','persian_pink','piggy_pink','pink','pink_lace','pink_lavender','plum','queen_pink','rose','rose_quartz','shocking_pink','silver_pink','sky_magenta','super_pink'] %}
|
||||
{% elif states('input_select.master_bedroom_color_set') == 'Grays' %}
|
||||
{% set colors = ['ash_gray','battleship_gray','cadet_gray','charcoal','dim_gray','gunmetal','jet','marengo','nickel','platinum','rocket_metallic','silver','slate_gray'] %}
|
||||
{% endif %}
|
||||
{{ colors|random }}
|
||||
|
||||
- delay:
|
||||
seconds: '{{ states("input_number.master_bedroom_light_cycle_transition") | int }}'
|
||||
|
||||
until:
|
||||
- condition: state
|
||||
entity_id: input_boolean.master_bedroom_light_cycle
|
||||
state: 'off'
|
||||
|
||||
- service: automation.trigger
|
||||
entity_id: automation.master_bedroom_lights_to_on
|
||||
@@ -0,0 +1,92 @@
|
||||
alias: Master Bedroom Lights to Off
|
||||
id: automation_master_bedroom_lights_to_off
|
||||
mode: single
|
||||
# Hide warnings when triggered while in delay.
|
||||
max_exceeded: silent
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: input_select.master_bedroom_mode
|
||||
|
||||
- platform: state
|
||||
entity_id: input_boolean.master_bedroom_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: light.master_bedroom_hue
|
||||
state: 'on'
|
||||
|
||||
|
||||
- alias: "Master Bedroom light cycle not on"
|
||||
condition: state
|
||||
entity_id: input_boolean.master_bedroom_light_cycle
|
||||
state: "off"
|
||||
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: light.master_bedroom_1
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: light.master_bedroom_2
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: light.master_bedroom_3
|
||||
state: 'on'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.master_bedroom_mode
|
||||
state: 'Off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.master_bedroom_occupied
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_select.master_bedroom_mode
|
||||
state: 'Nightlight'
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.lighting_automations
|
||||
state: 'on'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.master_bedroom_mode
|
||||
state: 'Off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.master_bedroom_occupied
|
||||
state: 'off'
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.master_bedroom_mode
|
||||
state: 'Manual'
|
||||
sequence:
|
||||
- service: scene.turn_on
|
||||
data:
|
||||
transition: 5
|
||||
target:
|
||||
entity_id: scene.master_bedroom_hue_off
|
||||
default:
|
||||
- service: light.turn_off
|
||||
target:
|
||||
entity_id:
|
||||
- light.master_bedroom_1
|
||||
- light.master_bedroom_2
|
||||
- light.master_bedroom_3
|
||||
- light.accent
|
||||
- light.master_bedroom_accent
|
||||
|
||||
@@ -0,0 +1,197 @@
|
||||
alias: Master Bedroom Lights to On
|
||||
id: automation_master_bedroom_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.master_bedroom_mode
|
||||
- input_select.automatic_light_profile
|
||||
|
||||
- platform: state
|
||||
id: light_level
|
||||
entity_id: binary_sensor.master_bedroom_naturally_lit
|
||||
from: 'on'
|
||||
to: 'off'
|
||||
|
||||
- platform: state
|
||||
entity_id: input_boolean.master_bedroom_occupied
|
||||
to: "on"
|
||||
|
||||
- platform: state
|
||||
id: occupied
|
||||
entity_id: binary_sensor.master_bedroom_occupied
|
||||
to: "on"
|
||||
|
||||
# - platform: state
|
||||
# id: motion
|
||||
# entity_id: group.master_bedroom_motion
|
||||
# to: "on"
|
||||
|
||||
condition:
|
||||
- alias: "Home is occupied"
|
||||
condition: state
|
||||
entity_id: input_boolean.home_occupied
|
||||
state: "on"
|
||||
|
||||
- alias: "Master Bedroom light cycle not on"
|
||||
condition: state
|
||||
entity_id: input_boolean.front_room_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: "Light level below trigger amount"
|
||||
condition: state
|
||||
entity_id: binary_sensor.master_bedroom_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.master_bedroom_occupied
|
||||
state: "on"
|
||||
|
||||
variables:
|
||||
switch_name: light.master_bedroom_dimmer_light
|
||||
light_name: master_bedroom_hue
|
||||
mode_name: input_select.master_bedroom_mode
|
||||
automatic_profile: input_select.automatic_light_profile
|
||||
|
||||
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.master_bedroom_mode
|
||||
state: Manual
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.master_bedroom_hue
|
||||
|
||||
- alias: "If the room is set to auto, the lights are on, and the automatic profile is set to Nightlight, change to the Automatic Light Profile scene with a short transition"
|
||||
conditions:
|
||||
- alias: "Room set to auto"
|
||||
condition: state
|
||||
entity_id: input_select.master_bedroom_mode
|
||||
state: Auto
|
||||
- alias: "Lights are on"
|
||||
condition: state
|
||||
entity_id: light.master_bedroom_hue
|
||||
state: 'on'
|
||||
- alias: "Automatic light profile set to Nightlight"
|
||||
condition: state
|
||||
entity_id: input_select.automatic_light_profile
|
||||
state: Nightlight
|
||||
sequence:
|
||||
- service: scene.turn_on
|
||||
data:
|
||||
transition: 10
|
||||
target:
|
||||
entity_id: "scene.{{light_name}}_{{states(automatic_profile).lower().replace(' ','_')}}"
|
||||
|
||||
- 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.master_bedroom_mode
|
||||
state: Auto
|
||||
- alias: "Lights are on"
|
||||
condition: state
|
||||
entity_id: light.master_bedroom_hue
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: scene.turn_on
|
||||
data:
|
||||
transition: "{{ states('input_number.light_scene_transition') }}"
|
||||
target:
|
||||
entity_id: "scene.{{light_name}}_{{states(automatic_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.master_bedroom_mode
|
||||
state: Auto
|
||||
- alias: "Lights are off"
|
||||
condition: state
|
||||
entity_id: light.master_bedroom_hue
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: scene.turn_on
|
||||
target:
|
||||
entity_id: "scene.{{light_name}}_{{states(automatic_profile).lower().replace(' ','_')}}"
|
||||
|
||||
- alias: "If the room is not set to auto, the lights are on, and the room is set to Nightlight change to the Master Bedroom Mode scene with a short transition"
|
||||
conditions:
|
||||
- alias: "Room not manual or auto and lights are on"
|
||||
condition: state
|
||||
entity_id: light.master_bedroom_hue
|
||||
state: 'on'
|
||||
- alias: "Room set to Nightlight"
|
||||
condition: state
|
||||
entity_id: input_select.master_bedroom_mode
|
||||
state: Nightlight
|
||||
sequence:
|
||||
- service: scene.turn_on
|
||||
data:
|
||||
transition: 10
|
||||
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 Master Bedroom Mode scene with a transition"
|
||||
conditions:
|
||||
- alias: "Room not manual or auto and lights are on"
|
||||
condition: state
|
||||
entity_id: light.master_bedroom_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 Master Bedroom Mode scene without a transition"
|
||||
conditions:
|
||||
- alias: "Room not manual or auto and lights are off"
|
||||
condition: state
|
||||
entity_id: light.master_bedroom_hue
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: scene.turn_on
|
||||
target:
|
||||
entity_id: "scene.{{light_name}}_{{states(mode_name).lower().replace(' ','_')}}"
|
||||
|
||||
- delay: 1
|
||||
@@ -0,0 +1,70 @@
|
||||
alias: 'Master Bedroom Not Occupied'
|
||||
id: automation_master_bedroom_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.master_bedroom_occupied
|
||||
to: 'off'
|
||||
for: '00:05:00'
|
||||
|
||||
# - platform: time_pattern
|
||||
# minutes: "/5"
|
||||
|
||||
condition:
|
||||
|
||||
- condition: state
|
||||
entity_id: input_boolean.lights_off_manually
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id:
|
||||
- binary_sensor.master_bed_occupied
|
||||
state:
|
||||
- 'off'
|
||||
- 'unavailable'
|
||||
|
||||
- condition: state
|
||||
entity_id: input_boolean.master_bedroom_occupied
|
||||
state: 'on'
|
||||
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.home_occupied
|
||||
state: 'off'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.master_bedroom_person_occupancy
|
||||
state: 'off'
|
||||
for:
|
||||
minutes: 5
|
||||
- condition: state
|
||||
entity_id: binary_sensor.master_bedroom_occupied
|
||||
state: 'off'
|
||||
for:
|
||||
minutes: 5
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.home_occupied
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: input_boolean.master_bedroom_occupied
|
||||
- conditions:
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.house
|
||||
state: 'Manual'
|
||||
sequence:
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: input_boolean.master_bedroom_occupied
|
||||
@@ -0,0 +1,18 @@
|
||||
alias: 'Master Bedroom Occupied'
|
||||
id: automation_master_bedroom_occupied
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- binary_sensor.master_bedroom_occupied
|
||||
to: 'on'
|
||||
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.master_bedroom_occupied
|
||||
state: 'off'
|
||||
|
||||
action:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.master_bedroom_occupied
|
||||
@@ -0,0 +1,161 @@
|
||||
alias: Master Bedroom Status
|
||||
id: automation_master_bedroom_status
|
||||
|
||||
trigger:
|
||||
- id: master_bed_not_occupied
|
||||
platform: state
|
||||
entity_id: binary_sensor.master_bed_occupied
|
||||
to: 'off'
|
||||
for: '00:10:00'
|
||||
|
||||
- id: phone_charging
|
||||
platform: state
|
||||
entity_id: sensor.pixel_7_charger_type
|
||||
to: "wireless"
|
||||
|
||||
- id: master_bed_person_occupancy
|
||||
platform: state
|
||||
entity_id: binary_sensor.master_bedroom_person_occupancy
|
||||
to: 'on'
|
||||
for: '00:00:30'
|
||||
|
||||
- id: master_bed_occupied
|
||||
platform: state
|
||||
entity_id: binary_sensor.master_bed_occupied
|
||||
to: 'on'
|
||||
for: '00:00:05'
|
||||
|
||||
condition:
|
||||
- alias: Okay to turn off or on
|
||||
condition: or
|
||||
conditions:
|
||||
- alias: "Is the room awake?"
|
||||
condition: and
|
||||
conditions:
|
||||
- alias: "The room is currently asleep"
|
||||
condition: state
|
||||
entity_id: input_boolean.master_bedroom_asleep
|
||||
state: 'on'
|
||||
|
||||
- alias: "An adult is home"
|
||||
condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.kristy_home
|
||||
state: 'on'
|
||||
|
||||
- alias: "It is before 10:00PM and after 4:00AM"
|
||||
condition: time
|
||||
before: '22:00:00'
|
||||
after: '04:00:00'
|
||||
|
||||
- alias: "No one on master bed"
|
||||
condition: state
|
||||
entity_id: binary_sensor.master_bed_occupied
|
||||
state: 'off'
|
||||
|
||||
- alias: "Is the room asleep?"
|
||||
condition: and
|
||||
conditions:
|
||||
- alias: "The room is currently awake"
|
||||
condition: state
|
||||
entity_id: input_boolean.master_bedroom_asleep
|
||||
state: 'off'
|
||||
|
||||
- alias: "Adult Home"
|
||||
condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.kristy_home
|
||||
state: 'on'
|
||||
|
||||
- alias: "After 10:00PM and before 4:00AM"
|
||||
condition: time
|
||||
after: '22:00:00'
|
||||
before: '04:00:00'
|
||||
|
||||
- alias: "Someone on master bed"
|
||||
condition: state
|
||||
entity_id: binary_sensor.master_bed_occupied
|
||||
state: 'on'
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- alias: "The room is currently asleep"
|
||||
condition: state
|
||||
entity_id: input_boolean.master_bedroom_asleep
|
||||
state: 'on'
|
||||
|
||||
- alias: "An adult is home"
|
||||
condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.kristy_home
|
||||
state: 'on'
|
||||
|
||||
- alias: "It is before 10:00PM and after 4:00AM"
|
||||
condition: time
|
||||
before: '22:00:00'
|
||||
after: '04:00:00'
|
||||
|
||||
- alias: "No one on master bed"
|
||||
condition: state
|
||||
entity_id: binary_sensor.master_bed_occupied
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.master_bedroom_asleep
|
||||
|
||||
- conditions:
|
||||
- alias: "The room is currently awake"
|
||||
condition: state
|
||||
entity_id: input_boolean.master_bedroom_asleep
|
||||
state: 'off'
|
||||
|
||||
- alias: "Adult Home"
|
||||
condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.kristy_home
|
||||
state: 'on'
|
||||
|
||||
- alias: "After 10:00PM and before 4:00AM"
|
||||
condition: time
|
||||
after: '22:00:00'
|
||||
before: '04:00:00'
|
||||
|
||||
- alias: "Someone on master bed"
|
||||
condition: state
|
||||
entity_id: binary_sensor.master_bed_occupied
|
||||
state: 'on'
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.master_bedroom_mode
|
||||
state: 'Manual'
|
||||
sequence:
|
||||
- service: input_select.select_option
|
||||
data:
|
||||
option: Auto
|
||||
target:
|
||||
entity_id: input_select.master_bedroom_mode
|
||||
|
||||
# From Master Bedroom Asleep
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.master_bedroom_asleep
|
||||
@@ -0,0 +1,12 @@
|
||||
alias: Master Bedroom White Noise Off
|
||||
id: automation_master_bedroom_white_noise_off
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: input_boolean.master_bedroom_asleep
|
||||
to: "off"
|
||||
|
||||
action:
|
||||
- service: media_player.turn_off
|
||||
entity_id: media_player.master_bedroom_clock
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
alias: Master Bedroom White Noise On
|
||||
id: automation_master_bedroom_white_noise_on
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: input_boolean.master_bedroom_asleep
|
||||
to: "on"
|
||||
|
||||
action:
|
||||
#- service: input_select.select_option
|
||||
# data:
|
||||
# entity_id: input_select.master_bedroom_mode
|
||||
# option: 'Off'
|
||||
- service: media_player.volume_set
|
||||
data:
|
||||
volume_level: 0.3
|
||||
target:
|
||||
entity_id: media_player.master_bedroom_clock
|
||||
|
||||
- choose:
|
||||
- conditions:
|
||||
condition: state
|
||||
entity_id: input_boolean.kristy_home
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: media_player.play_media
|
||||
target:
|
||||
entity_id: media_player.master_bedroom_clock
|
||||
data:
|
||||
media_content_id: media-source://dlna_dms/dream_media/:22$@12740
|
||||
media_content_type: audio/mpeg
|
||||
metadata:
|
||||
title: Thunderstorm
|
||||
thumbnail: >-
|
||||
http://192.168.1.10:50002/transcoder/jpegtnscaler.cgi/folderart/12740.jpg
|
||||
media_class: music
|
||||
children_media_class: null
|
||||
navigateIds:
|
||||
- {}
|
||||
- media_content_type: app
|
||||
media_content_id: media-source://dlna_dms
|
||||
- media_content_type: object.container
|
||||
media_content_id: media-source://dlna_dms/dream_media/:21
|
||||
- media_content_type: object.container.storageFolder
|
||||
media_content_id: media-source://dlna_dms/dream_media/:22
|
||||
- media_content_type: object.container.storageFolder
|
||||
media_content_id: media-source://dlna_dms/dream_media/:22$16644
|
||||
- media_content_type: object.container.storageFolder
|
||||
media_content_id: media-source://dlna_dms/dream_media/:22$16648
|
||||
default:
|
||||
- service: media_player.play_media
|
||||
target:
|
||||
entity_id: media_player.master_bedroom_clock
|
||||
data:
|
||||
media_content_id: media-source://dlna_dms/dream_media/:22$@12740
|
||||
media_content_type: audio/mpeg
|
||||
metadata:
|
||||
title: Thunderstorm
|
||||
thumbnail: >-
|
||||
http://192.168.1.10:50002/transcoder/jpegtnscaler.cgi/folderart/12740.jpg
|
||||
media_class: music
|
||||
children_media_class: null
|
||||
navigateIds:
|
||||
- {}
|
||||
- media_content_type: app
|
||||
media_content_id: media-source://dlna_dms
|
||||
- media_content_type: object.container
|
||||
media_content_id: media-source://dlna_dms/dream_media/:21
|
||||
- media_content_type: object.container.storageFolder
|
||||
media_content_id: media-source://dlna_dms/dream_media/:22
|
||||
- media_content_type: object.container.storageFolder
|
||||
media_content_id: media-source://dlna_dms/dream_media/:22$16644
|
||||
- media_content_type: object.container.storageFolder
|
||||
media_content_id: media-source://dlna_dms/dream_media/:22$16648
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
alias: Random Master Bed Strip
|
||||
id: automation_random_master_bed_strip
|
||||
trigger:
|
||||
- platform: template
|
||||
value_template: "{{ is_state('light.master_bedroom_hue', 'on') and is_state('input_select.master_bedroom_mode', 'Nightlight') }}"
|
||||
id: 'master_bedroom_nightlight'
|
||||
- platform: template
|
||||
value_template: "{{ is_state('light.master_bedroom_hue', 'on') and is_state('input_select.master_bedroom_mode', 'Auto') and is_state('input_select.automatic_light_profile', 'Nightlight') }}"
|
||||
id: 'automatic_light_profile_nightlight'
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: trigger
|
||||
id: master_bedroom_nightlight
|
||||
- condition: trigger
|
||||
id: automatic_light_profile_nightlight
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.master_bedroom_accent
|
||||
data:
|
||||
effect: candle
|
||||
brightness_pct: 50
|
||||
default:
|
||||
- service: light.turn_off
|
||||
target:
|
||||
entity_id: light.master_bedroom_accent
|
||||
@@ -0,0 +1,35 @@
|
||||
alias: Continue Nursery White Noise
|
||||
id: automation_continue_nursery_white_noise
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: media_player.nursery_hub
|
||||
to: "off"
|
||||
for: "00:00:02"
|
||||
- platform: state
|
||||
entity_id: media_player.nursery_hub
|
||||
to: "idle"
|
||||
for: "00:00:02"
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.nursery_asleep
|
||||
state: 'on'
|
||||
|
||||
action:
|
||||
#- service: input_select.select_option
|
||||
# data:
|
||||
# entity_id: input_select.master_bedroom_mode
|
||||
# option: 'Off'
|
||||
- service: input_select.select_option
|
||||
data:
|
||||
entity_id: input_select.google_home
|
||||
option: 'Nursery'
|
||||
- service: input_select.select_option
|
||||
data:
|
||||
entity_id: input_select.ambient_sound
|
||||
option: 'Thunderstorm'
|
||||
- service: input_number.set_value
|
||||
data:
|
||||
entity_id: input_number.volume_ambientsounds
|
||||
value: '0.6'
|
||||
- service: script.ambientsounds
|
||||
@@ -0,0 +1,32 @@
|
||||
alias: Nursery Awake Button
|
||||
id: automation_nursery_awake_button
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: input_button.nursery_awake
|
||||
|
||||
condition: []
|
||||
|
||||
action:
|
||||
- service: input_select.select_option
|
||||
data:
|
||||
option: Auto
|
||||
target:
|
||||
entity_id: input_select.nursery_mode
|
||||
|
||||
- service: input_select.select_option
|
||||
data:
|
||||
option: 'Off'
|
||||
target:
|
||||
entity_id: input_select.nursery_wled
|
||||
|
||||
- service: switch.turn_off
|
||||
target:
|
||||
entity_id:
|
||||
- switch.black_bed_force_occupancy
|
||||
- switch.white_bed_force_occupancy
|
||||
|
||||
- service: input_boolean.turn_off
|
||||
data: {}
|
||||
target:
|
||||
entity_id: input_boolean.nursery_asleep
|
||||
@@ -0,0 +1,45 @@
|
||||
alias: Nursery Bedtime Button
|
||||
id: automation_nursery_bedtime_button
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: input_button.nursery_bedtime
|
||||
|
||||
condition: []
|
||||
|
||||
action:
|
||||
- service: input_select.select_option
|
||||
data:
|
||||
option: Nightlight
|
||||
target:
|
||||
entity_id: input_select.nursery_mode
|
||||
|
||||
- service: input_select.select_option
|
||||
data:
|
||||
option: Running Rainbow
|
||||
target:
|
||||
entity_id: input_select.nursery_wled
|
||||
|
||||
- service: automation.trigger
|
||||
target:
|
||||
entity_id: automation.nursery_wled_changed
|
||||
|
||||
#- condition:
|
||||
- alias: "Do not restart the music if it is already playing"
|
||||
condition: not
|
||||
conditions:
|
||||
condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: media_player.ytube_music_player
|
||||
state: "playing"
|
||||
- condition: state
|
||||
entity_id: media_player.ytube_music_player
|
||||
attribute: remote_player_id
|
||||
state: "media_player.nursery_hub"
|
||||
- condition: state
|
||||
entity_id: media_player.ytube_music_player
|
||||
attribute: current_playlist_title
|
||||
state: "Kid's Goodnight Songs"
|
||||
|
||||
- service: script.goodnight_kids_youtube_music
|
||||
@@ -0,0 +1,202 @@
|
||||
alias: Nursery Dimmer LEDs
|
||||
id: automation_nursery_dimmer_leds
|
||||
mode: single
|
||||
# Hide warnings when triggered while in delay.
|
||||
max_exceeded: silent
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: light.nursery_hue
|
||||
attribute: brightness
|
||||
|
||||
- platform: state
|
||||
entity_id: light.nursery_hue
|
||||
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
|
||||
# condition:
|
||||
# - "{{ is_state('sensor.nursery_dimmer_node_status','alive') }}"
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- alias: "Light off"
|
||||
condition: state
|
||||
entity_id: light.nursery_hue
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '19'
|
||||
value: '3'
|
||||
target:
|
||||
device_id: 89e0dee60d7bdf2aeb22b3438914aba4
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '21'
|
||||
value: '3'
|
||||
target:
|
||||
device_id: 89e0dee60d7bdf2aeb22b3438914aba4
|
||||
|
||||
- conditions:
|
||||
- alias: "Light brightness below 78"
|
||||
condition: numeric_state
|
||||
entity_id: light.nursery_hue
|
||||
attribute: brightness
|
||||
below: 78
|
||||
sequence:
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '19'
|
||||
value: '3'
|
||||
target:
|
||||
device_id: 89e0dee60d7bdf2aeb22b3438914aba4
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '21'
|
||||
value: '3'
|
||||
target:
|
||||
device_id: 89e0dee60d7bdf2aeb22b3438914aba4
|
||||
|
||||
- conditions:
|
||||
- alias: "Light brightness below 104"
|
||||
condition: numeric_state
|
||||
entity_id: light.nursery_hue
|
||||
attribute: brightness
|
||||
below: 104
|
||||
sequence:
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '19'
|
||||
value: '4'
|
||||
target:
|
||||
device_id: 89e0dee60d7bdf2aeb22b3438914aba4
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '21'
|
||||
value: '4'
|
||||
target:
|
||||
device_id: 89e0dee60d7bdf2aeb22b3438914aba4
|
||||
|
||||
- conditions:
|
||||
- alias: "Light brightness below 130"
|
||||
condition: numeric_state
|
||||
entity_id: light.nursery_hue
|
||||
attribute: brightness
|
||||
below: 130
|
||||
sequence:
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '19'
|
||||
value: '5'
|
||||
target:
|
||||
device_id: 89e0dee60d7bdf2aeb22b3438914aba4
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '21'
|
||||
value: '5'
|
||||
target:
|
||||
device_id: 89e0dee60d7bdf2aeb22b3438914aba4
|
||||
|
||||
- conditions:
|
||||
- alias: "Light brightness below 156"
|
||||
condition: numeric_state
|
||||
entity_id: light.nursery_hue
|
||||
attribute: brightness
|
||||
below: 156
|
||||
sequence:
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '19'
|
||||
value: '6'
|
||||
target:
|
||||
device_id: 89e0dee60d7bdf2aeb22b3438914aba4
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '21'
|
||||
value: '6'
|
||||
target:
|
||||
device_id: 89e0dee60d7bdf2aeb22b3438914aba4
|
||||
|
||||
- conditions:
|
||||
- alias: "Light brightness below 182"
|
||||
condition: numeric_state
|
||||
entity_id: light.nursery_hue
|
||||
attribute: brightness
|
||||
below: 182
|
||||
sequence:
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '19'
|
||||
value: '7'
|
||||
target:
|
||||
device_id: 89e0dee60d7bdf2aeb22b3438914aba4
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '21'
|
||||
value: '7'
|
||||
target:
|
||||
device_id: 89e0dee60d7bdf2aeb22b3438914aba4
|
||||
|
||||
- conditions:
|
||||
- alias: "Light brightness below 208"
|
||||
condition: numeric_state
|
||||
entity_id: light.nursery_hue
|
||||
attribute: brightness
|
||||
below: 208
|
||||
sequence:
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '19'
|
||||
value: '8'
|
||||
target:
|
||||
device_id: 89e0dee60d7bdf2aeb22b3438914aba4
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '21'
|
||||
value: '8'
|
||||
target:
|
||||
device_id: 89e0dee60d7bdf2aeb22b3438914aba4
|
||||
|
||||
- conditions:
|
||||
- alias: "Light brightness below 234"
|
||||
condition: numeric_state
|
||||
entity_id: light.nursery_hue
|
||||
attribute: brightness
|
||||
below: 234
|
||||
sequence:
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '19'
|
||||
value: '9'
|
||||
target:
|
||||
device_id: 89e0dee60d7bdf2aeb22b3438914aba4
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '21'
|
||||
value: '9'
|
||||
target:
|
||||
device_id: 89e0dee60d7bdf2aeb22b3438914aba4
|
||||
|
||||
|
||||
default:
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '19'
|
||||
value: '10'
|
||||
target:
|
||||
device_id: 89e0dee60d7bdf2aeb22b3438914aba4
|
||||
- service: zwave_js.set_config_parameter
|
||||
data:
|
||||
parameter: '21'
|
||||
value: '10'
|
||||
target:
|
||||
device_id: 89e0dee60d7bdf2aeb22b3438914aba4
|
||||
|
||||
|
||||
- delay:
|
||||
hours: 0
|
||||
minutes: 0
|
||||
seconds: 1
|
||||
milliseconds: 0
|
||||
@@ -0,0 +1,49 @@
|
||||
alias: Nursery Into Bed
|
||||
id: automation_nursery_into_bed
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: binary_sensor.black_bed_occupied
|
||||
to: 'on'
|
||||
for: '00:00:30'
|
||||
- platform: state
|
||||
entity_id: binary_sensor.white_bed_occupied
|
||||
to: 'on'
|
||||
for: '00:00:30'
|
||||
|
||||
condition:
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.home_occupied
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.guest_mode
|
||||
state: 'on'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.emmett_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.bridget_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.ebin_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.nursery_light_cycle
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_select.nursery_mode
|
||||
state: 'Nightlight'
|
||||
- condition: state
|
||||
entity_id: light.nursery_hue
|
||||
state: 'on'
|
||||
|
||||
action:
|
||||
- service: light.turn_on
|
||||
data:
|
||||
entity_id:
|
||||
- light.black_bed_wled
|
||||
- light.white_bed_wled
|
||||
@@ -0,0 +1,169 @@
|
||||
alias: Nursery Light Cycle
|
||||
id: automation_nursery_light_cycle
|
||||
trigger:
|
||||
- id: light_cycle_on
|
||||
platform: state
|
||||
entity_id: input_boolean.nursery_light_cycle
|
||||
from: 'off'
|
||||
to: 'on'
|
||||
|
||||
- id: setting_change
|
||||
platform: state
|
||||
entity_id:
|
||||
- input_number.nursery_light_cycle_transition
|
||||
- input_select.nursery_color_set
|
||||
- input_boolean.nursery_cycle_same
|
||||
|
||||
condition: "{{ is_state('input_boolean.nursery_light_cycle','on') }}"
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.nursery_light_cycle
|
||||
state: 'on'
|
||||
sequence:
|
||||
|
||||
- repeat:
|
||||
sequence:
|
||||
- choose:
|
||||
- conditions: # If all lights should be the same color and the projector is off, reference the Hue group for all the lights
|
||||
- condition: state
|
||||
entity_id: input_boolean.nursery_cycle_same
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.nursery_ceiling_hue
|
||||
data:
|
||||
brightness: '{{ states("input_number.nursery_light_cycle_brightness") | int }}'
|
||||
transition: '{{ states("input_number.nursery_light_cycle_transition") | int }}'
|
||||
profile: >
|
||||
{% if states('input_select.nursery_color_set') == 'Basic' %}
|
||||
{% set colors = ['white','black','red','orange','yellow','green','blue','purple','pink','brown','gray'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Color Wheel' %}
|
||||
{% set colors = ['red','orange','amber','yellow','chartreuse','green','teal','blue','violet','purple','magenta'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Rainbow' %}
|
||||
{% set colors = ['red','orange','yellow','green','blue','indigo','violet'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Flourescent' %}
|
||||
{% set colors = ['radical_red','wild_watermelon','outrageous_orange','atomic_tangerine','neon_carrot','sunglow','laser_lemon','unmellow_yellow','electric_lime','screamin_green','magic_mint','blizzard_blue','shocking_pink','razzle_dazzle_rose','hot_magenta','purple_pizzazz'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Silver Swirl' %}
|
||||
{% set colors = ['aztec_gold','burnished_brown','cerulean_frost','cinnamon_satin','copper_penny','cosmic_cobalt','glossy_grape','granite_gray','green_sheen','lilac_luster','misty_moss','mystic_maroon','pearly_purple','pewter_blue','polished_pine','quick_silver','rose_dust','rusty_red','shadow_blue','shiny_shamrock','steel_teal','sugar_plum','twilight_lavender','wintergreen_dream'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Gem Tones' %}
|
||||
{% set colors = ['amethyst','citrine','emerald','jade','lapis_lazuli','malachite','rose_quartz','ruby','sapphire','smokey_topaz'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Reds' %}
|
||||
{% set colors = ['auburn','baby_pink','barn_red','burgundy','burnt_umber','cadmium_red','cardinal','chesnut','chili_red','congo_pink','coral_pink','desire','fire_engine_red','imperial_red','new_york_pink','paradise_pink','pastel_pink','pigment_red','rust','salmon_pink','tango_pink','turkey_red','vanilla_ice','wine'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Oranges' %}
|
||||
{% set colors = ['beaver','cadmium_orange','carrot_orange','champagne','chocolate','cocoa_brown','desert_sand','flame','gamboge','international_orange','kobicha','lion','marigold','orange_peel','persian_orange','persimmon','peru','portland_orange','pumpkin','russet','safety_orange','sandy_brown','tan','taupe','tawny','tea_rose','wood_brown'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Yellows' %}
|
||||
{% set colors = ['amber','beige','buff','citrine','cream','cyber_yellow','ecru','harvest_gold','jasmine','jonquil','khaki','lemon','mellow_yellow','mikado_yellow','mustard','naples_yellow','old_gold','process_yellow','royal_yellow','safety_yellow','saffron','school_bus_yellow','straw','vanilla'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Greens' %}
|
||||
{% set colors = ['army_green','artichoke','asparagus','avacado','bottle_green','bright_mint','celadon','emerald','fern_green','forest_green','harlequin','hunter_green','india_green','islamic_green','jade','kelly_green','laurel_green','malachite','mantis','mint_green','moss_green','neon_green','olive','pakistan_green','paris_green','rifle_green','russian_green','sea_green','shamrock_green','slytherin_green'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Cyans' %}
|
||||
{% set colors = ['aqua','aquamarine','brunswick_green','celadon_green','celeste','cerulean','charleston_green','dark_cyan','electric_blue','feldgrau','gray_green','midnight_green','morning_blue','myrtle_green','persian_green','robin_egg_blue','sky_blue','teal','teal_blue','turquoise','verdigris','viridian'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Blues' %}
|
||||
{% set colors = ['azure','baby_blue','blue_gray','capri','cornflower','egyptian_blue','glaucous','independence','indigo','indigo_dye','liberty','light_blue','midnight_blue','navy_blue','periwinkle','powder_blue','resolution_blue','sapphire','space_cadet','steel_blue','ultramarine'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Purples' %}
|
||||
{% set colors = ['byzantium','dark_purple','electric_indigo','eminence','heliotrope','indigo','indigo_dye','mardi_gras','mauve','medium_purple','orchid','pansy_purple','phlox','purpureus','thistle','tropical_indigo','tyrian_purple','royal_purple'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Magentas' %}
|
||||
{% set colors = ['amaranth','antique_fuchsia','baby_pink','cameo_pink','carnation_pink','charm_pink','china_pink','cotton_candy','dark_magenta','fandango','french_fuchsia','french_pink','fuchsia_rose','magenta_haze','mimi_pink','persian_pink','piggy_pink','pink','pink_lace','pink_lavender','plum','queen_pink','rose','rose_quartz','shocking_pink','silver_pink','sky_magenta','super_pink'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Grays' %}
|
||||
{% set colors = ['ash_gray','battleship_gray','cadet_gray','charcoal','dim_gray','gunmetal','jet','marengo','nickel','platinum','rocket_metallic','silver','slate_gray'] %}
|
||||
{% endif %}
|
||||
{{ colors|random }}
|
||||
|
||||
- conditions: # If all lights should be different colors, start referencing the individual lights that don't obscure the TV
|
||||
- condition: state
|
||||
entity_id: input_boolean.nursery_cycle_same
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.nursery_color_1
|
||||
data:
|
||||
brightness: '{{ states("input_number.nursery_light_cycle_brightness") | int }}'
|
||||
transition: '{{ states("input_number.nursery_light_cycle_transition") | int }}'
|
||||
profile: >
|
||||
{% if states('input_select.nursery_color_set') == 'Basic' %}
|
||||
{% set colors = ['white','black','red','orange','yellow','green','blue','purple','pink','brown','gray'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Color Wheel' %}
|
||||
{% set colors = ['red','orange','amber','yellow','chartreuse','green','teal','blue','violet','purple','magenta'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Rainbow' %}
|
||||
{% set colors = ['red','orange','yellow','green','blue','indigo','violet'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Flourescent' %}
|
||||
{% set colors = ['radical_red','wild_watermelon','outrageous_orange','atomic_tangerine','neon_carrot','sunglow','laser_lemon','unmellow_yellow','electric_lime','screamin_green','magic_mint','blizzard_blue','shocking_pink','razzle_dazzle_rose','hot_magenta','purple_pizzazz'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Silver Swirl' %}
|
||||
{% set colors = ['aztec_gold','burnished_brown','cerulean_frost','cinnamon_satin','copper_penny','cosmic_cobalt','glossy_grape','granite_gray','green_sheen','lilac_luster','misty_moss','mystic_maroon','pearly_purple','pewter_blue','polished_pine','quick_silver','rose_dust','rusty_red','shadow_blue','shiny_shamrock','steel_teal','sugar_plum','twilight_lavender','wintergreen_dream'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Gem Tones' %}
|
||||
{% set colors = ['amethyst','citrine','emerald','jade','lapis_lazuli','malachite','rose_quartz','ruby','sapphire','smokey_topaz'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Reds' %}
|
||||
{% set colors = ['auburn','baby_pink','barn_red','burgundy','burnt_umber','cadmium_red','cardinal','chesnut','chili_red','congo_pink','coral_pink','desire','fire_engine_red','imperial_red','new_york_pink','paradise_pink','pastel_pink','pigment_red','rust','salmon_pink','tango_pink','turkey_red','vanilla_ice','wine'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Oranges' %}
|
||||
{% set colors = ['beaver','cadmium_orange','carrot_orange','champagne','chocolate','cocoa_brown','desert_sand','flame','gamboge','international_orange','kobicha','lion','marigold','orange_peel','persian_orange','persimmon','peru','portland_orange','pumpkin','russet','safety_orange','sandy_brown','tan','taupe','tawny','tea_rose','wood_brown'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Yellows' %}
|
||||
{% set colors = ['amber','beige','buff','citrine','cream','cyber_yellow','ecru','harvest_gold','jasmine','jonquil','khaki','lemon','mellow_yellow','mikado_yellow','mustard','naples_yellow','old_gold','process_yellow','royal_yellow','safety_yellow','saffron','school_bus_yellow','straw','vanilla'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Greens' %}
|
||||
{% set colors = ['army_green','artichoke','asparagus','avacado','bottle_green','bright_mint','celadon','emerald','fern_green','forest_green','harlequin','hunter_green','india_green','islamic_green','jade','kelly_green','laurel_green','malachite','mantis','mint_green','moss_green','neon_green','olive','pakistan_green','paris_green','rifle_green','russian_green','sea_green','shamrock_green','slytherin_green'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Cyans' %}
|
||||
{% set colors = ['aqua','aquamarine','brunswick_green','celadon_green','celeste','cerulean','charleston_green','dark_cyan','electric_blue','feldgrau','gray_green','midnight_green','morning_blue','myrtle_green','persian_green','robin_egg_blue','sky_blue','teal','teal_blue','turquoise','verdigris','viridian'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Blues' %}
|
||||
{% set colors = ['azure','baby_blue','blue_gray','capri','cornflower','egyptian_blue','glaucous','independence','indigo','indigo_dye','liberty','light_blue','midnight_blue','navy_blue','periwinkle','powder_blue','resolution_blue','sapphire','space_cadet','steel_blue','ultramarine'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Purples' %}
|
||||
{% set colors = ['byzantium','dark_purple','electric_indigo','eminence','heliotrope','indigo','indigo_dye','mardi_gras','mauve','medium_purple','orchid','pansy_purple','phlox','purpureus','thistle','tropical_indigo','tyrian_purple','royal_purple'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Magentas' %}
|
||||
{% set colors = ['amaranth','antique_fuchsia','baby_pink','cameo_pink','carnation_pink','charm_pink','china_pink','cotton_candy','dark_magenta','fandango','french_fuchsia','french_pink','fuchsia_rose','magenta_haze','mimi_pink','persian_pink','piggy_pink','pink','pink_lace','pink_lavender','plum','queen_pink','rose','rose_quartz','shocking_pink','silver_pink','sky_magenta','super_pink'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Grays' %}
|
||||
{% set colors = ['ash_gray','battleship_gray','cadet_gray','charcoal','dim_gray','gunmetal','jet','marengo','nickel','platinum','rocket_metallic','silver','slate_gray'] %}
|
||||
{% endif %}
|
||||
{{ colors|random }}
|
||||
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.nursery_color_2
|
||||
data:
|
||||
brightness: '{{ states("input_number.nursery_light_cycle_brightness") | int }}'
|
||||
transition: '{{ states("input_number.nursery_light_cycle_transition") | int }}'
|
||||
profile: >
|
||||
{% if states('input_select.nursery_color_set') == 'Basic' %}
|
||||
{% set colors = ['white','black','red','orange','yellow','green','blue','purple','pink','brown','gray'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Color Wheel' %}
|
||||
{% set colors = ['red','orange','amber','yellow','chartreuse','green','teal','blue','violet','purple','magenta'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Rainbow' %}
|
||||
{% set colors = ['red','orange','yellow','green','blue','indigo','violet'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Flourescent' %}
|
||||
{% set colors = ['radical_red','wild_watermelon','outrageous_orange','atomic_tangerine','neon_carrot','sunglow','laser_lemon','unmellow_yellow','electric_lime','screamin_green','magic_mint','blizzard_blue','shocking_pink','razzle_dazzle_rose','hot_magenta','purple_pizzazz'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Silver Swirl' %}
|
||||
{% set colors = ['aztec_gold','burnished_brown','cerulean_frost','cinnamon_satin','copper_penny','cosmic_cobalt','glossy_grape','granite_gray','green_sheen','lilac_luster','misty_moss','mystic_maroon','pearly_purple','pewter_blue','polished_pine','quick_silver','rose_dust','rusty_red','shadow_blue','shiny_shamrock','steel_teal','sugar_plum','twilight_lavender','wintergreen_dream'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Gem Tones' %}
|
||||
{% set colors = ['amethyst','citrine','emerald','jade','lapis_lazuli','malachite','rose_quartz','ruby','sapphire','smokey_topaz'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Reds' %}
|
||||
{% set colors = ['auburn','baby_pink','barn_red','burgundy','burnt_umber','cadmium_red','cardinal','chesnut','chili_red','congo_pink','coral_pink','desire','fire_engine_red','imperial_red','new_york_pink','paradise_pink','pastel_pink','pigment_red','rust','salmon_pink','tango_pink','turkey_red','vanilla_ice','wine'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Oranges' %}
|
||||
{% set colors = ['beaver','cadmium_orange','carrot_orange','champagne','chocolate','cocoa_brown','desert_sand','flame','gamboge','international_orange','kobicha','lion','marigold','orange_peel','persian_orange','persimmon','peru','portland_orange','pumpkin','russet','safety_orange','sandy_brown','tan','taupe','tawny','tea_rose','wood_brown'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Yellows' %}
|
||||
{% set colors = ['amber','beige','buff','citrine','cream','cyber_yellow','ecru','harvest_gold','jasmine','jonquil','khaki','lemon','mellow_yellow','mikado_yellow','mustard','naples_yellow','old_gold','process_yellow','royal_yellow','safety_yellow','saffron','school_bus_yellow','straw','vanilla'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Greens' %}
|
||||
{% set colors = ['army_green','artichoke','asparagus','avacado','bottle_green','bright_mint','celadon','emerald','fern_green','forest_green','harlequin','hunter_green','india_green','islamic_green','jade','kelly_green','laurel_green','malachite','mantis','mint_green','moss_green','neon_green','olive','pakistan_green','paris_green','rifle_green','russian_green','sea_green','shamrock_green','slytherin_green'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Cyans' %}
|
||||
{% set colors = ['aqua','aquamarine','brunswick_green','celadon_green','celeste','cerulean','charleston_green','dark_cyan','electric_blue','feldgrau','gray_green','midnight_green','morning_blue','myrtle_green','persian_green','robin_egg_blue','sky_blue','teal','teal_blue','turquoise','verdigris','viridian'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Blues' %}
|
||||
{% set colors = ['azure','baby_blue','blue_gray','capri','cornflower','egyptian_blue','glaucous','independence','indigo','indigo_dye','liberty','light_blue','midnight_blue','navy_blue','periwinkle','powder_blue','resolution_blue','sapphire','space_cadet','steel_blue','ultramarine'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Purples' %}
|
||||
{% set colors = ['byzantium','dark_purple','electric_indigo','eminence','heliotrope','indigo','indigo_dye','mardi_gras','mauve','medium_purple','orchid','pansy_purple','phlox','purpureus','thistle','tropical_indigo','tyrian_purple','royal_purple'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Magentas' %}
|
||||
{% set colors = ['amaranth','antique_fuchsia','baby_pink','cameo_pink','carnation_pink','charm_pink','china_pink','cotton_candy','dark_magenta','fandango','french_fuchsia','french_pink','fuchsia_rose','magenta_haze','mimi_pink','persian_pink','piggy_pink','pink','pink_lace','pink_lavender','plum','queen_pink','rose','rose_quartz','shocking_pink','silver_pink','sky_magenta','super_pink'] %}
|
||||
{% elif states('input_select.nursery_color_set') == 'Grays' %}
|
||||
{% set colors = ['ash_gray','battleship_gray','cadet_gray','charcoal','dim_gray','gunmetal','jet','marengo','nickel','platinum','rocket_metallic','silver','slate_gray'] %}
|
||||
{% endif %}
|
||||
{{ colors|random }}
|
||||
|
||||
- delay:
|
||||
seconds: '{{ states("input_number.nursery_light_cycle_transition") | int }}'
|
||||
|
||||
until:
|
||||
- condition: state
|
||||
entity_id: input_boolean.nursery_light_cycle
|
||||
state: 'off'
|
||||
|
||||
- service: automation.trigger
|
||||
entity_id: automation.nursery_lights_to_on
|
||||
@@ -0,0 +1,75 @@
|
||||
alias: Nursery Lights to Off
|
||||
id: automation_nursery_lights_to_off
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: input_select.nursery_mode
|
||||
|
||||
- platform: state
|
||||
entity_id: input_boolean.nursery_occupied
|
||||
to: 'off'
|
||||
|
||||
- platform: state
|
||||
id: light_level
|
||||
entity_id: binary_sensor.nursery_naturally_lit
|
||||
from: 'off'
|
||||
to: 'on'
|
||||
|
||||
#- platform: time_pattern
|
||||
# minutes: "/5"
|
||||
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: light.nursery_hue
|
||||
state: 'on'
|
||||
|
||||
- alias: "Nursery light cycle not on"
|
||||
condition: state
|
||||
entity_id: input_boolean.nursery_light_cycle
|
||||
state: "off"
|
||||
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.nursery_mode
|
||||
state: 'Off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.nursery_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.nursery_mode
|
||||
state: 'Off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.nursery_occupied
|
||||
state: 'off'
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.nursery_mode
|
||||
state: 'Manual'
|
||||
sequence:
|
||||
- service: scene.turn_on
|
||||
data:
|
||||
transition: 5
|
||||
target:
|
||||
entity_id: scene.nursery_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: light.nursery_color_1, light.nursery_color_2
|
||||
@@ -0,0 +1,196 @@
|
||||
alias: Nursery Lights to On
|
||||
id: automation_nursery_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.nursery_mode
|
||||
- input_select.automatic_light_profile
|
||||
|
||||
- platform: state
|
||||
id: light_level
|
||||
entity_id: binary_sensor.nursery_naturally_lit
|
||||
from: 'on'
|
||||
to: 'off'
|
||||
|
||||
- platform: state
|
||||
entity_id: input_boolean.nursery_occupied
|
||||
to: "on"
|
||||
|
||||
- platform: state
|
||||
id: occupied
|
||||
entity_id: binary_sensor.nursery_occupied
|
||||
to: "on"
|
||||
|
||||
# - platform: state
|
||||
# id: motion
|
||||
# entity_id: group.nursery_motion
|
||||
# to: "on"
|
||||
|
||||
condition:
|
||||
- alias: "Home is occupied"
|
||||
condition: state
|
||||
entity_id: input_boolean.home_occupied
|
||||
state: "on"
|
||||
|
||||
- alias: "Nursery light cycle not on"
|
||||
condition: state
|
||||
entity_id: input_boolean.nursery_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: "Light level below trigger amount"
|
||||
condition: state
|
||||
entity_id: binary_sensor.nursery_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.nursery_occupied
|
||||
state: "on"
|
||||
|
||||
variables:
|
||||
switch_name: light.nursery_dimmer_light
|
||||
light_name: nursery_hue
|
||||
mode_name: input_select.nursery_mode
|
||||
automatic_profile: input_select.automatic_light_profile
|
||||
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.nursery_mode
|
||||
state: Manual
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.nursery_hue
|
||||
|
||||
- alias: "If the room is set to auto, the lights are on, and the automatic profile is set to Nightlight, change to the Automatic Light Profile scene with a short transition"
|
||||
conditions:
|
||||
- alias: "Room set to auto"
|
||||
condition: state
|
||||
entity_id: input_select.nursery_mode
|
||||
state: Auto
|
||||
- alias: "Lights are on"
|
||||
condition: state
|
||||
entity_id: light.nursery_hue
|
||||
state: 'on'
|
||||
- alias: "Automatic light profile set to Nightlight"
|
||||
condition: state
|
||||
entity_id: input_select.automatic_light_profile
|
||||
state: Nightlight
|
||||
sequence:
|
||||
- service: scene.turn_on
|
||||
data:
|
||||
transition: 10
|
||||
target:
|
||||
entity_id: "scene.{{light_name}}_{{states(automatic_profile).lower().replace(' ','_')}}"
|
||||
|
||||
- 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.nursery_mode
|
||||
state: Auto
|
||||
- alias: "Lights are on"
|
||||
condition: state
|
||||
entity_id: light.nursery_hue
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: scene.turn_on
|
||||
data:
|
||||
transition: "{{ states('input_number.light_scene_transition') }}"
|
||||
target:
|
||||
entity_id: "scene.{{light_name}}_{{states(automatic_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.nursery_mode
|
||||
state: Auto
|
||||
- alias: "Lights are off"
|
||||
condition: state
|
||||
entity_id: light.nursery_hue
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: scene.turn_on
|
||||
target:
|
||||
entity_id: "scene.{{light_name}}_{{states(automatic_profile).lower().replace(' ','_')}}"
|
||||
|
||||
- alias: "If the room is not set to auto, the lights are on, and the room is set to Nightlight change to the Nursery Mode scene with a short transition"
|
||||
conditions:
|
||||
- alias: "Room not manual or auto and lights are on"
|
||||
condition: state
|
||||
entity_id: light.nursery_hue
|
||||
state: 'on'
|
||||
- alias: "Room set to Nightlight"
|
||||
condition: state
|
||||
entity_id: input_select.nursery_mode
|
||||
state: Nightlight
|
||||
sequence:
|
||||
- service: scene.turn_on
|
||||
data:
|
||||
transition: 10
|
||||
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 Nursery Mode scene with a transition"
|
||||
conditions:
|
||||
- alias: "Room not manual or auto and lights are on"
|
||||
condition: state
|
||||
entity_id: light.nursery_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 Nursery Mode scene without a transition"
|
||||
conditions:
|
||||
- alias: "Room not manual or auto and lights are off"
|
||||
condition: state
|
||||
entity_id: light.nursery_hue
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: scene.turn_on
|
||||
target:
|
||||
entity_id: "scene.{{light_name}}_{{states(mode_name).lower().replace(' ','_')}}"
|
||||
|
||||
- delay: 1
|
||||
@@ -0,0 +1,73 @@
|
||||
alias: 'Nursery Not Occupied'
|
||||
id: automation_nursery_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.nursery_occupied
|
||||
to: 'off'
|
||||
for: '00:05:00'
|
||||
|
||||
# - platform: time_pattern
|
||||
# minutes: "/5"
|
||||
|
||||
condition:
|
||||
|
||||
- condition: state
|
||||
entity_id: input_boolean.lights_off_manually
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id:
|
||||
- binary_sensor.white_bed_occupied
|
||||
- binary_sensor.black_bed_occupied
|
||||
state:
|
||||
- 'off'
|
||||
- 'unavailable'
|
||||
|
||||
- condition: state
|
||||
entity_id: input_boolean.nursery_occupied
|
||||
state: 'on'
|
||||
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.home_occupied
|
||||
state: 'off'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.nursery_person_occupancy
|
||||
state: 'off'
|
||||
for:
|
||||
minutes: 5
|
||||
- condition: state
|
||||
entity_id: binary_sensor.nursery_occupied
|
||||
state: 'off'
|
||||
for:
|
||||
minutes: 5
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.home_occupied
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: input_boolean.nursery_occupied
|
||||
- conditions:
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.house
|
||||
state: 'Manual'
|
||||
sequence:
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: input_boolean.nursery_occupied
|
||||
@@ -0,0 +1,18 @@
|
||||
alias: Nursery Occupied
|
||||
id: automation_nursery_occupied
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- binary_sensor.nursery_occupied
|
||||
to: 'on'
|
||||
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.nursery_occupied
|
||||
state: 'off'
|
||||
|
||||
action:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.nursery_occupied
|
||||
@@ -0,0 +1,165 @@
|
||||
alias: Nursery Out of Bed
|
||||
id: automation_nursery_out_of_bed
|
||||
mode: single
|
||||
# Hide warnings when triggered while in delay.
|
||||
max_exceeded: silent
|
||||
|
||||
trigger:
|
||||
- platform: template
|
||||
value_template: "{% if is_state('binary_sensor.nursery_door_person_occupancy','on') and is_state('binary_sensor.nursery_door','off')%}true{%endif%}"
|
||||
|
||||
- platform: state
|
||||
entity_id: binary_sensor.black_bed_occupied
|
||||
from: 'on'
|
||||
to: 'off'
|
||||
for: '00:00:05'
|
||||
- platform: state
|
||||
entity_id: binary_sensor.white_bed_occupied
|
||||
from: 'on'
|
||||
to: 'off'
|
||||
for: '00:00:05'
|
||||
- platform: state
|
||||
entity_id: binary_sensor.nursery_door
|
||||
from: 'off'
|
||||
to: 'on'
|
||||
|
||||
condition:
|
||||
- alias: "Do we want to be alerted?"
|
||||
condition: state
|
||||
entity_id: input_boolean.out_of_bed_alert
|
||||
state: 'on'
|
||||
|
||||
- alias: "Is the home occupied or in guest mode?"
|
||||
condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.home_occupied
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.guest_mode
|
||||
state: 'on'
|
||||
|
||||
- alias: "Are any of the kids considered home?"
|
||||
condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.emmett_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.bridget_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.ebin_home
|
||||
state: 'on'
|
||||
|
||||
- alias: "Is at a time of day when the kids should be sleeping?"
|
||||
condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.evening
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.late_evening
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.night
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.early_morning
|
||||
state: 'on'
|
||||
|
||||
- alias: "Is Nursery Light Cycle turned off?"
|
||||
condition: state
|
||||
entity_id: input_boolean.nursery_light_cycle
|
||||
state: 'off'
|
||||
|
||||
- alias: "Are the kids asleep?"
|
||||
condition: state
|
||||
entity_id: input_boolean.kids_asleep
|
||||
state: 'on'
|
||||
|
||||
- alias: "Is an adult awake?"
|
||||
condition: state
|
||||
entity_id: binary_sensor.adults_asleep
|
||||
state: 'off'
|
||||
|
||||
variables:
|
||||
computer_area: "{{ states('binary_sensor.computer_area_person_occupancy') }}"
|
||||
front_room: "{{ states('binary_sensor.front_room_person_occupancy') }}"
|
||||
entryway: "{{ states('input_boolean.entryway_occupied') }}"
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.garage_occupied
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: script.blink_garage_lights
|
||||
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.computer_area_occupied
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: webrtc.dash_cast
|
||||
data:
|
||||
entity_id: media_player.computer_area_hub
|
||||
url: rtsp_cam08_sub
|
||||
force: true
|
||||
extra:
|
||||
mode: webrtc
|
||||
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.front_room_occupied
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: webrtc.dash_cast
|
||||
data:
|
||||
entity_id: media_player.front_room_hub
|
||||
url: rtsp_cam08_sub
|
||||
force: true
|
||||
extra:
|
||||
mode: webrtc
|
||||
|
||||
- delay: '00:10:00'
|
||||
|
||||
- service: media_player.turn_off
|
||||
entity_id: media_player.front_room_hub, media_player.computer_area_hub
|
||||
|
||||
# - alias: "Flash some lights"
|
||||
# repeat:
|
||||
# count: 6
|
||||
# sequence:
|
||||
# - delay: 1
|
||||
# - service: light.toggle
|
||||
# target:
|
||||
# entity_id:
|
||||
# - light.entryway_hue
|
||||
# - light.computer_area_hue
|
||||
# - light.front_room_hue
|
||||
#- delay: '00:00:02'
|
||||
|
||||
# - alias: "Fix computer area lights"
|
||||
# service: automation.trigger
|
||||
# target:
|
||||
# entity_id: "automation.computer_area_lights_to_{{ computer_area }}"
|
||||
# data:
|
||||
# skip_condition: true
|
||||
|
||||
# - alias: "Fix front room lights"
|
||||
# service: automation.trigger
|
||||
# target:
|
||||
# entity_id: "automation.front_room_lights_to_{{ front_room }}"
|
||||
# data:
|
||||
# skip_condition: true
|
||||
|
||||
# - alias: "Fix entryway lights"
|
||||
# service: automation.trigger
|
||||
# target:
|
||||
# entity_id: "automation.entryway_lights_to_{{ entryway }}"
|
||||
# data:
|
||||
# skip_condition: true
|
||||
@@ -0,0 +1,12 @@
|
||||
alias: Nursery White Noise Off
|
||||
id: automation_nursery_white_noise_off
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: input_boolean.nursery_asleep
|
||||
to: "off"
|
||||
|
||||
action:
|
||||
- service: media_player.turn_off
|
||||
entity_id: media_player.nursery_hub
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
alias: Nursery White Noise On
|
||||
id: automation_nursery_white_noise_on
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: input_boolean.nursery_asleep
|
||||
to: "on"
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: media_player.ytube_music_player
|
||||
state: "playing"
|
||||
- condition: state
|
||||
entity_id: media_player.ytube_music_player
|
||||
attribute: remote_player_id
|
||||
state: "media_player.nursery_hub"
|
||||
sequence:
|
||||
- service: media_player.media_stop
|
||||
target:
|
||||
entity_id: media_player.ytube_music_player
|
||||
|
||||
#- service: input_select.select_option
|
||||
# data:
|
||||
# entity_id: input_select.nursery_mode
|
||||
# option: 'Off'
|
||||
- service: media_player.volume_set
|
||||
data:
|
||||
volume_level: 0.6
|
||||
target:
|
||||
entity_id: media_player.nursery_hub
|
||||
|
||||
- service: media_player.play_media
|
||||
target:
|
||||
entity_id: media_player.nursery_hub
|
||||
data:
|
||||
media_content_id: media-source://dlna_dms/dream_media/:22$@12740
|
||||
media_content_type: audio/mpeg
|
||||
metadata:
|
||||
title: Thunderstorm
|
||||
thumbnail: >-
|
||||
http://192.168.1.10:50002/transcoder/jpegtnscaler.cgi/folderart/12740.jpg
|
||||
media_class: music
|
||||
children_media_class: null
|
||||
navigateIds:
|
||||
- {}
|
||||
- media_content_type: app
|
||||
media_content_id: media-source://dlna_dms
|
||||
- media_content_type: object.container
|
||||
media_content_id: media-source://dlna_dms/dream_media/:21
|
||||
- media_content_type: object.container.storageFolder
|
||||
media_content_id: media-source://dlna_dms/dream_media/:22
|
||||
- media_content_type: object.container.storageFolder
|
||||
media_content_id: media-source://dlna_dms/dream_media/:22$16644
|
||||
- media_content_type: object.container.storageFolder
|
||||
media_content_id: media-source://dlna_dms/dream_media/:22$16648
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
alias: Storage Room Lights
|
||||
id: automation_storage_room_lights
|
||||
mode: queued
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
id: door_open
|
||||
entity_id: binary_sensor.storage_room_door_contact
|
||||
from: 'off'
|
||||
to: "on"
|
||||
|
||||
- platform: state
|
||||
id: door_closed
|
||||
entity_id: binary_sensor.storage_room_door_contact
|
||||
to: "off"
|
||||
for: "00:10:00"
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id: "door_open"
|
||||
- condition: state
|
||||
entity_id: light.storage_room
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: light.turn_on
|
||||
target:
|
||||
entity_id: light.storage_room
|
||||
- conditions:
|
||||
- condition: trigger
|
||||
id: "door_closed"
|
||||
- condition: state
|
||||
entity_id: light.storage_room
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: light.turn_off
|
||||
target:
|
||||
entity_id: light.storage_room
|
||||
@@ -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