mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-06-15 17:12:59 +00:00
Naming according to convention. Refactor routines
This commit is contained in:
@@ -2,7 +2,7 @@ binary_sensor:
|
||||
- platform: template
|
||||
sensors:
|
||||
camera_state:
|
||||
friendly_name: Security Camera
|
||||
friendly_name: Security camera
|
||||
device_class: safety
|
||||
value_template: >-
|
||||
{{ state_attr('camera.amcrest_camera', 'motion_recording') != 'on' }}
|
||||
@@ -11,7 +11,7 @@ switch:
|
||||
- platform: template
|
||||
switches:
|
||||
camera:
|
||||
friendly_name: Security Camera
|
||||
friendly_name: Security camera
|
||||
value_template: "{{ state_attr('camera.amcrest_camera', 'motion_recording') == 'on' }}"
|
||||
icon_template: >
|
||||
{% if state_attr('camera.amcrest_camera', 'motion_recording') == 'on' %} mdi:shield-home
|
||||
@@ -24,7 +24,7 @@ switch:
|
||||
|
||||
script:
|
||||
security_camera_on:
|
||||
alias: Security Camera - Turn on
|
||||
alias: Security camera - Turn on
|
||||
sequence:
|
||||
- service: camera.turn_on
|
||||
entity_id: camera.amcrest_camera
|
||||
@@ -40,7 +40,7 @@ script:
|
||||
entity_id: camera.amcrest_camera
|
||||
|
||||
security_camera_off:
|
||||
alias: Security Camera - Turn off
|
||||
alias: Security camera - Turn off
|
||||
sequence:
|
||||
- service: amcrest.goto_preset
|
||||
entity_id: camera.amcrest_camera
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# https://www.home-assistant.io/integrations/light.group/
|
||||
light:
|
||||
- platform: group
|
||||
name: Living Room Main Lights
|
||||
name: Living room main lights
|
||||
entities:
|
||||
- light.living_room_1
|
||||
- light.living_room_2
|
||||
@@ -10,7 +10,7 @@ light:
|
||||
- light.living_room_4
|
||||
|
||||
- platform: group
|
||||
name: Living Room All Lights
|
||||
name: Living room all lights
|
||||
entities:
|
||||
- light.living_room_1
|
||||
- light.living_room_2
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
automation:
|
||||
- id: cube_knock
|
||||
alias: Magic Cube - Knock - Go to bed
|
||||
alias: Magic cube - Knock - Go to bed
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: sensor.cube_multistate_input
|
||||
@@ -10,7 +10,7 @@ automation:
|
||||
entity_id: input_boolean.sleep_mode
|
||||
|
||||
- id: cube_shake
|
||||
alias: Magic Cube - Shake - Wake up
|
||||
alias: Magic cube - Shake - Wake up
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: sensor.cube_multistate_input
|
||||
@@ -26,10 +26,10 @@ automation:
|
||||
homeassistant:
|
||||
customize:
|
||||
sensor.cube_multistate_input:
|
||||
friendly_name: "Cube Input"
|
||||
friendly_name: "Cube input"
|
||||
|
||||
sensor.cube_analog_input:
|
||||
friendly_name: "Cube Rotation"
|
||||
friendly_name: "Cube rotation"
|
||||
|
||||
sensor.cube_power:
|
||||
friendly_name: "Cube Battery"
|
||||
friendly_name: "Cube battery"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
input_boolean:
|
||||
domestina:
|
||||
name: Domestina Time
|
||||
name: Domestina time
|
||||
icon: mdi:broom
|
||||
|
||||
automation:
|
||||
- alias: Domestina - Automate Start
|
||||
- alias: Domestina - Automate start
|
||||
trigger:
|
||||
platform: time
|
||||
at: "08:30:00"
|
||||
@@ -29,7 +29,7 @@ automation:
|
||||
- automation.cube_knock
|
||||
- automation.cube_shake
|
||||
|
||||
- alias: Domestina - Automate End
|
||||
- alias: Domestina - Automate end
|
||||
trigger:
|
||||
platform: time
|
||||
at: "13:00:00"
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
input_boolean:
|
||||
guest_mode:
|
||||
name: Guest Mode
|
||||
name: Guest mode
|
||||
initial: off
|
||||
icon: mdi:human-greeting
|
||||
|
||||
automation:
|
||||
- id: enable_guest_mode
|
||||
alias: Guest Mode - Enable
|
||||
alias: Guest mode - Enable
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: input_boolean.guest_mode
|
||||
@@ -21,7 +21,7 @@ automation:
|
||||
entity_id: input_boolean.speech_notifications
|
||||
|
||||
- id: disable_guest_mode
|
||||
alias: Guest Mode - Disable
|
||||
alias: Guest mode - Disable
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: input_boolean.guest_mode
|
||||
|
||||
@@ -1,58 +1,26 @@
|
||||
input_boolean:
|
||||
sleep_mode:
|
||||
name: Sleep Mode
|
||||
name: Sleep mode
|
||||
initial: off
|
||||
icon: mdi:sleep
|
||||
|
||||
automation:
|
||||
- id: enable_sleep_mode
|
||||
alias: Sleep Mode - Enable
|
||||
alias: Sleep mode - Enable
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: input_boolean.sleep_mode
|
||||
from: "off"
|
||||
to: "on"
|
||||
action:
|
||||
- service: media_player.media_stop
|
||||
entity_id: media_player.master_bedroom
|
||||
- service: fan.turn_on
|
||||
entity_id: fan.philips_airpurifier
|
||||
- service: media_player.turn_off
|
||||
entity_id:
|
||||
- media_player.living_room_tv
|
||||
- media_player.living_room_tv_2
|
||||
- service: light.turn_off
|
||||
entity_id: light.living_room_all_lights
|
||||
- delay: "00:00:02"
|
||||
- service: media_player.volume_set
|
||||
entity_id: media_player.master_bedroom
|
||||
data:
|
||||
volume_level: 0.1
|
||||
- service: script.say_discretely
|
||||
data:
|
||||
message: "Entering sleep mode. Good night!"
|
||||
- service: script.routine_bedtime
|
||||
|
||||
- id: disable_sleep_mode
|
||||
alias: Sleep Mode - Disable
|
||||
alias: Sleep mode - Disable
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: input_boolean.sleep_mode
|
||||
from: "on"
|
||||
to: "off"
|
||||
action:
|
||||
- service: media_player.volume_set
|
||||
entity_id: media_player.master_bedroom
|
||||
data:
|
||||
volume_level: 0.3
|
||||
- service: script.sarah_briefing
|
||||
- delay: "00:00:25"
|
||||
- service: script.talk
|
||||
data:
|
||||
message: "Here's some music to start the day!"
|
||||
- delay: "00:00:02"
|
||||
- service: media_player.select_source
|
||||
entity_id: media_player.master_bedroom
|
||||
data:
|
||||
source: "Evening Chill"
|
||||
- service: fan.turn_off
|
||||
entity_id: fan.philips_airpurifier
|
||||
- service: script.routine_waking_up
|
||||
|
||||
+5
-45
@@ -36,7 +36,7 @@ zone:
|
||||
|
||||
input_boolean:
|
||||
georgi_home:
|
||||
name: Georgi Home
|
||||
name: Georgi home
|
||||
icon: mdi:account
|
||||
|
||||
binary_sensor:
|
||||
@@ -55,7 +55,7 @@ binary_sensor:
|
||||
automation:
|
||||
# When my state changes to "home", wait for 15 minutes for the door to be opened, and then mark me as home
|
||||
- id: arrival_detecion
|
||||
alias: Presence - Arrival Detection
|
||||
alias: Presence - Arrival detection
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: person.georgi
|
||||
@@ -84,56 +84,16 @@ automation:
|
||||
entity_id: person.georgi
|
||||
to: "not_home"
|
||||
action:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.georgi_home
|
||||
- service: script.security_camera_on
|
||||
- service: media_player.turn_off
|
||||
entity_id:
|
||||
- media_player.living_room_tv
|
||||
- media_player.living_room_tv_2
|
||||
- service: media_player.media_stop
|
||||
entity_id: media_player.master_bedroom
|
||||
- service: light.turn_off
|
||||
entity_id: light.living_room_all_lights
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.speech_notifications
|
||||
- service: script.routine_leaving_home
|
||||
|
||||
- id: coming_home
|
||||
alias: Presence - Coming Home
|
||||
alias: Presence - Coming home
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: person.georgi
|
||||
to: "home"
|
||||
action:
|
||||
- service: script.security_camera_off
|
||||
- service: light.turn_on
|
||||
entity_id: light.living_room_all_lights
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.speech_notifications
|
||||
|
||||
- id: coming_home_welcome
|
||||
alias: Presence - Coming Home - Play welcome music
|
||||
trigger:
|
||||
platform: state
|
||||
entity_id: person.georgi
|
||||
to: "home"
|
||||
action:
|
||||
- service: media_player.shuffle_set
|
||||
entity_id: media_player.master_bedroom
|
||||
data:
|
||||
shuffle: true
|
||||
- service: media_player.select_source
|
||||
entity_id: media_player.master_bedroom
|
||||
data:
|
||||
source: Evening Chill
|
||||
# - service: media_player.turn_on
|
||||
# entity_id: media_player.living_room_tv_2
|
||||
# - delay: "00:00:10"
|
||||
# - service: spotcast.start
|
||||
# data:
|
||||
# device_name: "Living Room TV"
|
||||
# uri: "spotify:playlist:1dstTefWFQaBFTC6CjcEHd"
|
||||
# random_song: true
|
||||
- service: script.routine_coming_home
|
||||
|
||||
#
|
||||
# ─── CUSTOMIZATION ──────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
script:
|
||||
routine_bedtime:
|
||||
alias: Routine - Bedtime
|
||||
sequence:
|
||||
- service: media_player.media_stop
|
||||
entity_id: media_player.master_bedroom
|
||||
- service: fan.turn_on
|
||||
entity_id: fan.philips_airpurifier
|
||||
- service: media_player.turn_off
|
||||
entity_id:
|
||||
- media_player.living_room_tv
|
||||
- media_player.living_room_tv_2
|
||||
- service: light.turn_off
|
||||
entity_id: light.living_room_all_lights
|
||||
- delay: "00:00:02"
|
||||
- service: media_player.volume_set
|
||||
entity_id: media_player.master_bedroom
|
||||
data:
|
||||
volume_level: 0.1
|
||||
- service: script.say_discretely
|
||||
data:
|
||||
message: "Entering sleep mode. Good night!"
|
||||
@@ -0,0 +1,44 @@
|
||||
input_boolean:
|
||||
routine_welcome_home:
|
||||
name: Coming home - Say welcome
|
||||
initial: on
|
||||
icon: mdi:account-plus-outline
|
||||
|
||||
script:
|
||||
routine_coming_home:
|
||||
alias: Routine - Coming home
|
||||
sequence:
|
||||
- service: script.security_camera_off
|
||||
- service: script.coming_home_say_welcome
|
||||
- service: light.turn_on
|
||||
entity_id: light.living_room_all_lights
|
||||
- service: input_boolean.turn_on
|
||||
entity_id: input_boolean.speech_notifications
|
||||
- condition: state
|
||||
entity_id: input_boolean.routine_welcome_home
|
||||
state: "on"
|
||||
- service: media_player.shuffle_set
|
||||
entity_id: media_player.master_bedroom
|
||||
data:
|
||||
shuffle: true
|
||||
- service: media_player.select_source
|
||||
entity_id: media_player.master_bedroom
|
||||
data:
|
||||
source: Evening Chill
|
||||
# - service: media_player.turn_on
|
||||
# entity_id: media_player.living_room_tv_2
|
||||
# - delay: "00:00:10"
|
||||
# - service: spotcast.start
|
||||
# data:
|
||||
# device_name: "Living Room TV"
|
||||
# uri: "spotify:playlist:1dstTefWFQaBFTC6CjcEHd"
|
||||
# random_song: true
|
||||
coming_home_say_welcome:
|
||||
alias: Routine - Coming home - Say welcome
|
||||
sequence:
|
||||
- condition: state
|
||||
entity_id: input_boolean.routine_welcome_home
|
||||
state: "on"
|
||||
- service: script.sonos_blast
|
||||
data:
|
||||
message: "Welcome home, George!"
|
||||
@@ -0,0 +1,17 @@
|
||||
script:
|
||||
routine_leaving_home:
|
||||
alias: Routine - Leaving home
|
||||
sequence:
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.georgi_home
|
||||
- service: script.security_camera_on
|
||||
- service: media_player.turn_off
|
||||
entity_id:
|
||||
- media_player.living_room_tv
|
||||
- media_player.living_room_tv_2
|
||||
- service: media_player.media_stop
|
||||
entity_id: media_player.master_bedroom
|
||||
- service: light.turn_off
|
||||
entity_id: light.living_room_all_lights
|
||||
- service: input_boolean.turn_off
|
||||
entity_id: input_boolean.speech_notifications
|
||||
@@ -0,0 +1,20 @@
|
||||
script:
|
||||
routine_waking_up:
|
||||
alias: Routine - Waking up
|
||||
sequence:
|
||||
- service: media_player.volume_set
|
||||
entity_id: media_player.master_bedroom
|
||||
data:
|
||||
volume_level: 0.3
|
||||
- service: script.sarah_briefing
|
||||
- delay: "00:00:25"
|
||||
- service: script.talk
|
||||
data:
|
||||
message: "Here's some music to start the day!"
|
||||
- delay: "00:00:02"
|
||||
- service: media_player.select_source
|
||||
entity_id: media_player.master_bedroom
|
||||
data:
|
||||
source: "Evening Chill"
|
||||
- service: fan.turn_off
|
||||
entity_id: fan.philips_airpurifier
|
||||
@@ -2,7 +2,7 @@ binary_sensor:
|
||||
- platform: template
|
||||
sensors:
|
||||
front_door_on_off_wrapper:
|
||||
friendly_name: Front Door
|
||||
friendly_name: Front door
|
||||
device_class: door
|
||||
value_template: "{{ is_state('binary_sensor.front_door_on_off', 'on') }}"
|
||||
entity_id: binary_sensor.front_door_on_off
|
||||
@@ -18,7 +18,7 @@ binary_sensor:
|
||||
homeassistant:
|
||||
customize:
|
||||
binary_sensor.front_door_on_off:
|
||||
friendly_name: Front Door Sensor
|
||||
friendly_name: Front door sensor
|
||||
|
||||
sensor.front_door_power:
|
||||
friendly_name: Front Door Battery
|
||||
friendly_name: Front door battery
|
||||
|
||||
@@ -2,7 +2,7 @@ binary_sensor:
|
||||
- platform: template
|
||||
sensors:
|
||||
living_room_right_window_on_off_wrapper:
|
||||
friendly_name: Living Room Window
|
||||
friendly_name: Living room window
|
||||
device_class: window
|
||||
value_template: "{{ is_state('binary_sensor.living_room_right_window_on_off', 'on') }}"
|
||||
entity_id: binary_sensor.living_room_right_window_on_off
|
||||
@@ -12,7 +12,7 @@ binary_sensor:
|
||||
{% endif %}
|
||||
|
||||
bedroom_right_window_on_off_wrapper:
|
||||
friendly_name: Bedroom Window
|
||||
friendly_name: Bedroom window
|
||||
device_class: window
|
||||
value_template: "{{ is_state('binary_sensor.bedroom_right_window_on_off', 'on') }}"
|
||||
entity_id: binary_sensor.bedroom_right_window_on_off
|
||||
@@ -28,13 +28,13 @@ binary_sensor:
|
||||
homeassistant:
|
||||
customize:
|
||||
binary_sensor.living_room_right_window_on_off:
|
||||
friendly_name: Living Room Window Sensor
|
||||
friendly_name: Living room window sensor
|
||||
|
||||
sensor.living_room_right_window_power:
|
||||
friendly_name: Living Room Window Battery
|
||||
friendly_name: Living room window battery
|
||||
|
||||
binary_sensor.bedroom_right_window_on_off:
|
||||
friendly_name: Bedroom Window Sensor
|
||||
friendly_name: Bedroom window sensor
|
||||
|
||||
sensor.bedroom_right_window_power:
|
||||
friendly_name: Bedroom Window Battery
|
||||
friendly_name: Bedroom window battery
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
input_boolean:
|
||||
speech_notifications:
|
||||
name: Speech Notifications
|
||||
name: Speech notifications
|
||||
initial: on
|
||||
icon: mdi:chat
|
||||
|
||||
|
||||
@@ -54,13 +54,13 @@ sensor:
|
||||
homeassistant:
|
||||
customize:
|
||||
sensor.bedroom_weather_power:
|
||||
friendly_name: "Bedroom Weather Battery"
|
||||
friendly_name: "Bedroom weather battery"
|
||||
|
||||
sensor.bedroom_weather_temperature:
|
||||
friendly_name: "Bedroom Temperature"
|
||||
friendly_name: "Bedroom temperature"
|
||||
|
||||
sensor.bedroom_weather_pressure:
|
||||
friendly_name: "Bedroom Pressure"
|
||||
friendly_name: "Bedroom pressure"
|
||||
|
||||
sensor.bedroom_weather_humidity:
|
||||
friendly_name: "Bedroom Humidity"
|
||||
friendly_name: "Bedroom humidity"
|
||||
|
||||
Reference in New Issue
Block a user