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,26 @@
|
||||
alias: Clint WFH
|
||||
id: automation_clint_wfh
|
||||
mode: restart
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: binary_sensor.clint_work_from_home
|
||||
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.clint_work_from_home
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: homeassistant.turn_on
|
||||
entity_id: input_boolean.clint_work_from_home
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.clint_work_from_home
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: input_boolean.clint_work_from_home
|
||||
@@ -0,0 +1,26 @@
|
||||
alias: Clint Asleep
|
||||
id: automation_clint_asleep
|
||||
|
||||
initial_state: 'on'
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: input_boolean.clint_in_bed
|
||||
to: 'on'
|
||||
for:
|
||||
minutes: 15
|
||||
condition:
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_is_awake
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_home
|
||||
state: 'on'
|
||||
- condition: time
|
||||
after: '21:00:00'
|
||||
before: '04:00:00'
|
||||
action:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.clint_is_awake
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
alias: Clint at Work
|
||||
id: automation_clint_at_work
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: device_tracker.pixel_7
|
||||
to: 'AGH'
|
||||
action:
|
||||
- service: automation.turn_on
|
||||
entity_id: automation.clint_home_after_work
|
||||
- service: input_text.set_value
|
||||
data:
|
||||
entity_id: input_text.person_clint
|
||||
value: at work
|
||||
@@ -0,0 +1,15 @@
|
||||
alias: Clint Awake
|
||||
id: automation_clint_awake
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: input_boolean.clint_in_bed
|
||||
to: 'off'
|
||||
for: '00:00:30'
|
||||
action:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.clint_is_awake
|
||||
|
||||
- service: script.turn_on
|
||||
entity_id: script.clint_travel_sensor
|
||||
@@ -0,0 +1,39 @@
|
||||
alias: Clint Away
|
||||
id: automation_clint_away
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- device_tracker.pixel_7
|
||||
- person.clint
|
||||
- group.person_clint
|
||||
from: 'home'
|
||||
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
|
||||
condition:
|
||||
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: person.clint
|
||||
state: 'home'
|
||||
- condition: state
|
||||
entity_id: device_tracker.pixel_7
|
||||
state: 'home'
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: not
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: person.clint
|
||||
state: 'home'
|
||||
sequence:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.clint_home
|
||||
|
||||
- delay: '00:00:30'
|
||||
@@ -0,0 +1,58 @@
|
||||
alias: Clint Home
|
||||
id: automation_clint_home
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
- device_tracker.pixel_7
|
||||
- person.clint
|
||||
- group.person_clint
|
||||
- device_tracker.pixel_7_wifi
|
||||
to: 'home'
|
||||
|
||||
- platform: state
|
||||
id: car_home
|
||||
entity_id:
|
||||
- binary_sensor.gray_suv_east_side
|
||||
- binary_sensor.gray_suv_west_side
|
||||
from: 'off'
|
||||
to: 'on'
|
||||
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: numeric_state
|
||||
entity_id: group.person_clint
|
||||
above: 0
|
||||
value_template: "{{ dict((states|selectattr('entity_id', 'in', state_attr('group.person_clint', 'entity_id'))|list)|groupby('state'))['home']|count }}"
|
||||
- condition: state
|
||||
entity_id: sensor.pixel_7_wifi_connection
|
||||
state: 'DreamWeaver'
|
||||
- condition: state
|
||||
entity_id: sensor.pixel_7_wifi_connection
|
||||
state: 'DreamIoT-2G'
|
||||
- condition: state
|
||||
entity_id: sensor.pixel_7_wifi_connection
|
||||
state: 'pozfam'
|
||||
- condition: state
|
||||
entity_id: sensor.pixel_7_wifi_connection
|
||||
state: 'pozfam-2.4G'
|
||||
- condition: trigger
|
||||
id: "car_home"
|
||||
sequence:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.clint_travelling
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.clint_home
|
||||
- service: automation.turn_on
|
||||
entity_id: automation.clint_at_work
|
||||
|
||||
- delay: '00:00:30'
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
initial_state: 'off'
|
||||
alias: 'clint home after work'
|
||||
id: automation_home_after_work
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: device_tracker.pixel_7
|
||||
to: 'home'
|
||||
for:
|
||||
minutes: 10
|
||||
condition:
|
||||
condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.notify_clint_work
|
||||
state: 'on'
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: time
|
||||
after: '15:00:00'
|
||||
weekday:
|
||||
- mon
|
||||
- tue
|
||||
- wed
|
||||
- thu
|
||||
- fri
|
||||
action:
|
||||
- service: homeassistant.turn_off
|
||||
entity_id: automation.clint_home_after_work
|
||||
@@ -0,0 +1,70 @@
|
||||
alias: Clint in Bed
|
||||
id: automation_clint_in_bed
|
||||
|
||||
trigger:
|
||||
# Bed in master bedroom is occupied
|
||||
- platform: state
|
||||
entity_id: binary_sensor.master_bed_occupied
|
||||
to: 'on'
|
||||
# Radio playing
|
||||
- platform: state
|
||||
entity_id: media_player.master_bedroom_clock
|
||||
to: 'playing'
|
||||
- platform: state
|
||||
entity_id: media_player.master_bedroom_clock
|
||||
to: 'idle'
|
||||
# Light on
|
||||
- platform: state
|
||||
entity_id: light.master_bedroom_hue
|
||||
to: 'on'
|
||||
# Front room unoccupied for at least 5 minutes
|
||||
- platform: state
|
||||
entity_id: input_boolean.front_room_occupied
|
||||
to: 'off'
|
||||
for:
|
||||
minutes: 5
|
||||
# Something gets plugged in
|
||||
- platform: state
|
||||
entity_id: sensor.pixel_7_charger_type
|
||||
to: "Wireless"
|
||||
- platform: state
|
||||
entity_id: sensor.pixel_7_charger_type
|
||||
to: "wireless"
|
||||
- platform: state
|
||||
entity_id: input_boolean.clint_tablet_charging
|
||||
to: 'on'
|
||||
condition:
|
||||
- alias: "An adult is home and not in bed"
|
||||
condition: or
|
||||
conditions:
|
||||
- alias: "Clint is home and not in bed"
|
||||
condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_in_bed
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_home
|
||||
state: 'on'
|
||||
- alias: "Kristy is home and not in bed"
|
||||
condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.kristy_in_bed
|
||||
state: 'off'
|
||||
- condition: state
|
||||
entity_id: input_boolean.kristy_home
|
||||
state: 'on'
|
||||
- alias: "Its between 8:30PM and 5AM"
|
||||
condition: time
|
||||
after: '20:30:00'
|
||||
before: '05:00:00'
|
||||
|
||||
- alias: "The bed is occupied"
|
||||
condition: state
|
||||
entity_id: binary_sensor.master_bed_occupied
|
||||
state: 'on'
|
||||
action:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.clint_in_bed
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
initial_state: 'on'
|
||||
alias: 'Clint Location Update'
|
||||
id: automation_clint_location_update
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
# I've moved
|
||||
- platform: state
|
||||
entity_id:
|
||||
- input_select.clint_status_dropdown
|
||||
- input_boolean.clint_home
|
||||
|
||||
condition:
|
||||
- condition: template
|
||||
value_template: '{{ trigger.from_state.state != trigger.to_state.state }}'
|
||||
|
||||
action:
|
||||
- service: script.turn_on
|
||||
entity_id: script.clint_travel_sensor
|
||||
@@ -0,0 +1,15 @@
|
||||
alias: Clint Travelling
|
||||
id: automation_clint_travelling
|
||||
initial_state: 'on'
|
||||
trigger:
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
- platform: time
|
||||
at: '21:00:00'
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_home
|
||||
state: 'off'
|
||||
action:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.clint_travelling
|
||||
@@ -0,0 +1,44 @@
|
||||
alias: 'Clint Up'
|
||||
id: automation_clint_up
|
||||
initial_state: 'on'
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: media_player.great_room
|
||||
to: 'playing'
|
||||
- platform: state
|
||||
entity_id: media_player.great_room
|
||||
to: 'idle'
|
||||
- platform: state
|
||||
entity_id: binary_sensor.master_bed_occupied
|
||||
to: 'off'
|
||||
for: '00:05:00'
|
||||
- platform: state
|
||||
entity_id:
|
||||
- binary_sensor.master_bedroom_door_contact
|
||||
- binary_sensor.master_suite_door_contact
|
||||
to: 'on'
|
||||
- platform: state
|
||||
entity_id: binary_sensor.pixel_7_is_charging
|
||||
from: 'on'
|
||||
to: 'off'
|
||||
for: '00:10:00'
|
||||
condition:
|
||||
- condition: and
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_in_bed
|
||||
state: 'on'
|
||||
- condition: time
|
||||
after: '04:00:00'
|
||||
before: '22:00:00'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.master_bed_occupied
|
||||
state: 'off'
|
||||
for: '00:01:00'
|
||||
action:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.clint_in_bed
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
alias: Clint Wakeup
|
||||
id: automation_clint_wake_up
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: binary_sensor.morning
|
||||
to: 'on'
|
||||
- platform: state
|
||||
entity_id: binary_sensor.master_bed_occupied
|
||||
to: 'on'
|
||||
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_home
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.master_bed_occupied
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.morning
|
||||
state: 'on'
|
||||
- condition: state
|
||||
entity_id: binary_sensor.work_day
|
||||
state: 'on'
|
||||
|
||||
action:
|
||||
- service: input_select.select_option
|
||||
data:
|
||||
entity_id: input_select.master_bedroom_mode
|
||||
option: 'Auto'
|
||||
|
||||
- service: homeassistant.turn_on
|
||||
data:
|
||||
entity_id: light.master_bedroom_hue
|
||||
|
||||
- delay: '00:30:00'
|
||||
@@ -0,0 +1,19 @@
|
||||
initial_state: 'on'
|
||||
alias: 'Clint changing zones'
|
||||
id: automation_clint_changing_zones
|
||||
trigger:
|
||||
# Been away for a few minutes
|
||||
- platform: state
|
||||
entity_id: device_tracker.pixel_7
|
||||
to: 'not_home'
|
||||
for: '00:05:00'
|
||||
# Arrived in a zone
|
||||
- platform: state
|
||||
entity_id: device_tracker.pixel_7
|
||||
from: 'not_home'
|
||||
condition:
|
||||
# Been at least 5 minutes
|
||||
- condition: template
|
||||
value_template: "{{ ( as_timestamp(now()) - as_timestamp(state_attr('script.clint_traveltime','last_triggered'))|float)|float > 300 }}"
|
||||
action:
|
||||
- service: script.clint_traveltime
|
||||
@@ -0,0 +1,46 @@
|
||||
alias: Clint Status at Startup
|
||||
id: automation_clint_status_at_startup
|
||||
mode: restart
|
||||
|
||||
trigger:
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.clint_home
|
||||
state: 'on'
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: time
|
||||
after: '23:30:00'
|
||||
before: '00:00:00'
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.clint_in_bed
|
||||
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.clint_is_awake
|
||||
- conditions:
|
||||
- condition: time
|
||||
after: '00:00:00'
|
||||
before: '06:00:00'
|
||||
sequence:
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.clint_in_bed
|
||||
|
||||
- service: input_boolean.turn_off
|
||||
entity_id:
|
||||
- input_boolean.clint_is_awake
|
||||
default:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id:
|
||||
- input_boolean.clint_in_bed
|
||||
|
||||
- service: input_boolean.turn_on
|
||||
entity_id:
|
||||
- input_boolean.clint_is_awake
|
||||
@@ -0,0 +1,41 @@
|
||||
alias: Set Clint Next Alarm
|
||||
id: automation_set_clint_next_alarm
|
||||
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: binary_sensor.work_day
|
||||
to: 'off'
|
||||
|
||||
- platform: state
|
||||
entity_id: binary_sensor.work_day
|
||||
to: 'on'
|
||||
|
||||
- platform: time
|
||||
at: '01:00:00'
|
||||
|
||||
- platform: homeassistant
|
||||
event: start
|
||||
|
||||
action:
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.work_day
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: input_datetime.set_datetime
|
||||
target:
|
||||
entity_id: input_datetime.clint_next_alarm
|
||||
data:
|
||||
time: "09:00:00"
|
||||
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: binary_sensor.work_day
|
||||
state: 'on'
|
||||
sequence:
|
||||
- service: input_datetime.set_datetime
|
||||
target:
|
||||
entity_id: input_datetime.clint_next_alarm
|
||||
data:
|
||||
time: "06:00:00"
|
||||
@@ -0,0 +1,40 @@
|
||||
alias: 'Wake Clint'
|
||||
|
||||
id: automation_wake_clint
|
||||
initial_state: on
|
||||
trigger:
|
||||
platform: time
|
||||
at: input_datetime.clint_next_alarm
|
||||
# condition:
|
||||
# - condition: state
|
||||
# entity_id: binary_sensor.work_day
|
||||
# state: 'on'
|
||||
action:
|
||||
- service: input_boolean.turn_off
|
||||
data:
|
||||
entity_id: input_boolean.master_bedroom_asleep
|
||||
|
||||
- service: media_player.volume_set
|
||||
data:
|
||||
entity_id: media_player.master_bedroom_clock
|
||||
volume_level: 0.95
|
||||
|
||||
- choose:
|
||||
- conditions:
|
||||
- condition: state
|
||||
entity_id: input_select.master_bedroom_mode
|
||||
state: 'off'
|
||||
sequence:
|
||||
- service: input_select.select_option
|
||||
data:
|
||||
option: Energize
|
||||
target:
|
||||
entity_id: input_select.master_bedroom_mode
|
||||
|
||||
- service: input_select.select_option
|
||||
data:
|
||||
option: Energize
|
||||
target:
|
||||
entity_id: input_select.master_bedroom_mode
|
||||
|
||||
- service: script.wake_up_the_master_bedroom
|
||||
Reference in New Issue
Block a user