mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-05-13 19:54:42 +00:00
168 lines
4.5 KiB
YAML
168 lines
4.5 KiB
YAML
#
|
|
# ─── INTEGRATIONS ───────────────────────────────────────────────────────────────
|
|
#
|
|
|
|
# https://www.home-assistant.io/components/person
|
|
person:
|
|
- name: Georgi
|
|
id: !secret georgi_user_id
|
|
user_id: !secret georgi_user_id
|
|
device_trackers:
|
|
- device_tracker.arsenic
|
|
|
|
- name: Player 2
|
|
id: !secret player_2_user_id
|
|
device_trackers:
|
|
- device_tracker.maya_phone_1
|
|
|
|
# https://www.home-assistant.io/integrations/device_tracker
|
|
device_tracker:
|
|
- platform: tile
|
|
username: !secret tile_username
|
|
password: !secret tile_password
|
|
|
|
# https://www.home-assistant.io/components/zone
|
|
zone:
|
|
- name: Home
|
|
latitude: !secret home_latitude
|
|
longitude: !secret home_longitude
|
|
radius: 20
|
|
icon: mdi:home
|
|
- name: Work
|
|
latitude: !secret work_latitude
|
|
longitude: !secret work_longitude
|
|
radius: 60
|
|
icon: mdi:worker
|
|
|
|
#
|
|
# ─── ENTITIES ───────────────────────────────────────────────────────────────────
|
|
#
|
|
|
|
input_boolean:
|
|
georgi_home:
|
|
name: Georgi home
|
|
icon: mdi:account
|
|
player_2_home:
|
|
name: Player 2 home
|
|
icon: mdi:account
|
|
|
|
binary_sensor:
|
|
- platform: template
|
|
sensors:
|
|
someone_home:
|
|
friendly_name: Someone home
|
|
device_class: presence
|
|
value_template: >
|
|
{{ is_state('input_boolean.georgi_home', 'on') or is_state('input_boolean.player_2_home', 'on') }}
|
|
icon_template: >
|
|
{% if is_state('input_boolean.georgi_home', 'on') or is_state('input_boolean.player_2_home', 'on') %} mdi:account
|
|
{% else %} mdi:account-off-outline
|
|
{% endif %}
|
|
|
|
|
|
multisensor_motion:
|
|
friendly_name: MultiSensor motion
|
|
device_class: motion
|
|
value_template: "{{ is_state('sensor.multisensor_6_burglar', '8') }}"
|
|
|
|
sensor:
|
|
- platform: history_stats
|
|
name: Quarantined percent
|
|
entity_id: device_tracker.arsenic
|
|
state: "home"
|
|
type: ratio
|
|
duration:
|
|
days: 7
|
|
end: "{{ now() }}"
|
|
|
|
- platform: history_stats
|
|
name: Quarantine times left
|
|
entity_id: device_tracker.arsenic
|
|
state: "home"
|
|
type: count
|
|
duration:
|
|
days: 7
|
|
end: "{{ now() }}"
|
|
|
|
|
|
automation:
|
|
- alias: Presence · Georgi Arrival detection
|
|
use_blueprint:
|
|
path: arrival_detection.yaml
|
|
input:
|
|
person: person.georgi
|
|
input_boolean: input_boolean.georgi_home
|
|
|
|
- alias: Presence · Player 2 Arrival detection
|
|
use_blueprint:
|
|
path: arrival_detection.yaml
|
|
input:
|
|
person: person.player_2
|
|
input_boolean: input_boolean.player_2_home
|
|
|
|
- alias: Presence · Georgi leaving
|
|
trigger:
|
|
- platform: state
|
|
entity_id: person.georgi
|
|
from: "home"
|
|
to: "not_home"
|
|
action:
|
|
- service: input_boolean.turn_off
|
|
entity_id: input_boolean.georgi_home
|
|
|
|
- alias: Presence · Player 2 leaving
|
|
trigger:
|
|
- platform: state
|
|
entity_id: person.player_2
|
|
from: "home"
|
|
to: "not_home"
|
|
action:
|
|
- service: input_boolean.turn_off
|
|
entity_id: input_boolean.player_2_home
|
|
|
|
- alias: Presence · Leaving home
|
|
trigger:
|
|
- platform: state
|
|
entity_id: binary_sensor.someone_home
|
|
to: "off"
|
|
action:
|
|
- service: script.routine_leaving_home
|
|
|
|
- alias: Presence · Coming home
|
|
trigger:
|
|
platform: state
|
|
entity_id: binary_sensor.someone_home
|
|
to: "on"
|
|
action:
|
|
- service: script.routine_coming_home
|
|
|
|
- alias: Presence · Leaving work
|
|
trigger:
|
|
platform: state
|
|
entity_id: person.georgi
|
|
from: "Work"
|
|
to: "not_home"
|
|
action:
|
|
- service: notify.telegram
|
|
data:
|
|
title: "🏠 *Presence Module · Leaving Work*"
|
|
message: "Hey, I see you're leaving work. Are you coming home?"
|
|
data:
|
|
inline_keyboard:
|
|
- "Yes:/leaving_work_to_home, No:/do_nothing"
|
|
|
|
#
|
|
# ─── CUSTOMIZATION ──────────────────────────────────────────────────────────────
|
|
#
|
|
|
|
homeassistant:
|
|
customize:
|
|
device_tracker.carbon:
|
|
icon: mdi:cellphone-iphone
|
|
|
|
device_tracker.arsenic:
|
|
icon: mdi:cellphone-iphone
|
|
|
|
group.hallway_motion:
|
|
icon: mdi:motion-sensor
|