Clean main branch
This commit is contained in:
@@ -1,846 +0,0 @@
|
||||
gps:
|
||||
rest_command:
|
||||
notify_n8n_lena_left_home:
|
||||
url: "https://n8n.dddennnisss.ru:8443/webhook-test/lena_left_home"
|
||||
method: POST
|
||||
content_type: "application/json"
|
||||
payload: >
|
||||
{
|
||||
"event": "lena_left_home",
|
||||
"name": "{{ state_attr('device_tracker.google_maps_118311730364158481019', 'nickname') | replace('\"', '\\\"') }}",
|
||||
"address": "{{ state_attr('device_tracker.google_maps_118311730364158481019', 'address') | replace('\"', '\\\"') }}",
|
||||
"last_updated": "{{ states.device_tracker.google_maps_118311730364158481019.last_updated }}"
|
||||
}
|
||||
|
||||
input_boolean:
|
||||
gps_recently_nearby_d_e:
|
||||
name: gps_recently_nearby_d_e
|
||||
initial: false
|
||||
icon: mdi:map-marker-distance
|
||||
|
||||
automation:
|
||||
################################################################################
|
||||
# Уведомления о местоположении
|
||||
################################################################################
|
||||
|
||||
# ===============
|
||||
# HOME (ДОМ)
|
||||
# ===============
|
||||
- id: GPS|lena_on_home
|
||||
alias: GPS|lena_on_home
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_118311730364158481019
|
||||
zone: zone.home
|
||||
event: enter
|
||||
action:
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1002006010424
|
||||
message: |
|
||||
🏠 Лена дома.
|
||||
inline_keyboard:
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
- id: GPS|lena_off_home
|
||||
alias: GPS|lena_off_home
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_118311730364158481019
|
||||
zone: zone.home
|
||||
event: leave
|
||||
action:
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1002006010424
|
||||
message: |
|
||||
💨 Лена вышла из дома.
|
||||
inline_keyboard:
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
- service: rest_command.notify_n8n_lena_left_home
|
||||
|
||||
- id: GPS|denis_on_home
|
||||
alias: GPS|denis_on_home
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_108918666344169166438
|
||||
zone: zone.home
|
||||
event: enter
|
||||
action:
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1003233671944
|
||||
message: |
|
||||
🏠 Денис дома.
|
||||
inline_keyboard:
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
- id: GPS|denis_off_home
|
||||
alias: GPS|denis_off_home
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_108918666344169166438
|
||||
zone: zone.home
|
||||
event: leave
|
||||
action:
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1003233671944
|
||||
message: |
|
||||
💨 Денис вышел из дома.
|
||||
inline_keyboard:
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
# ===============
|
||||
# RADUGA (РАДУГА)
|
||||
# ===============
|
||||
- id: GPS|lena_on_raduga
|
||||
alias: GPS|lena_on_raduga
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_118311730364158481019
|
||||
zone: zone.raduga
|
||||
event: enter
|
||||
action:
|
||||
- service: telegram_bot.send_location
|
||||
data:
|
||||
chat_id: -1002006010424
|
||||
latitude: "{{ state_attr('device_tracker.google_maps_118311730364158481019', 'latitude') }}"
|
||||
longitude: "{{ state_attr('device_tracker.google_maps_118311730364158481019', 'longitude') }}"
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1002006010424
|
||||
message: |
|
||||
🌈 Лена на радуге.
|
||||
inline_keyboard:
|
||||
- '🗺️ Где Лена:/gps_send_loc_e'
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
- id: GPS|lena_off_raduga
|
||||
alias: GPS|lena_off_raduga
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_118311730364158481019
|
||||
zone: zone.raduga
|
||||
event: leave
|
||||
action:
|
||||
- service: telegram_bot.send_location
|
||||
data:
|
||||
chat_id: -1002006010424
|
||||
latitude: "{{ state_attr('device_tracker.google_maps_118311730364158481019', 'latitude') }}"
|
||||
longitude: "{{ state_attr('device_tracker.google_maps_118311730364158481019', 'longitude') }}"
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1002006010424
|
||||
message: |
|
||||
💨 Лена уехала с радуги.
|
||||
inline_keyboard:
|
||||
- '🗺️ Где Лена:/gps_send_loc_e'
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
- id: GPS|denis_on_raduga
|
||||
alias: GPS|denis_on_raduga
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_108918666344169166438
|
||||
zone: zone.raduga
|
||||
event: enter
|
||||
action:
|
||||
- service: telegram_bot.send_location
|
||||
data:
|
||||
chat_id: -1003233671944
|
||||
latitude: "{{ state_attr('device_tracker.google_maps_108918666344169166438', 'latitude') }}"
|
||||
longitude: "{{ state_attr('device_tracker.google_maps_108918666344169166438', 'longitude') }}"
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1003233671944
|
||||
message: |
|
||||
🌈 Денис на радуге.
|
||||
inline_keyboard:
|
||||
- '🗺️ Где Денис:/gps_send_loc_d'
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
- id: GPS|denis_off_raduga
|
||||
alias: GPS|denis_off_raduga
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_108918666344169166438
|
||||
zone: zone.raduga
|
||||
event: leave
|
||||
action:
|
||||
- service: telegram_bot.send_location
|
||||
data:
|
||||
chat_id: -1003233671944
|
||||
latitude: "{{ state_attr('device_tracker.google_maps_108918666344169166438', 'latitude') }}"
|
||||
longitude: "{{ state_attr('device_tracker.google_maps_108918666344169166438', 'longitude') }}"
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1003233671944
|
||||
message: |
|
||||
💨 Денис уехал с радуги.
|
||||
inline_keyboard:
|
||||
- '🗺️ Где Денис:/gps_send_loc_d'
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
# ===============
|
||||
# CENTER (ЦЕНТР)
|
||||
# ===============
|
||||
- id: GPS|lena_on_center
|
||||
alias: GPS|lena_on_center
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_118311730364158481019
|
||||
zone: zone.tsentr
|
||||
event: enter
|
||||
action:
|
||||
- service: telegram_bot.send_location
|
||||
data:
|
||||
chat_id: -1002006010424
|
||||
latitude: "{{ state_attr('device_tracker.google_maps_118311730364158481019', 'latitude') }}"
|
||||
longitude: "{{ state_attr('device_tracker.google_maps_118311730364158481019', 'longitude') }}"
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1002006010424
|
||||
message: |
|
||||
🏙️ Лена в центре.
|
||||
inline_keyboard:
|
||||
- '🗺️ Где Лена:/gps_send_loc_e'
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
- id: GPS|lena_off_center
|
||||
alias: GPS|lena_off_center
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_118311730364158481019
|
||||
zone: zone.tsentr
|
||||
event: leave
|
||||
action:
|
||||
- service: telegram_bot.send_location
|
||||
data:
|
||||
chat_id: -1002006010424
|
||||
latitude: "{{ state_attr('device_tracker.google_maps_118311730364158481019', 'latitude') }}"
|
||||
longitude: "{{ state_attr('device_tracker.google_maps_118311730364158481019', 'longitude') }}"
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1002006010424
|
||||
message: |
|
||||
💨 Лена уехала из центра.
|
||||
inline_keyboard:
|
||||
- '🗺️ Где Лена:/gps_send_loc_e'
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
- id: GPS|denis_on_center
|
||||
alias: GPS|denis_on_center
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_108918666344169166438
|
||||
zone: zone.tsentr
|
||||
event: enter
|
||||
action:
|
||||
- service: telegram_bot.send_location
|
||||
data:
|
||||
chat_id: -1003233671944
|
||||
latitude: "{{ state_attr('device_tracker.google_maps_108918666344169166438', 'latitude') }}"
|
||||
longitude: "{{ state_attr('device_tracker.google_maps_108918666344169166438', 'longitude') }}"
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1003233671944
|
||||
message: |
|
||||
🏙️ Денис в центре.
|
||||
inline_keyboard:
|
||||
- '🗺️ Где Денис:/gps_send_loc_d'
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
- id: GPS|denis_off_center
|
||||
alias: GPS|denis_off_center
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_108918666344169166438
|
||||
zone: zone.tsentr
|
||||
event: leave
|
||||
action:
|
||||
- service: telegram_bot.send_location
|
||||
data:
|
||||
chat_id: -1003233671944
|
||||
latitude: "{{ state_attr('device_tracker.google_maps_108918666344169166438', 'latitude') }}"
|
||||
longitude: "{{ state_attr('device_tracker.google_maps_108918666344169166438', 'longitude') }}"
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1003233671944
|
||||
message: |
|
||||
💨 Денис уехал из центра.
|
||||
inline_keyboard:
|
||||
- '🗺️ Где Денис:/gps_send_loc_d'
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
# ===============
|
||||
# FAMILY (РОДИТЕЛИ)
|
||||
# ===============
|
||||
- id: GPS|lena_on_familyr
|
||||
alias: GPS|lena_on_familyr
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_118311730364158481019
|
||||
zone: zone.roditeli_leny
|
||||
event: enter
|
||||
action:
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1002006010424
|
||||
message: |
|
||||
👨👩👧 Лена у родителей.
|
||||
inline_keyboard:
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
- id: GPS|lena_off_familyr
|
||||
alias: GPS|lena_off_familyr
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_118311730364158481019
|
||||
zone: zone.roditeli_leny
|
||||
event: leave
|
||||
action:
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1002006010424
|
||||
message: |
|
||||
💨 Лена уехала от родителей.
|
||||
inline_keyboard:
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
- id: GPS|denis_on_familyr
|
||||
alias: GPS|denis_on_familyr
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_108918666344169166438
|
||||
zone: zone.roditeli_leny
|
||||
event: enter
|
||||
action:
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1003233671944
|
||||
message: |
|
||||
👨👩👧 Денис у родителей Лены.
|
||||
inline_keyboard:
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
- id: GPS|denis_off_familyr
|
||||
alias: GPS|denis_off_familyr
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_108918666344169166438
|
||||
zone: zone.roditeli_leny
|
||||
event: leave
|
||||
action:
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1003233671944
|
||||
message: |
|
||||
💨 Денис уехал от родителей Лены.
|
||||
inline_keyboard:
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
# ===============
|
||||
# JOB ELENA (РАБОТА ЛЕНЫ)
|
||||
# ===============
|
||||
- id: GPS|lena_on_job
|
||||
alias: GPS|lena_on_job
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_118311730364158481019
|
||||
zone: zone.rabota_leny
|
||||
event: enter
|
||||
action:
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1002006010424
|
||||
message: |
|
||||
💼 Лена на работе.
|
||||
inline_keyboard:
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
- id: GPS|lena_off_job
|
||||
alias: GPS|lena_off_job
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_118311730364158481019
|
||||
zone: zone.rabota_leny
|
||||
event: leave
|
||||
action:
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1002006010424
|
||||
message: |
|
||||
💨 Лена уехала с работы.
|
||||
inline_keyboard:
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
# ===============
|
||||
# YASHKA (ЯШКА)
|
||||
# ===============
|
||||
- id: GPS|lena_on_ya
|
||||
alias: GPS|lena_on_ya
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_118311730364158481019
|
||||
zone: zone.iashka
|
||||
event: enter
|
||||
action:
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1002006010424
|
||||
message: |
|
||||
🐾 Лена около Яшки.
|
||||
inline_keyboard:
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
- id: GPS|Denis_on_ya
|
||||
alias: GPS|Denis_on_ya
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_108918666344169166438
|
||||
zone: zone.iashka
|
||||
event: enter
|
||||
action:
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1003233671944
|
||||
message: |
|
||||
🐾 Денис около Яшки.
|
||||
inline_keyboard:
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
# ===============
|
||||
# TERESHKOVOI_16 (КВАРТИРА ТЕРЕШКОВОЙ)
|
||||
# ===============
|
||||
- id: GPS|lena_on_tereshkovoi_16
|
||||
alias: GPS|lena_on_tereshkovoi_16
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_118311730364158481019
|
||||
zone: zone.tereshkovoi_16
|
||||
event: enter
|
||||
action:
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1002006010424
|
||||
message: |
|
||||
🏢 Лена на квартире.
|
||||
inline_keyboard:
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
- id: GPS|lena_off_tereshkovoi_16
|
||||
alias: GPS|lena_off_tereshkovoi_16
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_118311730364158481019
|
||||
zone: zone.tereshkovoi_16
|
||||
event: leave
|
||||
action:
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1002006010424
|
||||
message: |
|
||||
💨 Лена уехала с квартиры.
|
||||
inline_keyboard:
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
- id: GPS|denis_on_tereshkovoi_16
|
||||
alias: GPS|denis_on_tereshkovoi_16
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_108918666344169166438
|
||||
zone: zone.tereshkovoi_16
|
||||
event: enter
|
||||
action:
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1003233671944
|
||||
message: |
|
||||
🏢 Денис на квартире.
|
||||
inline_keyboard:
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
- id: GPS|denis_off_tereshkovoi_16
|
||||
alias: GPS|denis_off_tereshkovoi_16
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_108918666344169166438
|
||||
zone: zone.tereshkovoi_16
|
||||
event: leave
|
||||
action:
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1003233671944
|
||||
message: |
|
||||
💨 Денис уехал с квартиры.
|
||||
inline_keyboard:
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
# ===============
|
||||
# NOVOSTROIKA (НОВОСТРОЙКА)
|
||||
# ===============
|
||||
- id: GPS|lena_on_novostroika
|
||||
alias: GPS|lena_on_novostroika
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_118311730364158481019
|
||||
zone: zone.novostroika
|
||||
event: enter
|
||||
action:
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1002006010424
|
||||
message: |
|
||||
🏗️ Лена на Новостройке.
|
||||
inline_keyboard:
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
- id: GPS|lena_off_novostroika
|
||||
alias: GPS|lena_off_novostroika
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_118311730364158481019
|
||||
zone: zone.novostroika
|
||||
event: leave
|
||||
action:
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1002006010424
|
||||
message: |
|
||||
💨 Лена уехала с Новостройки.
|
||||
inline_keyboard:
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
# ===============
|
||||
# MAMA (МАМА)
|
||||
# ===============
|
||||
- id: GPS|lena_on_mama
|
||||
alias: GPS|lena_on_mama
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_118311730364158481019
|
||||
zone: zone.mama
|
||||
event: enter
|
||||
action:
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1002006010424
|
||||
message: |
|
||||
👩👧 Лена у мамы.
|
||||
inline_keyboard:
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
- id: GPS|lena_off_mama
|
||||
alias: GPS|lena_off_mama
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_118311730364158481019
|
||||
zone: zone.mama
|
||||
event: leave
|
||||
action:
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1002006010424
|
||||
message: |
|
||||
💨 Лена уехала от мамы.
|
||||
inline_keyboard:
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
- id: GPS|denis_on_mama
|
||||
alias: GPS|denis_on_mama
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_108918666344169166438
|
||||
zone: zone.mama
|
||||
event: enter
|
||||
action:
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1003233671944
|
||||
message: |
|
||||
👨👧 Денис у мамы.
|
||||
inline_keyboard:
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
- id: GPS|denis_off_mama
|
||||
alias: GPS|denis_off_mama
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_108918666344169166438
|
||||
zone: zone.mama
|
||||
event: leave
|
||||
action:
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1003233671944
|
||||
message: |
|
||||
💨 Денис уехал от мамы.
|
||||
inline_keyboard:
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
# ===============
|
||||
# JOB DENIS (РАБОТА ДЕНИС)
|
||||
# ===============
|
||||
- id: GPS|denis_on_job
|
||||
alias: GPS|denis_on_job
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_108918666344169166438
|
||||
zone: zone.rabota
|
||||
event: enter
|
||||
action:
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1003233671944
|
||||
message: |
|
||||
💼 Денис на работе.
|
||||
inline_keyboard:
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
- id: GPS|denis_off_job
|
||||
alias: GPS|denis_off_job
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_108918666344169166438
|
||||
zone: zone.rabota
|
||||
event: leave
|
||||
action:
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1003233671944
|
||||
message: |
|
||||
💨 Денис уехал с работы.
|
||||
inline_keyboard:
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
# ===============
|
||||
# LENINSKIJ (ЛЕНИНСКИЙ)
|
||||
# ===============
|
||||
- id: GPS|denis_on_len
|
||||
alias: GPS|denis_on_len
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_108918666344169166438
|
||||
zone: zone.leninskii
|
||||
event: enter
|
||||
action:
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1003233671944
|
||||
message: |
|
||||
🏘️ Денис в Ленинском.
|
||||
inline_keyboard:
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
- id: GPS|denis_off_len
|
||||
alias: GPS|denis_off_len
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_108918666344169166438
|
||||
zone: zone.leninskii
|
||||
event: leave
|
||||
action:
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1003233671944
|
||||
message: |
|
||||
💨 Денис уехал из Ленинского.
|
||||
inline_keyboard:
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
- id: GPS|elena_on_len
|
||||
alias: GPS|elena_on_len
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_118311730364158481019
|
||||
zone: zone.leninskii
|
||||
event: enter
|
||||
action:
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1002006010424
|
||||
message: |
|
||||
🏘️ Лена в Ленинском.
|
||||
inline_keyboard:
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
- id: GPS|elena_off_len
|
||||
alias: GPS|elena_off_len
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_118311730364158481019
|
||||
zone: zone.leninskii
|
||||
event: leave
|
||||
action:
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1002006010424
|
||||
message: |
|
||||
💨 Лена уехала из Ленинского.
|
||||
inline_keyboard:
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
# ===============
|
||||
# KEMEROVO (КЕМЕРОВО)
|
||||
# ===============
|
||||
- id: GPS|denis_on_kem
|
||||
alias: GPS|denis_on_kem
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_108918666344169166438
|
||||
zone: zone.kemerovo
|
||||
event: enter
|
||||
action:
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1003233671944
|
||||
message: |
|
||||
🌆 Денис в Кемерово.
|
||||
inline_keyboard:
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
- id: GPS|denis_off_kem
|
||||
alias: GPS|denis_off_kem
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_108918666344169166438
|
||||
zone: zone.kemerovo
|
||||
event: leave
|
||||
action:
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1003233671944
|
||||
message: |
|
||||
💨 Денис уехал из Кемерово.
|
||||
inline_keyboard:
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
- id: GPS|elena_on_kem
|
||||
alias: GPS|elena_on_kem
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_118311730364158481019
|
||||
zone: zone.kemerovo
|
||||
event: enter
|
||||
action:
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1002006010424
|
||||
message: |
|
||||
🌆 Лена в Кемерово.
|
||||
inline_keyboard:
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
- id: GPS|elena_off_kem
|
||||
alias: GPS|elena_off_kem
|
||||
trigger:
|
||||
- platform: zone
|
||||
entity_id: device_tracker.google_maps_118311730364158481019
|
||||
zone: zone.kemerovo
|
||||
event: leave
|
||||
action:
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1002006010424
|
||||
message: |
|
||||
💨 Лена уехала из Кемерово.
|
||||
inline_keyboard:
|
||||
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
|
||||
|
||||
# ===============
|
||||
# УВЕДОМЛЕНИЕ: РЯДОМ (< 1км)
|
||||
# ===============
|
||||
- id: ntf|tg|GPS|distance<1km_d_e
|
||||
alias: ntf|tg|GPS|distance<1km_d_e
|
||||
mode: single
|
||||
trigger:
|
||||
- platform: template
|
||||
value_template: >-
|
||||
{% set lat1 = state_attr('device_tracker.google_maps_108918666344169166438', 'latitude') %}
|
||||
{% set lon1 = state_attr('device_tracker.google_maps_108918666344169166438', 'longitude') %}
|
||||
{% set lat2 = state_attr('device_tracker.google_maps_118311730364158481019', 'latitude') %}
|
||||
{% set lon2 = state_attr('device_tracker.google_maps_118311730364158481019', 'longitude') %}
|
||||
{% if lat1 and lon1 and lat2 and lon2 %}
|
||||
{{ distance(lat1, lon1, lat2, lon2) < 1 }}
|
||||
{% else %}
|
||||
false
|
||||
{% endif %}
|
||||
for:
|
||||
seconds: 10
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.gps_recently_nearby_d_e
|
||||
state: "off"
|
||||
- condition: template
|
||||
value_template: >
|
||||
{{ not is_state('device_tracker.google_maps_108918666344169166438', 'home') and
|
||||
not is_state('device_tracker.google_maps_118311730364158481019', 'home') }}
|
||||
action:
|
||||
- service: input_boolean.turn_on
|
||||
target:
|
||||
entity_id: input_boolean.gps_recently_nearby_d_e
|
||||
|
||||
# 1. Уведомление Денису (о Елене)
|
||||
- service: telegram_bot.send_location
|
||||
data:
|
||||
chat_id: -1002006010424
|
||||
latitude: "{{ state_attr('device_tracker.google_maps_118311730364158481019', 'latitude') }}"
|
||||
longitude: "{{ state_attr('device_tracker.google_maps_118311730364158481019', 'longitude') }}"
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1002006010424
|
||||
message: |
|
||||
🤝 Вы рядом с Еленой!
|
||||
📏 Расстояние: {{ distance(state_attr('device_tracker.google_maps_108918666344169166438', 'latitude'), state_attr('device_tracker.google_maps_108918666344169166438', 'longitude'), state_attr('device_tracker.google_maps_118311730364158481019', 'latitude'), state_attr('device_tracker.google_maps_118311730364158481019', 'longitude')) | round(2) }} км
|
||||
📍 Адрес Елены: {{ state_attr('device_tracker.google_maps_118311730364158481019', 'address') }}
|
||||
inline_keyboard:
|
||||
- '🗺️ Где Денис:/gps_send_loc_d, 🗺️ Где Лена:/gps_send_loc_e'
|
||||
- '🔙 Главное меню:/menu_back, ⚙️ Настройки GPS:/gps_control'
|
||||
|
||||
# 2. Уведомление Елене (о Денисе)
|
||||
- service: telegram_bot.send_location
|
||||
data:
|
||||
chat_id: -1003233671944
|
||||
latitude: "{{ state_attr('device_tracker.google_maps_108918666344169166438', 'latitude') }}"
|
||||
longitude: "{{ state_attr('device_tracker.google_maps_108918666344169166438', 'longitude') }}"
|
||||
- service: telegram_bot.send_message
|
||||
data:
|
||||
chat_id: -1003233671944
|
||||
message: |
|
||||
🤝 Вы рядом с Денисом!
|
||||
📏 Расстояние: {{ distance(state_attr('device_tracker.google_maps_108918666344169166438', 'latitude'), state_attr('device_tracker.google_maps_108918666344169166438', 'longitude'), state_attr('device_tracker.google_maps_118311730364158481019', 'latitude'), state_attr('device_tracker.google_maps_118311730364158481019', 'longitude')) | round(2) }} км
|
||||
📍 Адрес Дениса: {{ state_attr('device_tracker.google_maps_108918666344169166438', 'address') }}
|
||||
inline_keyboard:
|
||||
- '🗺️ Где Денис:/gps_send_loc_d, 🗺️ Где Лена:/gps_send_loc_e'
|
||||
- '🔙 Главное меню:/menu_back, ⚙️ Настройки GPS:/gps_control'
|
||||
|
||||
# Сброс вспомогательного булеана для автоматизации уведомлений в телеграм
|
||||
- id: reset_gps_recently_nearby_d_e
|
||||
alias: reset_gps_recently_nearby_d_e
|
||||
description: "Сброс тумблера после расхождения > 1 км"
|
||||
mode: single
|
||||
trigger:
|
||||
- platform: template
|
||||
value_template: >
|
||||
{% set lat1 = state_attr('device_tracker.google_maps_108918666344169166438', 'latitude') %}
|
||||
{% set lon1 = state_attr('device_tracker.google_maps_108918666344169166438', 'longitude') %}
|
||||
{% set lat2 = state_attr('device_tracker.google_maps_118311730364158481019', 'latitude') %}
|
||||
{% set lon2 = state_attr('device_tracker.google_maps_118311730364158481019', 'longitude') %}
|
||||
{% if lat1 and lon1 and lat2 and lon2 %}
|
||||
{{ distance(lat1, lon1, lat2, lon2) > 1 }}
|
||||
{% else %}
|
||||
false
|
||||
{% endif %}
|
||||
for:
|
||||
hours: 0
|
||||
minutes: 5
|
||||
seconds: 0
|
||||
condition:
|
||||
- condition: state
|
||||
entity_id: input_boolean.gps_recently_nearby_d_e
|
||||
state: "on"
|
||||
action:
|
||||
- service: input_boolean.turn_off
|
||||
target:
|
||||
entity_id: input_boolean.gps_recently_nearby_d_e
|
||||
Reference in New Issue
Block a user