Last active
April 25, 2023 23:55
-
-
Save mikesmitty/7888f4c80f3e0b6e0a10aa6f57d46d89 to your computer and use it in GitHub Desktop.
Home Assistant Basic Layout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- alias: Climate - Bathroom - House Mode/Presence | |
description: '' | |
trigger: | |
- entity_id: | |
- input_select.house_mode | |
- input_select.presence | |
platform: state | |
action: | |
- choose: | |
# Turn off | |
- conditions: > | |
{{- not (is_state('input_select.house_mode', 'morning') | |
or is_state('input_select.house_mode', 'evening')) | |
or is_state('input_select.presence', 'away') }} | |
sequence: | |
- data: | |
entity_id: climate.bathroom_heater | |
preset_mode: 'Energy heat' | |
service: climate.set_preset_mode | |
# Turn on | |
- conditions: > | |
{{- (is_state('input_select.house_mode', 'morning') | |
or is_state('input_select.house_mode', 'evening')) | |
and is_state('input_select.presence', 'home') }} | |
sequence: | |
- data: | |
entity_id: climate.bathroom_heater | |
preset_mode: 'none' | |
service: climate.set_preset_mode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
################################################### | |
# Home/Away states | |
################################################### | |
- alias: State - Home/Away - Away | |
description: '' | |
trigger: | |
- entity_id: group.household | |
platform: state | |
to: not_home | |
condition: [] | |
action: | |
- data: | |
entity_id: input_select.presence | |
option: away | |
service: input_select.select_option | |
- alias: State - Home/Away - Home | |
description: '' | |
trigger: | |
- entity_id: group.household | |
platform: state | |
to: home | |
condition: [] | |
action: | |
- data: | |
entity_id: input_select.presence | |
option: home | |
service: input_select.select_option | |
################################################### | |
# Parts of day states | |
################################################### | |
- alias: State - House Mode - Morning | |
description: '' | |
trigger: | |
- at: '05:00' | |
platform: time | |
- at: '08:00' | |
platform: time | |
condition: > | |
{%- set hour = now().strftime("%H") |int -%} | |
{{- is_state('binary_sensor.workday_sensor', 'on') or hour == 8 -}} | |
action: | |
- data: | |
entity_id: input_select.house_mode | |
option: morning | |
service: input_select.select_option | |
- alias: State - House Mode - Day | |
description: '' | |
trigger: | |
- at: '10:00' | |
platform: time | |
- at: '12:00' | |
platform: time | |
condition: > | |
{%- set hour = now().strftime("%H") |int -%} | |
{{- is_state('binary_sensor.workday_sensor', 'on') or hour == 12 -}} | |
action: | |
- data: | |
entity_id: input_select.house_mode | |
option: day | |
service: input_select.select_option | |
- alias: State - House Mode - Evening | |
description: '' | |
trigger: | |
- at: '22:30' | |
platform: time | |
condition: [] | |
action: | |
- data: | |
entity_id: input_select.house_mode | |
option: evening | |
service: input_select.select_option | |
- alias: State - House Mode - Night | |
description: '' | |
trigger: | |
- at: '23:30' | |
platform: time | |
- at: '23:59' | |
platform: time | |
condition: > | |
{{- is_state('binary_sensor.workday_tomorrow', 'on') | |
or now().strftime('%H:%M') == '23:59' -}} | |
action: | |
- data: | |
entity_id: input_select.house_mode | |
option: night | |
service: input_select.select_option |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- platform: workday | |
country: US | |
- name: Workday Tomorrow | |
platform: workday | |
country: US | |
days_offset: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[...] | |
automation: !include_dir_merge_list automation | |
binary_sensor: !include binary_sensor.yaml | |
[...] | |
input_select: !include input_select.yaml | |
[...] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
house_mode: | |
name: House mode | |
options: | |
- morning | |
- day | |
- evening | |
- night | |
presence: | |
name: Presence | |
options: | |
- home | |
- away |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment