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,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
|
||||
Reference in New Issue
Block a user