Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save vvv279/a9d5b02bcd18a70a10d94902dd630714 to your computer and use it in GitHub Desktop.
Save vvv279/a9d5b02bcd18a70a10d94902dd630714 to your computer and use it in GitHub Desktop.
Виртуальное отслеживание человека
1. Поделюсь идеей "Умный дом с диваном, ссылка https://www.youtube.com/watch?v=firuRxAtHBA&t=8s" про виртуальное отслеживание
пользователя. Данный вариант мне нужен для того, чтобы при утрате устройства я мог вручную дать понять системе, что я дома, а также
избежать редактирование нескольких автоматизации, где участвует устройство для отслеживания. Если у нас сломался телефон, потерялся
брелок или телефон, или метка, да что угодно может произойти. От этого никто не застрахован. То достаточно нажать на кнопку, что я дома
вручную и внести изменение только в одной автоматизации. Этот виртуальный выключатель можно задействовать во многих автоматизациях для
отслеживания.
2. Создано в Packages в Home Assistant предоставляют возможность объединить различные конфигурации компонентов вместе,
ссылка https://www.home-assistant.io/docs/configuration/packages/.
family_home:
# ##############################################################################
# Виртуальная группа
# ##############################################################################
# ------------ https://www.youtube.com/watch?v=firuRxAtHBA&t=8s
input_boolean:
virt_treker_vlad:
name: Вирт трекер Влад
icon: mdi:account-check-outline
# ------------
virt_treker_enay:
name: Вирт трекер Еня
icon: mdi:account-check-outline
# ------------
virt_treker_admin:
name: Вирт трекер Лялюля
icon: mdi:account-check-outline
# ------------
virt_group_persons:
name: Вирт группа присутствия
icon: mdi:account-group-outline
# ------------
virt_wifi_vlad:
name: WIFI Влад
icon: mdi:cellphone-wireless
# ------------
virt_gps_vlad:
name: GPS Влад
icon: mdi:crosshairs-gps
# ------------
virt_wifi_enay:
name: WIFI Еня
icon: mdi:cellphone-wireless
# ------------
virt_gps_enay:
name: GPS Еня
icon: mdi:crosshairs-gps
# ------------
virt_wifi_admin:
name: WIFI Лялюля
icon: mdi:cellphone-wireless
# ------------
virt_gps_admin:
name: GPS Лялюля
icon: mdi:crosshairs-gps
automation:
# ------------ input_boolean
- alias: Вирт группа
description: ''
trigger:
- platform: state
entity_id: input_boolean.virt_treker_admin, input_boolean.virt_treker_vlad, input_boolean.virt_treker_enay
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: input_boolean.virt_treker_admin
state: 'off'
- condition: state
state: 'off'
entity_id: input_boolean.virt_treker_vlad
- condition: state
state: 'off'
entity_id: input_boolean.virt_treker_enay
sequence:
- service: input_boolean.turn_off
target:
entity_id: input_boolean.virt_group_persons
- conditions:
- condition: or
conditions:
- condition: state
entity_id: input_boolean.virt_treker_admin
state: 'on'
- condition: state
entity_id: input_boolean.virt_treker_vlad
state: 'on'
- condition: state
entity_id: input_boolean.virt_treker_enay
state: 'on'
sequence:
- service: input_boolean.turn_on
target:
entity_id: input_boolean.virt_group_persons
default: []
mode: single
# ##############################################################################
# Виртуальный трекер Ляли
# ##############################################################################
# ------------ input_boolean
- alias: Вирт трекер Ляли
description: ''
trigger:
- platform: state
entity_id: input_boolean.virt_wifi_admin, input_boolean.virt_gps_admin
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: input_boolean.virt_wifi_admin
state: 'off'
- condition: state
state: 'off'
entity_id: input_boolean.virt_gps_admin
sequence:
- service: input_boolean.turn_off
target:
entity_id: input_boolean.virt_treker_admin
- conditions:
- condition: or
conditions:
- condition: state
entity_id: input_boolean.virt_wifi_admin
state: 'on'
- condition: state
entity_id: input_boolean.virt_gps_admin
state: 'on'
sequence:
- service: input_boolean.turn_on
target:
entity_id: input_boolean.virt_treker_admin
default: []
mode: single
# ------------ device_tracker
- alias: Трекер Ляли
description: ''
trigger:
- platform: state
entity_id: device_tracker.ping_admin, device_tracker.sm_n910c
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: device_tracker.ping_admin
state: not_home
sequence:
- service: input_boolean.turn_off
target:
entity_id: input_boolean.virt_wifi_admin
- conditions:
- condition: or
conditions:
- condition: state
entity_id: device_tracker.ping_admin
state: home
sequence:
- service: input_boolean.turn_on
target:
entity_id: input_boolean.virt_wifi_admin
- conditions:
- condition: state
entity_id: device_tracker.sm_n910c
state: not_home
sequence:
- service: input_boolean.turn_off
target:
entity_id: input_boolean.virt_gps_admin
- conditions:
- condition: or
conditions:
- condition: state
entity_id: device_tracker.sm_n910c
state: home
sequence:
- service: input_boolean.turn_on
target:
entity_id: input_boolean.virt_gps_admin
default: []
mode: single
# ##############################################################################
# Виртуальный трекер Влада
# ##############################################################################
# ------------ input_boolean
- alias: Вирт трекер Влада
description: ''
trigger:
- platform: state
entity_id: input_boolean.virt_wifi_vlad, input_boolean.virt_gps_vlad
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: input_boolean.virt_wifi_vlad
state: 'off'
- condition: state
state: 'off'
entity_id: input_boolean.virt_gps_vlad
sequence:
- service: input_boolean.turn_off
target:
entity_id: input_boolean.virt_treker_vlad
- conditions:
- condition: or
conditions:
- condition: state
entity_id: input_boolean.virt_wifi_vlad
state: 'on'
- condition: state
entity_id: input_boolean.virt_gps_vlad
state: 'on'
sequence:
- service: input_boolean.turn_on
target:
entity_id: input_boolean.virt_treker_vlad
default: []
mode: single
# ------------ device_tracker
- alias: Трекер Влада
description: ''
trigger:
- platform: state
entity_id: device_tracker.ping_vlad, device_tracker.sm_g930f
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: device_tracker.ping_vlad
state: not_home
sequence:
- service: input_boolean.turn_off
target:
entity_id: input_boolean.virt_wifi_vlad
- conditions:
- condition: or
conditions:
- condition: state
entity_id: device_tracker.ping_vlad
state: home
sequence:
- service: input_boolean.turn_on
target:
entity_id: input_boolean.virt_wifi_vlad
- conditions:
- condition: state
entity_id: device_tracker.sm_g930f
state: not_home
sequence:
- service: input_boolean.turn_off
target:
entity_id: input_boolean.virt_gps_vlad
- conditions:
- condition: or
conditions:
- condition: state
entity_id: device_tracker.sm_g930f
state: home
sequence:
- service: input_boolean.turn_on
target:
entity_id: input_boolean.virt_gps_vlad
default: []
mode: single
# ##############################################################################
# Виртуальный трекер Ени
# ##############################################################################
# ------------ input_boolean
- alias: Вирт трекер Ени
description: ''
trigger:
- platform: state
entity_id: input_boolean.virt_wifi_enay, input_boolean.virt_gps_enay
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: input_boolean.virt_wifi_enay
state: 'off'
- condition: state
state: 'off'
entity_id: input_boolean.virt_gps_enay
sequence:
- service: input_boolean.turn_off
target:
entity_id: input_boolean.virt_treker_enay
- conditions:
- condition: or
conditions:
- condition: state
entity_id: input_boolean.virt_wifi_enay
state: 'on'
- condition: state
entity_id: input_boolean.virt_gps_enay
state: 'on'
sequence:
- service: input_boolean.turn_on
target:
entity_id: input_boolean.virt_treker_enay
default: []
mode: single
# ------------ device_tracker
- alias: Трекер Ени
description: ''
trigger:
- platform: state
entity_id: device_tracker.ping_enia, device_tracker.sm_n985f
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: device_tracker.ping_enia
state: not_home
sequence:
- service: input_boolean.turn_off
target:
entity_id: input_boolean.virt_wifi_enay
- conditions:
- condition: or
conditions:
- condition: state
entity_id: device_tracker.ping_enia
state: home
sequence:
- service: input_boolean.turn_on
target:
entity_id: input_boolean.virt_wifi_enay
- conditions:
- condition: state
entity_id: device_tracker.sm_n985f
state: not_home
sequence:
- service: input_boolean.turn_off
target:
entity_id: input_boolean.virt_gps_enay
- conditions:
- condition: or
conditions:
- condition: state
entity_id: device_tracker.sm_n985f
state: home
sequence:
- service: input_boolean.turn_on
target:
entity_id: input_boolean.virt_gps_enay
default: []
mode: single
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment