38 Commits

Author SHA1 Message Date
dddennnisss 9e02717ab1 router: use message: | with parse_mode: html for all messages 2026-08-11 23:21:39 +07:00
dddennnisss c05bb94bb3 router: hardcode chat_id for timer expiry, remove input_text 2026-08-11 23:09:26 +07:00
dddennnisss 233657482d router: fix chat_id int conversion for timer expiry 2026-08-11 23:06:47 +07:00
dddennnisss 2bece46034 router: add input_text for chat_id, timer expiry notification with buttons 2026-08-11 23:03:31 +07:00
dddennnisss 5ab2ca8908 router: fix button layout - action+refresh on row1, main menu on row2 2026-08-11 22:24:28 +07:00
dddennnisss c50a3bb760 router: rewrite with correct indentation, no answer_callback_query 2026-08-11 22:18:45 +07:00
dddennnisss 5ee9f871c4 router: remove all answer_callback_query (not supported) 2026-08-11 21:55:54 +07:00
dddennnisss a6be3989d3 router: add refresh button with countdown timer display 2026-08-11 21:50:50 +07:00
dddennnisss 0c10127d49 router: add 🔄 Обновить button and emoji for buttons 2026-08-11 21:45:18 +07:00
dddennnisss 792dba1372 router: fix telegram_bot.edit_message format (match telegramv2.yaml) 2026-08-11 21:09:36 +07:00
dddennnisss 603a8be6fa Fix: match telegram_bot.edit_message format from telegramv2.yaml 2026-08-11 21:09:13 +07:00
dddennnisss 206d2de2bc Fix: use telegram_bot.edit_message and remove broken answer_callback_query 2026-08-11 21:08:54 +07:00
dddennnisss be8201db84 Fix: use telegram.edit_message_text instead of telegram_bot.edit_message_text 2026-08-11 21:08:07 +07:00
dddennnisss 2a2321f62a Fix: use 'message' instead of 'text' for answer_callback_query 2026-08-11 21:06:00 +07:00
dddennnisss 35147dc8ae Fix: use 'message' instead of 'text' for answer_callback_query 2026-08-11 21:01:39 +07:00
dddennnisss 52df118500 Remove answer_callback_query (not supported in this HA version) 2026-08-11 21:00:09 +07:00
dddennnisss d619db7bc1 Fix: use data_template for answer_callback_query 2026-08-11 20:54:30 +07:00
dddennnisss 3ee920e02a Fix: answer_callback_query data structure 2026-08-11 20:54:16 +07:00
dddennnisss 34e742cb34 Fix: replace invalid regex_findfirst_index with 'in' operator 2026-08-11 20:50:56 +07:00
dddennnisss 10dc7f2cf6 Add 10-min timer to connect-accept automation 2026-08-11 18:56:01 +07:00
dddennnisss ccc4cc0190 Fix: disable auto-open after door opens, re-enable on leaving gps_home_high zone 2026-08-09 16:38:38 +07:00
dddennnisss fbea67ed55 Обновить includes/packages/intercom.yaml 2026-08-09 16:26:55 +07:00
dddennnisss f7d8f74e31 Fix: replace door sensor in controls_light.yaml (binary_sensor.e4aaec3747b2_contact → binary_sensor.isa_dw2hl_47b2_magnet_sensor) 2026-08-08 11:30:45 +07:00
dddennnisss f9713b949b Fix: replace door sensor in telegramv2.yaml (binary_sensor.e4aaec3747b2_contact → binary_sensor.isa_dw2hl_47b2_magnet_sensor) 2026-08-08 01:04:12 +07:00
dddennnisss d3f55861f2 Fix: replace door sensor binary_sensor.e4aaec3747b2_contact → binary_sensor.isa_dw2hl_47b2_magnet_sensor 2026-08-08 00:53:35 +07:00
dddennnisss aec211d7da Удалить check_trueconf.docx 2026-07-23 01:20:13 +07:00
dddennnisss a2c46a04c8 Update check_trueconf instruction with screenshots 2026-07-22 22:08:42 +07:00
dddennnisss 8b6bdbe9ff Update check_trueconf instruction with detailed Android/RuStore steps 2026-07-22 22:06:11 +07:00
dddennnisss a2b6603798 Update check_trueconf instruction with Android/RuStore 2026-07-22 22:02:56 +07:00
dddennnisss a3abcbafc7 Add check_trueconf instruction 2026-07-22 21:37:40 +07:00
dddennnisss 47eee0291f revert 9c5f315f73
revert Clean main branch
2026-07-14 17:02:06 +07:00
dddennnisss 9c5f315f73 Clean main branch 2026-07-14 09:46:49 +00:00
Hermes Agent ccb8b417f0 fix: rename bathroom/kitchen/lobby/room motion sensors to match system entity_ids 2026-07-13 12:45:08 +07:00
Hermes Agent 076aff1ce9 Add files from /homeassistant/includes/packages/ 2026-07-13 10:06:40 +07:00
Hermes Agent 8d4100bccc Add .google_maps_location_sharing.cookies.mrartifactcall_gmail_com 2026-07-13 10:05:58 +07:00
Hermes Agent a5d9952848 Add files from /homeassistant/scripts/ 2026-07-13 10:04:07 +07:00
Hermes Agent ddbbc6cc51 Add automations.yaml and scripts.yaml from HA 2026-07-13 10:02:24 +07:00
Hermes Agent d938fd56c1 Initial commit: configuration.yaml from HA 2026-07-13 09:59:11 +07:00
25 changed files with 7421 additions and 12 deletions
@@ -0,0 +1,27 @@
# Netscape HTTP Cookie File
.google.com TRUE / TRUE 1722941293 AEC Ae3NU9Pj2LCVF4jsugPZh1pEuk_K5Zpzd6F7JgV7YUSKonhrwTimIreL3w
accounts.google.com FALSE / TRUE 1709981298 OTZ 7418088_28_28_123540_24_436020
.google.com TRUE / FALSE 1770461320 SID g.a000gAgsfoSF4DIkkoDFKP-JFAz_GAmvmfkkFsYiSJOBhF7xwlXBsN1kvAgFhFAitqEdQFU42QACgYKATsSAQASFQHGX2Mixu_jowwEkWKS7NwedYZgBhoVAUF8yKobfjp0wcKMW1TMbGkSX5wz0076
.google.com TRUE / TRUE 1770461320 __Secure-1PSID g.a000gAgsfoSF4DIkkoDFKP-JFAz_GAmvmfkkFsYiSJOBhF7xwlXBcd7gleX6Ccy8NRY-3-whbAACgYKAUESAQASFQHGX2Mi495sLArFt1oW9eBe36L1uBoVAUF8yKprSYPxLUPe3HI3AAbWHVCM0076
.google.com TRUE / TRUE 1770461320 __Secure-3PSID g.a000gAgsfoSF4DIkkoDFKP-JFAz_GAmvmfkkFsYiSJOBhF7xwlXBGfSO8a8VbKKNnFSkHFJGmgACgYKAVcSAQASFQHGX2MiYIcYkqojvVZj1eCDJlZs5BoVAUF8yKr_LoVaFZymaO1JG24g-dpF0076
.google.com TRUE / FALSE 1770461320 HSID ASLWkTb8P7xDDNS9Y
.google.com TRUE / TRUE 1770461320 SSID AzZGpgpHNtGjrlmp1
.google.com TRUE / FALSE 1770461320 APISID TxFYSFUfoH6WOk1n/AyNzLXVQ4XVg3Vesh
.google.com TRUE / TRUE 1770461320 SAPISID JxIFAxfr7H_5V3E8/AAidiOKXfKmy0NEUI
.google.com TRUE / TRUE 1770461320 __Secure-1PAPISID JxIFAxfr7H_5V3E8/AAidiOKXfKmy0NEUI
.google.com TRUE / TRUE 1770461320 __Secure-3PAPISID JxIFAxfr7H_5V3E8/AAidiOKXfKmy0NEUI
accounts.google.com FALSE / TRUE 1770461320 __Host-GAPS 1:VVqfNO1bgRJhXoqb9cjn97ChPhdB0u7oCwUJpYZM5VRZbeaDEvZLMtyK-wCp8o7DR5l_phbXT_cDHt_89z9fjIbtlA174A:Ftd2WPeqmrPYXMAb
accounts.google.com FALSE / TRUE 1770461320 LSID s.RU|s.youtube:g.a000gAgsfgvnZDsSzdGZUu8oWSCugkortmh1tnR8BQLEPHHn73iPmFnm-HcCbepiXtj2lc5eagACgYKAYUSAQASFQHGX2Mi9wpl9WkCbePxBoqtZAm_ORoVAUF8yKoCSd-32165cXgdioEgNgOP0076
accounts.google.com FALSE / TRUE 1770461320 __Host-1PLSID s.RU|s.youtube:g.a000gAgsfgvnZDsSzdGZUu8oWSCugkortmh1tnR8BQLEPHHn73iPbos4BoyXh-mVOgVfcht77AACgYKAbUSAQASFQHGX2MizOWgGGXf3J5XrSbuNZjx5RoVAUF8yKpqkaShfwCeS47z6dQ_oKNO0076
accounts.google.com FALSE / TRUE 1770461320 __Host-3PLSID s.RU|s.youtube:g.a000gAgsfgvnZDsSzdGZUu8oWSCugkortmh1tnR8BQLEPHHn73iP5R3ZIsa_PGZ_KMRjI3cXVQACgYKAZgSAQASFQHGX2MiuXeUvY682zOoftvCMvgOZBoVAUF8yKp4bwjFX6Haqm3Ywo3HNP1a0076
accounts.google.com FALSE / TRUE 1770461320 ACCOUNT_CHOOSER AFx_qI7mu7pP86WkAhm_OlVLVgK_4hg-HUYVOZMLc8ipgFQE6B0DArl-7UF6A_FH88-Se-PlPlE7_3GfCV_GW3rDZ4vPszpuyRq6421Uf6mI6PV1BHcdlWiMX1Ga480hfl1LvQK_KPLefnSY6TgilgBTlk60kl9qgcqS_hb1iUxCEZ8L1QbN-WA
.google.com TRUE / FALSE 1722941321 SEARCH_SAMESITE CgQIsZoB
.google.com TRUE / TRUE 1738925326 __Secure-1PSIDTS sidts-CjEBPVxjSoGRMt9NsdtBeMfpibFfwHTU0lExdq3doNenskrCA2q9JcF9_febu803CGMwEAA
.google.com TRUE / TRUE 1738925326 __Secure-3PSIDTS sidts-CjEBPVxjSoGRMt9NsdtBeMfpibFfwHTU0lExdq3doNenskrCA2q9JcF9_febu803CGMwEAA
ogs.google.com FALSE / TRUE 1709981329 OTZ 7418089_28_28_123540_24_436020
.google.com TRUE / TRUE 1723200496 NID 511=jtc5teJXhBvLFFtka-Bt4yr0yPEeN88yKRH0nXwaxONrnECYR5g7O-HTGEEsLGyfUMPOQbsEBL5UiftPpWo1O8hu0EBj7UxzxKNxNCZFt3yT2xcyvOJvUjcpz16UecAHK3KJz00CPZs8TPOMNdwWHqLRbNEGW79kRKdeDPlEb7HRU1vw9MbsmYLhEsZ2tKrtm8jl9PT7DFGDkjPEKcfQadNgWH87sqMzYR_n2ABCsUK-edLtDu3GeXMD5IfwuMPnA9taGtrH3fcuKGwUMhIVAkScjVqHeeVx4qKW6XvUc_kiAQ
.google.com TRUE / FALSE 1738925362 SIDCC ABTWhQG9J_CFsmYD3mJL5-UbRUaIaCFhnr7w4817qJutGgSBjke3s2CSp8es7vbk_HW3m7mi
.google.com TRUE / TRUE 1738925362 __Secure-1PSIDCC ABTWhQE9gbZ9LxSTGtLZq01GqknfIynf53fGI2rkaogSFB1eYlWEW7zJa1-9e32s7oDz2Uwr
.google.com TRUE / TRUE 1738925362 __Secure-3PSIDCC ABTWhQGeTMCXSjSwZZ-e_mv8CMfMaXwYiJkjTVzHaia6vml3T5ShG6jhPZeILQqT-CXhsTxf
.google.com TRUE / TRUE 1709981363 1P_JAR 2024-02-08-10
+147
View File
@@ -0,0 +1,147 @@
- id: '1700660686552'
alias: Откл термопот, если меньше 900kwh
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.termopot_power
below: 900
for:
hours: 0
minutes: 20
seconds: 0
condition: []
action:
- service: switch.turn_off
target:
entity_id: switch.termopot
mode: single
- id: '1705247080932'
alias: Необходимо убрать бак с водой
description: ''
trigger:
- platform: state
entity_id:
- vacuum.dreame_mc1808_044c_robot_cleaner_2
attribute: clean.water_box
to: '1'
condition:
- condition: or
conditions:
- condition: state
entity_id: vacuum.dreame_mc1808_044c_robot_cleaner_2
attribute: vacuum.status_desc
state: docked
- condition: state
entity_id: vacuum.dreame_mc1808_044c_robot_cleaner_2
attribute: vacuum.status_desc
state: Charging
action:
- service: notify.telegram_id_1
metadata: {}
data:
message: Необходимо убрать бак с водой
title: Бак с водой.
mode: restart
- id: '1735571592564'
alias: ntf|tg|bosh|end_salt
description: ''
triggers:
- trigger: state
entity_id:
- timer.timer_cool_washer
from: idle
to: active
conditions:
- condition: and
conditions:
- condition: state
entity_id: binary_sensor.day_time
state: 'on'
actions:
- choose:
- conditions:
- condition: and
conditions:
- condition: state
entity_id: device_tracker.google_maps_108918666344169166438
state: not_home
- condition: state
entity_id: device_tracker.google_maps_118311730364158481019
state: home
sequence:
- repeat:
sequence:
- delay:
hours: 0
minutes: 0
seconds: 10
milliseconds: 0
- action: telegram_bot.send_message
data:
message: '{{"\U00002705"}}Сушка завершена, нужно достать бельё{{"\U00002705"}}
Осталось время: {{ state_attr (''timer.timer_cool_washer'',''duration'')
}} '
target: 330380285
inline_keyboard: " {{'↩'}} Главное меню:/menu_back, {{'\U0001F5D1'}}
Прочитано:/menu_hide"
while:
- condition: state
entity_id: timer.timer_cool_washer
state: active
alias: Лена дома, Денис не дома
- conditions:
- condition: state
entity_id: device_tracker.google_maps_108918666344169166438
state: home
sequence:
- repeat:
sequence:
- delay:
hours: 0
minutes: 0
seconds: 10
milliseconds: 0
- action: telegram_bot.send_message
data:
message: '{{"\U00002705"}}Сушка завершена, нужно достать бельё{{"\U00002705"}}
Осталось время: {{ state_attr (''timer.timer_cool_washer'',''duration'')
}} '
target: 102879274
inline_keyboard: " {{'↩'}} Главное меню:/menu_back, {{'\U0001F5D1'}}
Прочитано:/menu_hide"
while:
- condition: state
entity_id: timer.timer_cool_washer
state: active
alias: Денис дома
- conditions:
- condition: and
conditions:
- condition: state
entity_id: device_tracker.google_maps_108918666344169166438
state: not_home
- condition: state
entity_id: device_tracker.google_maps_118311730364158481019
state: not_home
sequence:
- repeat:
sequence:
- delay:
hours: 0
minutes: 0
seconds: 10
milliseconds: 0
- action: telegram_bot.send_message
data:
message: '{{"\U00002705"}}Сушка завершена, нужно достать бельё{{"\U00002705"}}'
target: 102879274
inline_keyboard: " {{'↩'}} Главное меню:/menu_back, {{'\U0001F5D1'}}
Прочитано:/menu_hide"
while:
- condition: state
entity_id: timer.timer_cool_washer
state: active
alias: Лена и Денис не дома
mode: single
+103
View File
@@ -0,0 +1,103 @@
homeassistant:
customize:
zone.home:
radius: 50
packages: !include_dir_merge_named includes/packages
time_zone: Asia/Krasnoyarsk
# Loads default set of integrations. Do not remove.
default_config:
shell_command:
tr_files: "ls /media/share/downloads > /config/tr_list_files.txt"
http:
use_x_forwarded_for: true
trusted_proxies:
- 192.168.1.0/24
ip_ban_enabled: true
login_attempts_threshold: 5
# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
template: !include template.yaml
sensor:
- platform: time_date
display_options:
- 'time'
- 'date'
- 'date_time'
- 'date_time_utc'
- 'date_time_iso'
- 'time_date'
- 'time_utc'
narodmon:
devices:
- name: "Narodmon"
sensors:
- temperature
- wind_speed
- precipitation
- pm
#telegram_bot:
# - platform: polling
# api_key: !secret api_key_bot
# allowed_chat_ids:
# - !secret telegram_id_group_home
# - !secret telegram_id_1
# - !secret telegram_id_d2
# - !secret telegram_id_el
#notify:
# - name: telegram_id_1
# platform: telegram
# chat_id: !secret telegram_id_1
# - name: telegram_id_d2
# platform: telegram
# chat_id: !secret telegram_id_d2
# - name: telegram_id_gr
# platform: telegram
# chat_id: !secret telegram_id_el
#camera:
# - platform: xiaomi_cloud_map_extractor
# host: !secret xiaomi_vacuum_host
# token: !secret xiaomi_vacuum_token
# username: !secret xiaomi_cloud_username
# password: !secret xiaomi_cloud_password
# draw: ['all']
# attributes:
# - calibration_points
# - rooms
# scan_interval: 120
vacuum:
- platform: xiaomi_vacuum
host: !secret xiaomi_vacuum_host
token: !secret xiaomi_vacuum_token
name: STYTJ01ZHM
device_tracker:
- platform: google_maps
username: "mrartifactcall@gmail.com"
max_gps_accuracy: 200
- platform: ubus
host: !secret openwrt_ip
username: !secret openwrt_user
password: !secret openwrt_pass
+846
View File
@@ -0,0 +1,846 @@
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
+12 -12
View File
@@ -21,7 +21,7 @@ bus:
resource: "https://ru.busti.me/api/notify_stop/?stop_id=460789&bus_id=11299" resource: "https://ru.busti.me/api/notify_stop/?stop_id=460789&bus_id=11299"
method: GET method: GET
scan_interval: 30 scan_interval: 30
value_template: "{{ value_json.time | default('нет данных', true) }}" value_template: "{{ value_json.time }}"
json_attributes: json_attributes:
- name - name
- time - time
@@ -34,7 +34,7 @@ bus:
resource: "https://ru.busti.me/api/notify_stop/?stop_id=8880&bus_id=11299" resource: "https://ru.busti.me/api/notify_stop/?stop_id=8880&bus_id=11299"
method: GET method: GET
scan_interval: 30 scan_interval: 30
value_template: "{{ value_json.time | default('нет данных', true) }}" value_template: "{{ value_json.time }}"
json_attributes: json_attributes:
- name - name
- time - time
@@ -47,7 +47,7 @@ bus:
resource: "https://ru.busti.me/api/notify_stop/?stop_id=87239&bus_id=11299" resource: "https://ru.busti.me/api/notify_stop/?stop_id=87239&bus_id=11299"
method: GET method: GET
scan_interval: 15 scan_interval: 15
value_template: "{{ value_json.time | default('нет данных', true) }}" value_template: "{{ value_json.time }}"
json_attributes: json_attributes:
- name - name
- time - time
@@ -62,7 +62,7 @@ bus:
resource: "https://ru.busti.me/api/notify_stop/?stop_id=9277&bus_id=751" resource: "https://ru.busti.me/api/notify_stop/?stop_id=9277&bus_id=751"
method: GET method: GET
scan_interval: 30 scan_interval: 30
value_template: "{{ value_json.time | default('нет данных', true) }}" value_template: "{{ value_json.time }}"
json_attributes: json_attributes:
- name - name
- time - time
@@ -77,7 +77,7 @@ bus:
resource: "https://ru.busti.me/api/notify_stop/?stop_id=8899&bus_id=649" resource: "https://ru.busti.me/api/notify_stop/?stop_id=8899&bus_id=649"
method: GET method: GET
scan_interval: 30 scan_interval: 30
value_template: "{{ value_json.time | default('нет данных', true) }}" value_template: "{{ value_json.time }}"
json_attributes: json_attributes:
- name - name
- time - time
@@ -92,7 +92,7 @@ bus:
resource: "https://ru.busti.me/api/notify_stop/?stop_id=8880&bus_id=696" resource: "https://ru.busti.me/api/notify_stop/?stop_id=8880&bus_id=696"
method: GET method: GET
scan_interval: 30 scan_interval: 30
value_template: "{{ value_json.time | default('нет данных', true) }}" value_template: "{{ value_json.time }}"
json_attributes: json_attributes:
- name - name
- time - time
@@ -107,7 +107,7 @@ bus:
resource: "https://ru.busti.me/api/notify_stop/?stop_id=9277&bus_id=652" resource: "https://ru.busti.me/api/notify_stop/?stop_id=9277&bus_id=652"
method: GET method: GET
scan_interval: 30 scan_interval: 30
value_template: "{{ value_json.time | default('нет данных', true) }}" value_template: "{{ value_json.time }}"
json_attributes: json_attributes:
- name - name
- time - time
@@ -125,7 +125,7 @@ bus:
resource: "https://ru.busti.me/api/notify_stop/?stop_id=9395&bus_id=647" resource: "https://ru.busti.me/api/notify_stop/?stop_id=9395&bus_id=647"
method: GET method: GET
scan_interval: 15 scan_interval: 15
value_template: "{{ value_json.time | default('нет данных', true) }}" value_template: "{{ value_json.time }}"
json_attributes: json_attributes:
- name - name
- time - time
@@ -138,7 +138,7 @@ bus:
resource: "https://ru.busti.me/api/notify_stop/?stop_id=9397&bus_id=647" resource: "https://ru.busti.me/api/notify_stop/?stop_id=9397&bus_id=647"
method: GET method: GET
scan_interval: 15 scan_interval: 15
value_template: "{{ value_json.time | default('нет данных', true) }}" value_template: "{{ value_json.time }}"
json_attributes: json_attributes:
- name - name
- time - time
@@ -151,7 +151,7 @@ bus:
resource: "https://ru.busti.me/api/notify_stop/?stop_id=9407&bus_id=647" resource: "https://ru.busti.me/api/notify_stop/?stop_id=9407&bus_id=647"
method: GET method: GET
scan_interval: 15 scan_interval: 15
value_template: "{{ value_json.time | default('нет данных', true) }}" value_template: "{{ value_json.time }}"
json_attributes: json_attributes:
- name - name
- time - time
@@ -168,7 +168,7 @@ bus:
resource: "https://ru.busti.me/api/notify_stop/?stop_id=8956&bus_id=647" resource: "https://ru.busti.me/api/notify_stop/?stop_id=8956&bus_id=647"
method: GET method: GET
scan_interval: 30 scan_interval: 30
value_template: "{{ value_json.time | default('нет данных', true) }}" value_template: "{{ value_json.time }}"
json_attributes: json_attributes:
- name - name
- time - time
@@ -181,7 +181,7 @@ bus:
resource: "https://ru.busti.me/api/notify_stop/?stop_id=125776&bus_id=647" resource: "https://ru.busti.me/api/notify_stop/?stop_id=125776&bus_id=647"
method: GET method: GET
scan_interval: 30 scan_interval: 30
value_template: "{{ value_json.time | default('нет данных', true) }}" value_template: "{{ value_json.time }}"
json_attributes: json_attributes:
- name - name
- time - time
File diff suppressed because it is too large Load Diff
+268
View File
@@ -0,0 +1,268 @@
dishwasher:
# инпут для ввода времени отложенного старта
input_datetime:
dishwasher_startinrelative:
name: INPT|dishwasher_startinrelative
has_date: false
has_time: true
input_boolean:
dishwasher_needs_unloading:
name: Нужно разобрать посуду
icon: mdi:dishwasher
script:
dw_start_select_program:
alias: dw_start_select_program_relative
sequence:
- action: homeconnect_ws.start_program
data:
device_id: 0166c54489231f7edaf804c02ab6a652
start_in:
hours: "{{ state_attr('input_datetime.dishwasher_startinrelative', 'hour') }}"
minutes: "{{ state_attr('input_datetime.dishwasher_startinrelative', 'minute') }}"
seconds: "{{ state_attr('input_datetime.dishwasher_startinrelative', 'second') }}"
dw_stop_program:
alias: dw_stop_program
sequence:
- action: button.press
target:
entity_id: button.bosch_dishwasher_abort
- service: input_datetime.set_datetime
data:
time: "00:00:00"
target:
entity_id: input_datetime.dishwasher_startinrelative
dw_install_auto_45_65_extradry_extrarinse:
alias: dw_install_auto_45_65_extradry_extrarinse
sequence:
- service: select.select_option
data:
entity_id: select.bosch_dishwasher_selected_program
option: dishcare_dishwasher_program_auto2
dw_install_quick_65_extradry_extrarinse:
alias: dw_install_quick_65_extradry_extrarinse
sequence:
- service: select.select_option
data:
entity_id: select.bosch_dishwasher_selected_program
option: dishcare_dishwasher_program_quick65
dw_install_int_70_extradry_extrarinse:
alias: dw_install_int_70_extradry_extrarinse
sequence:
- service: select.select_option
data:
entity_id: select.bosch_dishwasher_selected_program
option: dishcare_dishwasher_program_intensiv70
dw_install_eco_50_extradry_extrarinse:
alias: dw_install_eco_50_extradry_extrarinse
sequence:
- service: select.select_option
data:
entity_id: select.bosch_dishwasher_selected_program
option: dishcare_dishwasher_program_eco50
dw_install_care:
alias: dw_install_care
sequence:
- service: select.select_option
data:
entity_id: select.bosch_dishwasher_selected_program
option: dishcare_dishwasher_program_machinecare
automation:
# ==========================================
# --- СБРОС ТАЙМЕРА ПРИ СТАРТЕ ---
# ==========================================
- id: dw_refresh_inp_dttm_dw
alias: "dw|refresh_inp_dttm_dw"
description: "Сброс времени отложенного старта"
mode: single
trigger:
- platform: state
entity_id: sensor.bosch_dishwasher_operation_state
from: null
to: "Run"
- platform: state
entity_id: sensor.bosch_dishwasher_operation_state
from: null
to: "DelayedStart"
action:
- service: input_datetime.set_datetime
data:
time: "00:00:00"
target:
entity_id: input_datetime.dishwasher_startinrelative
# ==========================================
# --- УВЕДОМЛЕНИЕ О ЗАВЕРШЕНИИ И РАЗБОРЕ ---
# ==========================================
- id: ntf_tg_dw_end_wash
alias: "ntf|tg|dw|end_wash"
description: "Уведомление о завершении мойки с проверкой открытия дверцы"
mode: single
trigger:
- platform: state
entity_id: sensor.bosch_dishwasher_operation_state
from: "Run"
to: "Finished"
action:
- service: input_boolean.turn_on
target:
entity_id: input_boolean.dishwasher_needs_unloading
- repeat:
sequence:
# Отправляем уведомление в обе группы!
- service: telegram_bot.send_message
data:
chat_id:
- -1002006010424
- -1003233671944
message: "✅ <b>Мойка посуды завершена!</b> Необходимо разобрать её."
parse_mode: html
inline_keyboard:
- '🌊 Посудомойка:/dw_control'
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
# Ждем открытия дверцы до 3 часов
- wait_for_trigger:
- platform: state
entity_id: binary_sensor.bosch_dishwasher_door
to: "on"
timeout: "03:00:00"
continue_on_timeout: true
# Если дверцу открыли
- choose:
- conditions:
- condition: state
entity_id: binary_sensor.bosch_dishwasher_door
state: "on"
sequence:
- delay: "00:01:00"
# Проверяем, что она всё ещё открыта (посуду разбирают)
- condition: state
entity_id: binary_sensor.bosch_dishwasher_door
state: "on"
- service: telegram_bot.send_message
data:
chat_id:
- -1002006010424
- -1003233671944
message: "🎉 <b>Посудомойка успешно разобрана!</b>"
parse_mode: html
- service: input_boolean.turn_off
target:
entity_id: input_boolean.dishwasher_needs_unloading
until:
- condition: state
entity_id: binary_sensor.bosch_dishwasher_door
state: "on"
for:
minutes: 1
# ==========================================
# --- КОМАНДА: УСТАНОВКА ТАЙМЕРА (/time) ---
# ==========================================
- id: dw_install_time_startinrelative
alias: "dw|install_time_startinrelative"
mode: single
trigger:
- platform: event
event_type: telegram_command
event_data:
command: "/time"
- platform: event
event_type: telegram_command
event_data:
command: "/time@ha_dddennnisss_bot"
action:
- choose:
# Вариант 1: формат HH:MM (например /time 14:30)
- conditions: >
{{ trigger.event.data.args is defined and
trigger.event.data.args | length > 0 and
':' in trigger.event.data.args[0] }}
sequence:
- variables:
time_parts: "{{ trigger.event.data.args[0].split(':') }}"
- service: input_datetime.set_datetime
data:
time: "{{ '%02d:%02d:00' | format(time_parts[0] | int, time_parts[1] | int) }}"
target:
entity_id: input_datetime.dishwasher_startinrelative
- service: telegram_bot.send_message
data:
chat_id: "{{ trigger.event.data.chat_id }}"
message: "✅ Отложенный запуск через <b>{{ '%02d:%02d' | format(time_parts[0] | int, time_parts[1] | int) }}</b>"
parse_mode: html
inline_keyboard:
- '▶️ Старт программы:/toggle_dw_start, ❌ Сброс пуска:/toggle_dw_delay_clear'
- '🔙 Меню:/menu_back, 🌊 Посудомойка:/dw_control'
# Вариант 2: только минуты (например /time 45)
- conditions: >
{{ trigger.event.data.args is defined and
trigger.event.data.args | length > 0 and
trigger.event.data.args[0] | int(default=0) > 0 and
':' not in trigger.event.data.args[0] }}
sequence:
- variables:
minutes_only: "{{ trigger.event.data.args[0] | int }}"
target_hour: "{{ (minutes_only // 60) % 24 }}"
target_minute: "{{ minutes_only % 60 }}"
- service: input_datetime.set_datetime
data:
time: "{{ '%02d:%02d:00' | format(target_hour, target_minute) }}"
target:
entity_id: input_datetime.dishwasher_startinrelative
- service: telegram_bot.send_message
data:
chat_id: "{{ trigger.event.data.chat_id }}"
message: "✅ Отложенный запуск через <b>{{ '%02d:%02d' | format(target_hour, target_minute) }}</b>"
parse_mode: html
inline_keyboard:
- '▶️ Старт программы:/toggle_dw_start, ❌ Сброс пуска:/toggle_dw_delay_clear'
- '🔙 Меню:/menu_back, 🌊 Посудомойка:/dw_control'
# Ошибка: неверный формат
default:
- service: telegram_bot.send_message
data:
chat_id: "{{ trigger.event.data.chat_id }}"
message: "⚠️ Укажите время в правильном формате:\n<code>/time 14:30</code> (часы:минуты)\nили\n<code>/time 45</code> (только минуты)"
parse_mode: html
# ==========================================
# --- УВЕДОМЛЕНИЕ: МАЛО СОЛИ ---
# ==========================================
- id: ntf_tg_dw_salt_off
alias: "ntf|tg|dw_salt_off"
description: "Каждые 6 часов уведомлять, если соль закончилась"
trigger:
- platform: time_pattern
hours: "/6"
condition:
- condition: state
entity_id: sensor.bosch_dishwasher_salt
state: "nearly_empty"
action:
- service: telegram_bot.send_message
data:
chat_id:
- -1002006010424
- -1003233671944
parse_mode: html
message: |
🧂❌ <b>Внимание!</b> Соль в посудомоечной машине почти закончилась.
Пожалуйста, пополните резервуар как можно скорее.
inline_keyboard:
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
+202
View File
@@ -0,0 +1,202 @@
fun:
####################Таймеры###############################
timer:
vent_work:
name: Вытяжка в ванной – время работы
duration: "00:20:00"
vent_cooldown:
name: Вытяжка в ванной – время отдыха
duration: "01:00:00"
####################Автоматизации###############################
automation:
- alias: Вытяжка в ванной – умное включение
mode: single
trigger:
- platform: numeric_state
entity_id: sensor.datchik_temperatury_i_vlazhnosti_vanna_humidity
above: 50
- platform: state
entity_id: binary_sensor.datchik_prisutstviia_vannaia_presence
to: "on"
for: "00:10:00"
condition:
- condition: state
entity_id: timer.vent_cooldown
state: "idle"
- condition: or
conditions:
# Лето и влажность > 50
- condition: and
conditions:
- condition: template
value_template: "{{ now().month in [6,7,8] }}"
- condition: numeric_state
entity_id: sensor.datchik_temperatury_i_vlazhnosti_vanna_humidity
above: 50
# Не лето и влажность > 60
- condition: and
conditions:
- condition: template
value_template: "{{ now().month not in [6,7,8] }}"
- condition: numeric_state
entity_id: sensor.datchik_temperatury_i_vlazhnosti_vanna_humidity
above: 60
# Или присутствие
- condition: state
entity_id: binary_sensor.datchik_prisutstviia_vannaia_presence
state: "on"
action:
- service: switch.turn_on
target:
entity_id: switch.rele_zerkalo_i_ventiliatsiia_l2
- alias: Вытяжка в ванной – старт таймера при включении
mode: restart
trigger:
- platform: state
entity_id: switch.rele_zerkalo_i_ventiliatsiia_l2
to: "on"
action:
- service: timer.start
target:
entity_id: timer.vent_work
- alias: Вытяжка в ванной – выключение и cooldown
mode: restart
trigger:
- platform: event
event_type: timer.finished
event_data:
entity_id: timer.vent_work
action:
- service: switch.turn_off
target:
entity_id: switch.rele_zerkalo_i_ventiliatsiia_l2
- service: timer.start
target:
entity_id: timer.vent_cooldown
- alias: Вытяжка в ванной – периодическая проверка влажности
mode: single
trigger:
# После перезапуска Home Assistant
- platform: homeassistant
event: start
# Периодическая проверка каждые 5 минут
- platform: time_pattern
minutes: "/5"
condition:
# Вентиляция сейчас выключена
- condition: state
entity_id: switch.rele_zerkalo_i_ventiliatsiia_l2
state: "off"
# Таймер отдыха закончился
- condition: state
entity_id: timer.vent_cooldown
state: "idle"
# Влажность выше порога по сезонам
- condition: or
conditions:
# Лето → >50%
- condition: and
conditions:
- condition: template
value_template: "{{ now().month in [6,7,8] }}"
- condition: numeric_state
entity_id: sensor.datchik_temperatury_i_vlazhnosti_vanna_humidity
above: 50
# Не лето → >60%
- condition: and
conditions:
- condition: template
value_template: "{{ now().month not in [6,7,8] }}"
- condition: numeric_state
entity_id: sensor.datchik_temperatury_i_vlazhnosti_vanna_humidity
above: 60
action:
- service: switch.turn_on
target:
entity_id: switch.rele_zerkalo_i_ventiliatsiia_l2
- alias: Вытяжка в ванной – резкий рост влажности
mode: restart
trigger:
- platform: state
entity_id: sensor.datchik_temperatury_i_vlazhnosti_vanna_humidity
condition:
- condition: template
value_template: >
{% if trigger.from_state is none or trigger.to_state is none %}
false
{% else %}
{% set from_s = trigger.from_state.state %}
{% set to_s = trigger.to_state.state %}
{% if from_s in ['unknown','unavailable','none','']
or to_s in ['unknown','unavailable','none',''] %}
false
{% else %}
{{ (to_s | float - from_s | float) >= 15 }}
{% endif %}
{% endif %}
action:
- choose:
# Вытяжка уже работает → +10 минут
- conditions:
- condition: state
entity_id: switch.rele_zerkalo_i_ventiliatsiia_l2
state: "on"
sequence:
- variables:
remaining: "{{ state_attr('timer.vent_work','remaining') }}"
- service: timer.start
target:
entity_id: timer.vent_work
data:
duration: >
{% if remaining is none %}
00:10:00
{% else %}
{{ (as_timedelta(remaining) + timedelta(minutes=10)) }}
{% endif %}
# Вытяжка выключена → включить на 20 минут (игнор cooldown)
default:
- service: switch.turn_on
target:
entity_id: switch.rele_zerkalo_i_ventiliatsiia_l2
- service: timer.start
target:
entity_id: timer.vent_work
data:
duration: "00:20:00"
+164
View File
@@ -0,0 +1,164 @@
intercom:
shell_command:
update_goodline_token: "python3 /config/scripts/update_goodline_token.py {{ code }}"
open_goodline_door: 'curl -s -X GET "https://api-video.goodline.info/ords/mobile/onlinedozor/gates/Kemerovo_Serebryanyy_bor_4a_Podezd_1/open-door" -H "token: $(cat /config/scripts/goodline_token.txt)" -H "origin: https://video.online-dozor.ru" -H "referer: https://video.online-dozor.ru/" -H "user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36" -H "accept: application/json, text/plain, */*"'
command_line:
- sensor:
name: "Goodline Camera URL"
unique_id: goodline_cam_url
command: "python3 /config/scripts/get_camera.py"
scan_interval: 300
template:
- sensor:
- name: "Расстояние до подъезда"
unique_id: distance_to_intercom
unit_of_measurement: "м"
state: >
{{ distance('device_tracker.google_maps_108918666344169166438', 'zone.intercom') | multiply(1000) | round(0) }}
icon: mdi:map-marker-distance
- name: "Дистанция (Телефон)"
unique_id: distance_to_intercom_phone
unit_of_measurement: "м"
state: >
{{ distance('device_tracker.cph2573_2', 'zone.intercom') | multiply(1000) | round(0) }}
icon: mdi:cellphone-marker
input_boolean:
intercom_auto_open:
name: "Автооткрытие двери"
icon: mdi:door-open
automation:
# ==========================================
# 1. ПЕРЕХВАТ СМС (Работает ВСЕГДА)
# ==========================================
- id: catch_onlinedozor_sms_webhook
alias: "sms|catch_onlinedozor_code"
mode: single
trigger:
- platform: webhook
webhook_id: "goodline_sms_hook"
allowed_methods: [POST]
local_only: true
action:
- variables:
sms_code: "{{ trigger.json.text | regex_findall_index('[0-9]{4}') }}"
- service: telegram_bot.send_message
data:
chat_id: -1002006010424
message: "🔑 <b>Код:</b> <code>{{ sms_code }}</code>"
- service: shell_command.update_goodline_token
data:
code: "{{ sms_code }}"
# ==========================================
# 2. ВКЛЮЧЕНИЕ ТОЧНОГО GPS (Только если Авто ВКЛ)
# ==========================================
- id: turn_on_high_accuracy_at_zone
alias: "gps|turn_on_at_home_high_zone"
trigger:
- platform: zone
entity_id: device_tracker.cph2573_2
zone: zone.gps_home_high
event: enter
- platform: state
entity_id: input_boolean.intercom_auto_open
to: "on"
condition:
- condition: state
entity_id: input_boolean.intercom_auto_open
state: "on"
- condition: zone
entity_id: device_tracker.cph2573_2
zone: zone.gps_home_high
- condition: template
value_template: "{{ not is_state('binary_sensor.oneplus12_high_accuracy_mode', 'on') }}"
action:
- service: notify.mobile_app_oneplus12
data:
message: "command_high_accuracy_mode"
data:
command: "turn_on"
ttl: 0
priority: high
# ==========================================
# 3. АВТООТКРЫТИЕ ДВЕРИ (Тройное с кнопками)
# ==========================================
- id: auto_open_at_intercom_zone
alias: "intercom|open_at_zone"
trigger:
- platform: zone
entity_id: device_tracker.cph2573_2
zone: zone.intercom
event: enter
condition:
- condition: state
entity_id: input_boolean.intercom_auto_open
state: "on"
action:
# Цикл открытия двери: 3 раза с интервалом 7 секунд
- repeat:
count: 7
sequence:
- service: shell_command.open_goodline_door
# Ждем 7 секунд перед следующим открытием (кроме последнего раза)
- condition: template
value_template: "{{ repeat.index < 3 }}"
- delay:
seconds: 5
# Выключаем автооткрытие — больше не будет работать, пока не выйдешь из gps_home_high
- service: input_boolean.turn_off
target:
entity_id: input_boolean.intercom_auto_open
# Уведомление с кнопками управления
- service: telegram_bot.send_message
data:
target: -1002006010424
parse_mode: html
message: "🏠 <b>Зона INTERCOM достигнута!</b>
Дверь открыта 3 раза с интервалом 7 сек.
Автоотключение — выйди из gps_home_high, чтобы включить снова."
inline_keyboard:
- "🔔 Домофон:/intercom_menu"
- "🏠 Главное меню:/menu_back"
# Выключение точного GPS для экономии заряда
- service: notify.mobile_app_oneplus12
data:
message: "command_high_accuracy_mode"
data:
command: "turn_off"
ttl: 0
priority: high
# ==========================================
# 4. ВЫХОД ИЗ ЗОНЫ gps_home_high
# ==========================================
# Включаем автооткрытие обратно и выключаем GPS
- id: leave_gps_home_high_rearm_auto_open
alias: "gps|leave_gps_home_high_rearm_auto_open"
trigger:
- platform: zone
entity_id: device_tracker.cph2573_2
zone: zone.gps_home_high
event: leave
action:
# Включаем автооткрытие двери
- service: input_boolean.turn_on
target:
entity_id: input_boolean.intercom_auto_open
# Выключаем точный GPS для экономии заряда
- service: notify.mobile_app_oneplus12
data:
message: "command_high_accuracy_mode"
data:
command: "turn_off"
ttl: 0
priority: high
@@ -0,0 +1,659 @@
notifications_telegram:
#таймеры для уведомлений
#стиралка
timer:
timer_cool_washer:
name: "Таймер времени охлаждения белья в стиралке"
duration: '04:00:00'
automation:
#автоматизация таймеров для уведомлений
#стиралка
- alias: tmr|wshr|cool_duration_on
description: Запуск таймера продолжительности охлаждения белья
triggers:
- trigger: state
entity_id:
- sensor.stiralnaia_mashina_s_gorizontalnoi_zagruzkoi_run_state
from: Завершено
to: Охлаждение
conditions: []
actions:
- action: timer.start
metadata: {}
data: {}
target:
entity_id: timer.timer_cool_washer
mode: single
- alias: tmr|wshr|cool_duration_off
description: Остановить таймер продолжительности охлаждения белья
triggers:
- trigger: state
entity_id:
- sensor.stiralnaia_mashina_s_gorizontalnoi_zagruzkoi_run_state
from: Охлаждение
to: null
conditions: []
actions:
- action: timer.finish
metadata: {}
data: {}
target:
entity_id: timer.timer_cool_washer
mode: single
################################################################################
#home_assistant
- id: ntf|ha_start_message
alias: ntf|ha_start_message
initial_state: true
trigger:
- platform: homeassistant
event: start
action:
- delay:
hours: 0
minutes: 1
seconds: 15
milliseconds: 0
- action: telegram_bot.send_message
data:
# ЗАМЕНЕНО: target -> chat_id
chat_id: -1002006010424
message: |
{{"\U0001F567"}} Зафиксирован запуск HA в {{ states('sensor.time') }} {{"\U0001F567"}}
{{'\U0001F30D'}}Состояние proxmox:
{{'\U0001F321'}}CPU | {{'\U000023EB'}}CPU | {{'\U0001F4DD'}} RAM
{{ states ('sensor.proxmox_cpu_temperature') }} {{"\U00002103"}} | {{ states ('sensor.node_pr_cpu_used') | round(2)}} % | {{ states ('sensor.node_pr_memory_used') | round(2) }} GB
{{'\U0001F4BD'}}Disk |{{'\U000023F1'}}UpTime
{{ states ('sensor.node_pr_disk_used_percentage') | round(2) }} % | {% set s = (as_timestamp (now()) -as_timestamp(states('sensor.node_pr_last_boot')))|int(0) %}{{ '{:d}д {:02d}:{:02d}'.format (s // 86400, s % 86400 // 3600, s % 3600 // 60, s % 60) }}
{{"\U0001F4BF"}}Smb | {{"\U0001F4FA"}}Win | {{"\U0001F4FA"}}lmp-trcr | {{"\U0001F4FA"}}ngnix
{{ states ('binary_sensor.lxc_docker_101_status') }}|{{ states ('binary_sensor.qemu_wni10forjob_105_status') }}|{{ states ('binary_sensor.qemu_lampa_traccar_102_status') }}|{{ states ('binary_sensor.lxc_nginxproxymanager_108_status') }}
inline_keyboard:
- '{{''\U000021A9''}} Главное меню:/menu_back , {{''\U000021AA''}} Proxmox:/prxmx_control'
- '{{''\U0001F5D1''}} Прочитано:/menu_hide'
- id: ntf|send_auto_weather
alias: ntf|send_auto_weather
initial_state: true
trigger:
- platform: time
at: "07:20:00"
- platform: time
at: "17:15:00"
enabled: true
condition:
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
- service: telegram_bot.send_message
data:
target: [6265196444, 102879274]
message: |
{{"\U0001F308"}} Погода:
{{"\U0001FA9F"}}За окном: {%- set current = states('sensor.openweathermap_weather_code')|int %} {%- set conditions={'Туман \U0001F32B': [701, 741], 'Гроза \U0001F329': [210, 211, 212, 221], 'Дождь/Гроза \U000026C8': [200, 201, 202, 230, 231, 232], 'Облачно \U000026C5': [801, 802, 803, 804], 'Дождь \U00002614': [504, 314, 502, 503, 522, 300, 301, 302, 310, 311, 312, 313, 500, 501, 520, 521, 906], 'Снег \U00002744': [600, 601, 602, 611, 612, 620, 621, 622], 'Снег с дождём \U00002614\U00002744': [511, 615, 616], 'Ясно \U00002600': [800], 'Ветер \U0001F4A8': [905, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961], 'Внимание \U000026A0': [711, 721, 731, 751, 761, 762, 771, 900, 901, 962, 903, 904] } %} {%- for condition, value in conditions.items() %} {%- if current in value %} {{- " "+condition}} {%- endif %} {%- endfor %}
{{"\U0001F321"}}Температура: {{- " "+state_attr('weather.openweathermap','temperature')|string }} {{"\U00002103"}}
{{"\U0001F4A8"}}Ветер: {{ state_attr('weather.openweathermap', 'wind_speed') | float }} км/ч {%- if state_attr('weather.openweathermap', 'wind_speed') | float < 1 %} - Штиль {%- elif state_attr('weather.openweathermap', 'wind_speed') | float < 5 %} - Тихий {%- elif state_attr('weather.openweathermap', 'wind_speed') | float < 11 %} - Легкий {%- elif state_attr('weather.openweathermap', 'wind_speed') | float< 19 %} - Слабый {%- elif state_attr('weather.openweathermap', 'wind_speed') | float < 28 %} - Умеренный {%- elif state_attr('weather.openweathermap','wind_speed') | float < 38 %} - Свежий {%- elif state_attr('weather.openweathermap', 'wind_speed') | float < 49 %} - Сильный {%- elif state_attr('weather.openweathermap', 'wind_speed') | float < 61 %} - Крепкий {%- elif state_attr('weather.openweathermap', 'wind_speed') |float < 74 %} - Очень крепкий {%- elif state_attr('weather.openweathermap', 'wind_speed') | float < 88 %} - Шторм {%- elif state_attr('weather.openweathermap', 'wind_speed') | float < 102 %} - Сильный шторм {%- elif state_attr('weather.openweathermap', 'wind_speed') |float < 117 %} - Жестокий шторм {%- elif state_attr('weather.openweathermap', 'wind_speed') | float > 117 %} - Ураган {%- endif %}
⚠ PM10: {{states ('sensor.narodmon_particulate_matter')}} мкг/м
⌚ Почасовой прогноз:
{{state_attr('sensor.forecast_hour','datetime0')|as_timestamp()|timestamp_custom('%d.%m|%H:%M')}}
{% set c = state_attr('sensor.forecast_hour','condition0') %}
{%- if c == 'clear-night' %}🌟
{%- elif c == 'cloudy' %}☁️
{%- elif c == 'exceptional' %}⚠️
{%- elif c == 'fog' %}🌫
{%- elif c == 'hail' %}☄
{%- elif c == 'lightning' %}⚡️
{%- elif c == 'lightning-rainy' %}⛈
{%- elif c == 'partlycloudy' %}⛅️
{%- elif c == 'pouring' %}⛈
{%- elif c == 'rainy' %}☔
{%- elif c == 'snowy' %}❄️
{%- elif c == 'snowy-rainy' %}❄️/☔ С
{%- elif c == 'sunny' %}☀️
{%- elif c == 'windy' %}💨
{%- else%} Не определено {%endif%} {{state_attr('sensor.forecast_hour','temperature0')}}°C, {{state_attr('sensor.forecast_hour','wind_speed0')}} км/ч, ☔ {{state_attr('sensor.forecast_hour','precipitation_probability0')}} %
{{state_attr('sensor.forecast_hour','datetime1')|as_timestamp()|timestamp_custom('%d.%m|%H:%M')}}
{% set c = state_attr('sensor.forecast_hour','condition1') %}
{%- if c == 'clear-night' %}🌟
{%- elif c == 'cloudy' %}☁️
{%- elif c == 'exceptional' %}⚠️
{%- elif c == 'fog' %}🌫
{%- elif c == 'hail' %}☄
{%- elif c == 'lightning' %}⚡️
{%- elif c == 'lightning-rainy' %}⛈ М
{%- elif c == 'partlycloudy' %}⛅️
{%- elif c == 'pouring' %}⛈
{%- elif c == 'rainy' %}☔
{%- elif c == 'snowy' %}❄️
{%- elif c == 'snowy-rainy' %}❄️/☔ Сн
{%- elif c == 'sunny' %}☀️
{%- elif c == 'windy' %}💨
{%- else%} Не определено {%endif%} {{state_attr('sensor.forecast_hour','temperature1')}}°C, {{state_attr('sensor.forecast_hour','wind_speed1')}} км/ч, ☔ {{state_attr('sensor.forecast_hour','precipitation_probability1')}} %
{{state_attr('sensor.forecast_hour','datetime2')|as_timestamp()|timestamp_custom('%d.%m|%H:%M')}}
{% set c = state_attr('sensor.forecast_hour','condition2') %}
{%- if c == 'clear-night' %}🌟
{%- elif c == 'cloudy' %}☁️
{%- elif c == 'exceptional' %}⚠️
{%- elif c == 'fog' %}🌫
{%- elif c == 'hail' %}☄
{%- elif c == 'lightning' %}⚡️
{%- elif c == 'lightning-rainy' %}⛈ М
{%- elif c == 'partlycloudy' %}⛅️
{%- elif c == 'pouring' %}⛈
{%- elif c == 'rainy' %}☔
{%- elif c == 'snowy' %}❄️
{%- elif c == 'snowy-rainy' %}❄️/☔ Сн
{%- elif c == 'sunny' %}☀️
{%- elif c == 'windy' %}💨
{%- else%} Не определено {%endif%} {{state_attr('sensor.forecast_hour','temperature2')}}°C, {{state_attr('sensor.forecast_hour','wind_speed2')}} км/ч, ☔ {{state_attr('sensor.forecast_hour','precipitation_probability2')}} %
{{state_attr('sensor.forecast_hour','datetime3')|as_timestamp()|timestamp_custom('%d.%m|%H:%M')}}
{% set c = state_attr('sensor.forecast_hour','condition3') %}
{%- if c == 'clear-night' %}🌟
{%- elif c == 'cloudy' %}☁️
{%- elif c == 'exceptional' %}⚠️
{%- elif c == 'fog' %}🌫
{%- elif c == 'hail' %}☄
{%- elif c == 'lightning' %}⚡️
{%- elif c == 'lightning-rainy' %}⛈
{%- elif c == 'partlycloudy' %}⛅️
{%- elif c == 'pouring' %}⛈
{%- elif c == 'rainy' %}☔
{%- elif c == 'snowy' %}❄️
{%- elif c == 'snowy-rainy' %}❄️/☔
{%- elif c == 'sunny' %}☀️
{%- elif c == 'windy' %}💨
{%- else%} Не определено {%endif%} {{state_attr('sensor.forecast_hour','temperature3')}}°C, {{state_attr('sensor.forecast_hour','wind_speed3')}} км/ч, ☔ {{state_attr('sensor.forecast_hour','precipitation_probability3')}} %
{{state_attr('sensor.forecast_hour','datetime4')|as_timestamp()|timestamp_custom('%d.%m|%H:%M')}}
{% set c = state_attr('sensor.forecast_hour','condition4') %}
{%- if c == 'clear-night' %}🌟
{%- elif c == 'cloudy' %}☁️
{%- elif c == 'exceptional' %}⚠️
{%- elif c == 'fog' %}🌫
{%- elif c == 'hail' %}☄
{%- elif c == 'lightning' %}⚡️
{%- elif c == 'lightning-rainy' %}⛈ и
{%- elif c == 'partlycloudy' %}⛅️
{%- elif c == 'pouring' %}⛈
{%- elif c == 'rainy' %}☔
{%- elif c == 'snowy' %}❄️
{%- elif c == 'snowy-rainy' %}❄️/☔
{%- elif c == 'sunny' %}☀️
{%- elif c == 'windy' %}💨
{%- else%} Не определено {%endif%} {{state_attr('sensor.forecast_hour','temperature4')}}°C, {{state_attr('sensor.forecast_hour','wind_speed4')}} км/ч, ☔ {{state_attr('sensor.forecast_hour','precipitation_probability4')}} %
{{state_attr('sensor.forecast_hour','datetime5')|as_timestamp()|timestamp_custom('%d.%m|%H:%M')}}
{% set c = state_attr('sensor.forecast_hour','condition5') %}
{%- if c == 'clear-night' %}🌟
{%- elif c == 'cloudy' %}☁️
{%- elif c == 'exceptional' %}⚠️
{%- elif c == 'fog' %}🌫
{%- elif c == 'hail' %}☄
{%- elif c == 'lightning' %}⚡️
{%- elif c == 'lightning-rainy' %}⛈
{%- elif c == 'partlycloudy' %}⛅️
{%- elif c == 'pouring' %}⛈
{%- elif c == 'rainy' %}☔
{%- elif c == 'snowy' %}❄️
{%- elif c == 'snowy-rainy' %}❄️/☔ Сн
{%- elif c == 'sunny' %}☀️
{%- elif c == 'windy' %}💨
{%- else%} Не определено {%endif%} {{state_attr('sensor.forecast_hour','temperature5')}}°C, {{state_attr('sensor.forecast_hour','wind_speed5')}} км/ч, ☔ {{state_attr('sensor.forecast_hour','precipitation_probability5')}} %
{{state_attr('sensor.forecast_hour','datetime6')|as_timestamp()|timestamp_custom('%d.%m|%H:%M')}}
{% set c = state_attr('sensor.forecast_hour','condition6') %}
{%- if c == 'clear-night' %}🌟
{%- elif c == 'cloudy' %}☁️
{%- elif c == 'exceptional' %}⚠️
{%- elif c == 'fog' %}🌫
{%- elif c == 'hail' %}☄
{%- elif c == 'lightning' %}⚡️
{%- elif c == 'lightning-rainy' %}⛈
{%- elif c == 'partlycloudy' %}⛅️
{%- elif c == 'pouring' %}⛈
{%- elif c == 'rainy' %}☔
{%- elif c == 'snowy' %}❄️
{%- elif c == 'snowy-rainy' %}❄️/☔
{%- elif c == 'sunny' %}☀️
{%- elif c == 'windy' %}💨
{%- else%} Не определено {%endif%} {{state_attr('sensor.forecast_hour','temperature4')}}°C, {{state_attr('sensor.forecast_hour','wind_speed6')}} км/ч, ☔ {{state_attr('sensor.forecast_hour','precipitation_probability6')}} %
{{state_attr('sensor.forecast_hour','datetime7')|as_timestamp()|timestamp_custom('%d.%m|%H:%M')}}
{% set c = state_attr('sensor.forecast_hour','condition7') %}
{%- if c == 'clear-night' %}🌟
{%- elif c == 'cloudy' %}☁️
{%- elif c == 'exceptional' %}⚠️
{%- elif c == 'fog' %}🌫
{%- elif c == 'hail' %}☄
{%- elif c == 'lightning' %}⚡️
{%- elif c == 'lightning-rainy' %}⛈
{%- elif c == 'partlycloudy' %}⛅️
{%- elif c == 'pouring' %}⛈
{%- elif c == 'rainy' %}☔
{%- elif c == 'snowy' %}❄️
{%- elif c == 'snowy-rainy' %}❄️/☔ С
{%- elif c == 'sunny' %}☀️
{%- elif c == 'windy' %}💨
{%- else%} Не определено {%endif%} {{state_attr('sensor.forecast_hour','temperature7')}}°C, {{state_attr('sensor.forecast_hour','wind_speed7')}} км/ч, ☔ {{state_attr('sensor.forecast_hour','precipitation_probability7')}} %
{{state_attr('sensor.forecast_hour','datetime8')|as_timestamp()|timestamp_custom('%d.%m|%H:%M')}}
{% set c = state_attr('sensor.forecast_hour','condition8') %}
{%- if c == 'clear-night' %}🌟
{%- elif c == 'cloudy' %}☁️
{%- elif c == 'exceptional' %}⚠️
{%- elif c == 'fog' %}🌫
{%- elif c == 'hail' %}☄
{%- elif c == 'lightning' %}⚡️
{%- elif c == 'lightning-rainy' %}⛈
{%- elif c == 'partlycloudy' %}⛅️
{%- elif c == 'pouring' %}⛈
{%- elif c == 'rainy' %}☔
{%- elif c == 'snowy' %}❄️
{%- elif c == 'snowy-rainy' %}❄️/☔
{%- elif c == 'sunny' %}☀️
{%- elif c == 'windy' %}💨
{%- else%} Не определено {%endif%} {{state_attr('sensor.forecast_hour','temperature8')}}°C, {{state_attr('sensor.forecast_hour','wind_speed8')}} км/ч, ☔ {{state_attr('sensor.forecast_hour','precipitation_probability8')}} %
{{state_attr('sensor.forecast_hour','datetime9')|as_timestamp()|timestamp_custom('%d.%m|%H:%M')}}
{% set c = state_attr('sensor.forecast_hour','condition9') %}
{%- if c == 'clear-night' %}🌟
{%- elif c == 'cloudy' %}☁️
{%- elif c == 'exceptional' %}⚠️
{%- elif c == 'fog' %}🌫
{%- elif c == 'hail' %}☄
{%- elif c == 'lightning' %}⚡️
{%- elif c == 'lightning-rainy' %}⛈
{%- elif c == 'partlycloudy' %}⛅️
{%- elif c == 'pouring' %}⛈
{%- elif c == 'rainy' %}☔
{%- elif c == 'snowy' %}❄️
{%- elif c == 'snowy-rainy' %}❄️/☔
{%- elif c == 'sunny' %}☀️
{%- elif c == 'windy' %}💨
{%- else%} Не определено {%endif%} {{state_attr('sensor.forecast_hour','temperature9')}}°C, {{state_attr('sensor.forecast_hour','wind_speed9')}} км/ч, ☔ {{state_attr('sensor.forecast_hour','precipitation_probability9')}} %
{{state_attr('sensor.forecast_hour','datetime10')|as_timestamp()|timestamp_custom('%d.%m|%H:%M')}}
{% set c = state_attr('sensor.forecast_hour','condition10') %}
{%- if c == 'clear-night' %}🌟
{%- elif c == 'cloudy' %}☁️
{%- elif c == 'exceptional' %}⚠️
{%- elif c == 'fog' %}🌫
{%- elif c == 'hail' %}☄
{%- elif c == 'lightning' %}⚡️
{%- elif c == 'lightning-rainy' %}⛈
{%- elif c == 'partlycloudy' %}⛅️
{%- elif c == 'pouring' %}⛈
{%- elif c == 'rainy' %}☔
{%- elif c == 'snowy' %}❄️
{%- elif c == 'snowy-rainy' %}❄️/☔
{%- elif c == 'sunny' %}☀️
{%- elif c == 'windy' %}💨
{%- else%} Не определено {%endif%} {{state_attr('sensor.forecast_hour','temperature10')}}°C, {{state_attr('sensor.forecast_hour','wind_speed10')}} км/ч, ☔ {{state_attr('sensor.forecast_hour','precipitation_probability10')}} %
{{state_attr('sensor.forecast_hour','datetime11')|as_timestamp()|timestamp_custom('%d.%m|%H:%M')}}
{% set c = state_attr('sensor.forecast_hour','condition11') %}
{%- if c == 'clear-night' %}🌟
{%- elif c == 'cloudy' %}☁️
{%- elif c == 'exceptional' %}⚠️
{%- elif c == 'fog' %}🌫
{%- elif c == 'hail' %}☄
{%- elif c == 'lightning' %}⚡️
{%- elif c == 'lightning-rainy' %}⛈
{%- elif c == 'partlycloudy' %}⛅️
{%- elif c == 'pouring' %}⛈
{%- elif c == 'rainy' %}☔
{%- elif c == 'snowy' %}❄️
{%- elif c == 'snowy-rainy' %}❄️/☔
{%- elif c == 'sunny' %}☀️
{%- elif c == 'windy' %}💨
{%- else%} Не определено {%endif%} {{state_attr('sensor.forecast_hour','temperature11')}}°C, {{state_attr('sensor.forecast_hour','wind_speed11')}} км/ч, ☔ {{state_attr('sensor.forecast_hour','precipitation_probability11')}} %
inline_keyboard:
- '{{"\U0001F553"}} Почасовой прогноз:/wthr_h_control, {{''\U0001F5D3''}} Ежедневный прогноз:/wthr_d_control'
- '{{''\U000021A9''}} Главное меню:/menu_back , {{''\U000021AA''}} Обновить:/wthr_control'
- '{{''\U0001F5D1''}} Прочитано:/menu_hide'
################################################################################
#торренты
################################################################################
#стиральная машина
################################################################################
#Термопот
################################################################################
#Прихожая
- alias: ntf|door_open
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.isa_dw2hl_47b2_magnet_sensor
from: "off"
to: "on"
condition:
- condition: state
entity_id: binary_sensor.0x00158d000707efdf_motion
state: "off"
action:
- service: telegram_bot.send_message
metadata: {}
data:
message: "{{\"\\U0001F567\"}} Входная дверь открыта {{ states('sensor.time') }} "
inline_keyboard:
- '{{''\U000021A9''}} Главное меню:/menu_back , {{''\U0001F5D1''}} Прочитано:/menu_hide'
- alias: ntf|door_lock
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.isa_dw2hl_47b2_magnet_sensor
from: "on"
to: "off"
condition: []
action:
- service: telegram_bot.send_message
metadata: {}
data:
message: "{{\"\\U0001F567\"}} Входная дверь закрыта {{ states('sensor.time') }} "
inline_keyboard:
- '{{''\U000021A9''}} Главное меню:/menu_back , {{''\U0001F5D1''}} Прочитано:/menu_hide'
- alias: ntf|door_open_5min
description: ""
mode: single
triggers:
- entity_id:
- binary_sensor.isa_dw2hl_47b2_magnet_sensor
from: null
to: "on"
for:
hours: 0
minutes: 3
seconds: 0
trigger: state
conditions: []
actions:
- repeat:
sequence:
- metadata: {}
data:
message: >-
{{"\U00002757"}} Входная дверь открыта больше 5
минут{{"\U00002757"}} {{ states('sensor.time') }}
inline_keyboard:
- '{{''\U000021A9''}} Отмена уведомления:/toggle_lb_off_door'
- '{{''\U000021A9''}} Главное меню:/menu_back , {{''\U0001F5D1''}} Прочитано:/menu_hide'
action: telegram_bot.send_message
- delay:
hours: 0
minutes: 0
seconds: 30
milliseconds: 0
while:
- condition: or
conditions:
- condition: state
entity_id: binary_sensor.isa_dw2hl_47b2_magnet_sensor
state: "on"
################################################################################
#Ванная
################################################################################
#ping
#nem.dddennnisss.ru
- alias: ntf|connect_down_nem.dddennnisss.ru
description: ""
mode: single
trigger:
- platform: state
entity_id:
- binary_sensor.nem_dddennnisss_ru
from: "on"
to: "off"
for:
hours: 0
minutes: 3
seconds: 0
condition:
- condition: state
entity_id: binary_sensor.day_time
state: "on"
action:
- service: telegram_bot.send_message
data:
target:
- 102879274
inline_keyboard:
- >-
{{'\U000021A9'}} Главное меню:/menu_back , {{'\U0001F5D1'}}
Прочитано:/menu_hide
message: Пропал коннект до nem.dddennnisss.ru
#nem.dddennnisss.ru
- alias: ntf|connect_up_nem.dddennnisss.ru
description: ""
mode: single
trigger:
- platform: state
entity_id:
- binary_sensor.nem_dddennnisss_ru
from: "off"
to: "on"
for:
hours: 0
minutes: 3
seconds: 0
condition:
- condition: state
entity_id: binary_sensor.day_time
state: "on"
action:
- service: telegram_bot.send_message
data:
target:
- 102879274
inline_keyboard:
- >-
{{'\U000021A9'}} Главное меню:/menu_back , {{'\U0001F5D1'}}
Прочитано:/menu_hide
message: Поднялся коннект до nem.dddennnisss.ru
#176.222.54.79
- alias: ntf|connect_down_176.222.54.79
description: ""
mode: single
trigger:
- platform: state
entity_id:
- binary_sensor.176_222_54_79
from: "on"
to: "off"
for:
hours: 0
minutes: 1
seconds: 30
condition:
- condition: state
entity_id: binary_sensor.day_time
state: "on"
action:
- service: telegram_bot.send_message
data:
target:
- 102879274
inline_keyboard:
- >-
{{'\U000021A9'}} Главное меню:/menu_back , {{'\U0001F5D1'}}
Прочитано:/menu_hide
message: Пропал коннект до 176.222.54.79
- alias: ntf|connect_up_176.222.54.79
description: ""
mode: single
trigger:
- platform: state
entity_id:
- binary_sensor.176_222_54_79
from: "off"
to: "on"
for:
hours: 0
minutes: 3
seconds: 0
condition:
- condition: state
entity_id: binary_sensor.day_time
state: "on"
action:
- service: telegram_bot.send_message
data:
target:
- 102879274
inline_keyboard:
- >-
{{'\U000021A9'}} Главное меню:/menu_back , {{'\U0001F5D1'}}
Прочитано:/menu_hide
message: Поднялся коннект до 176.222.54.79
################################################################################
#Датчики протечки
#Обнаружена протечка
#noname датчик
- alias: ntf|water_leak_noname_on
description: ""
mode: single
triggers:
- trigger: state
entity_id:
- binary_sensor.0xa4c1386278c84377_water_leak
from: "off"
to: "on"
conditions: []
actions:
- action: telegram_bot.send_message
data:
target:
- 102879274
inline_keyboard:
- >-
{{'\U000021A9'}} Главное меню:/menu_back , {{'\U0001F5D1'}}
Прочитано:/menu_hide
message: Обнаружена протечка! Датчик noname
- alias: ntf|water_leak_noname_off
description: ""
mode: single
triggers:
- trigger: state
entity_id:
- binary_sensor.0xa4c1386278c84377_water_leak
from: "on"
to: "off"
for:
hours: 0
minutes: 1
seconds: 0
conditions: []
actions:
- action: telegram_bot.send_message
data:
target:
- 102879274
inline_keyboard:
- >-
{{'\U000021A9'}} Главное меню:/menu_back , {{'\U0001F5D1'}}
Прочитано:/menu_hide
message: Протечка устранена! Датчик noname
- action: notify.mobile_app_m2007j3sg
metadata: {}
data:
title: Датчик noname
message: "Протечка устранена!"
#aqara
- alias: ntf|water_leak_aqara_on
description: ""
mode: single
triggers:
- trigger: state
entity_id:
- binary_sensor.0x00158d000af3c1dd_water_leak
from: "off"
to: "on"
conditions: []
actions:
- action: telegram_bot.send_message
data:
target:
- 102879274
inline_keyboard:
- >-
{{'\U000021A9'}} Главное меню:/menu_back , {{'\U0001F5D1'}}
Прочитано:/menu_hide
message: Обнаружена протечка! Датчик aqara
- action: notify.mobile_app_m2007j3sg
metadata: {}
data:
title: Датчик aqara
message: "Обнаружена протечка!"
- alias: ntf|water_leak_aqara_off
description: ""
mode: single
triggers:
- trigger: state
entity_id:
- binary_sensor.0x00158d000af3c1dd_water_leak
from: "on"
to: "off"
for:
hours: 0
minutes: 1
seconds: 0
conditions: []
actions:
- action: telegram_bot.send_message
data:
target:
- 102879274
inline_keyboard:
- >-
{{'\U000021A9'}} Главное меню:/menu_back , {{'\U0001F5D1'}}
Прочитано:/menu_hide
message: Протечка устранена! Датчик aqara
- action: notify.mobile_app_m2007j3sg
metadata: {}
data:
title: Датчик aqara
message: "Протечка устранена!"
+194
View File
@@ -0,0 +1,194 @@
router:
timer:
wrt_ca_timer:
duration: '00:10:00'
name: Connect Accept Timer
automation:
- alias: ntf|tg|wrt_ip
description: Получает IP-адреса из ipset connect_accept на OpenWRT и отправляет их в Telegram
trigger:
- platform: event
event_type: telegram_command
event_data:
command: '/wrt_ip'
- platform: event
event_type: telegram_command
event_data:
command: '/wrt_ip@ha_dddennnisss_bot'
action:
- service: shell_command.get_connect_accept_ips
response_variable: wrt_ips
- service: telegram_bot.send_message
data:
chat_id: "{{ trigger.event.data.chat_id }}"
message: >
connect-accept:
{{ wrt_ips.stdout | default('Нет данных') }}
mode: single
- alias: tg|wrt_ip_add
trigger:
platform: event
event_type: telegram_command
event_data:
command: /wrt_ip_add
action:
- variables:
chat_id: "{{ trigger.event.data.chat_id }}"
ip_arg: "{{ trigger.event.data.args | join(' ') }}"
- service: shell_command.add_ip_to_connect_accept
data:
ip: "{{ ip_arg }}"
- service: telegram_bot.send_message
data:
chat_id: "{{ trigger.event.data.chat_id }}"
message: "IP {{ ip_arg }} добавлен в connect-accept"
parse_mode: none
# --- CONNECT-ACCEPT с таймером 10 мин ---
- alias: "tg|wrt_off_connect_accept"
trigger:
platform: event
event_type: telegram_command
event_data:
command: /wrt_ca_off
action:
- service: shell_command.wrt_ca_off
- service: telegram_bot.send_message
data:
chat_id: "{{ trigger.event.data.chat_id }}"
parse_mode: html
message: |
<b>connect-accept отключён</b>
Через 10:00 включится автоматически.
inline_keyboard:
- "🔛 Включить:/wrt_cb_on|{{ trigger.event.data.chat_id }}, 🔄 Обновить:/wrt_cb_refresh|{{ trigger.event.data.chat_id }}"
- "🔙 Главное меню:/menu_back"
- service: timer.start
target:
entity_id: timer.wrt_ca_timer
- alias: "tg|wrt_on_connect_accept"
trigger:
platform: event
event_type: telegram_command
event_data:
command: /wrt_ca_on
action:
- service: shell_command.wrt_ca_on
- service: telegram_bot.send_message
data:
chat_id: "{{ trigger.event.data.chat_id }}"
parse_mode: html
message: |
<b>connect-accept включён</b>
Таймер остановлен.
inline_keyboard:
- "⏸️ Отключить:/wrt_cb_off|{{ trigger.event.data.chat_id }}, 🔄 Обновить:/wrt_cb_refresh|{{ trigger.event.data.chat_id }}"
- "🔙 Главное меню:/menu_back"
- service: timer.cancel
target:
entity_id: timer.wrt_ca_timer
- alias: "tg|wrt_cb_on"
trigger:
platform: event
event_type: telegram_callback
condition:
- condition: template
value_template: "{{ 'wrt_cb_on' in trigger.event.data.data }}"
action:
- variables:
chat_id: "{{ trigger.event.data.data.split('|')[1] }}"
- service: shell_command.wrt_ca_on
- service: telegram_bot.edit_message
data:
chat_id: "{{ chat_id }}"
message_id: "{{ trigger.event.data.message.message_id }}"
parse_mode: html
message: |
<b>connect-accept включён</b>
Таймер остановлен.
inline_keyboard:
- "⏸️ Отключить:/wrt_cb_off|{{ chat_id }}, 🔄 Обновить:/wrt_cb_refresh|{{ chat_id }}"
- "🔙 Главное меню:/menu_back"
- service: timer.cancel
target:
entity_id: timer.wrt_ca_timer
- alias: "tg|wrt_cb_off"
trigger:
platform: event
event_type: telegram_callback
condition:
- condition: template
value_template: "{{ 'wrt_cb_off' in trigger.event.data.data }}"
action:
- variables:
chat_id: "{{ trigger.event.data.data.split('|')[1] }}"
- service: shell_command.wrt_ca_off
- service: telegram_bot.edit_message
data:
chat_id: "{{ chat_id }}"
message_id: "{{ trigger.event.data.message.message_id }}"
parse_mode: html
message: |
<b>connect-accept отключён</b>
Через 10:00 включится автоматически.
inline_keyboard:
- "🔛 Включить:/wrt_cb_on|{{ chat_id }}, 🔄 Обновить:/wrt_cb_refresh|{{ chat_id }}"
- "🔙 Главное меню:/menu_back"
- service: timer.start
target:
entity_id: timer.wrt_ca_timer
- alias: "tg|wrt_cb_refresh"
trigger:
platform: event
event_type: telegram_callback
condition:
- condition: template
value_template: "{{ 'wrt_cb_refresh' in trigger.event.data.data }}"
action:
- variables:
chat_id: "{{ trigger.event.data.data.split('|')[1] }}"
- service: telegram_bot.edit_message
data:
chat_id: "{{ chat_id }}"
message_id: "{{ trigger.event.data.message.message_id }}"
parse_mode: html
message: |
<b>connect-accept отключён</b>
Через {{ (as_timestamp(state_attr('timer.wrt_ca_timer', 'finishes_at')) - as_timestamp(now())) | timestamp_custom('%M:%S', false) | replace(' 0', ' 0', 1) }} включится автоматически.
inline_keyboard:
- "🔛 Включить:/wrt_cb_on|{{ chat_id }}, 🔄 Обновить:/wrt_cb_refresh|{{ chat_id }}"
- "🔙 Главное меню:/menu_back"
- alias: "wrt|timer_expired_auto_on"
trigger:
platform: event
event_type: timer.finished
event_data:
entity_id: timer.wrt_ca_timer
action:
- service: shell_command.wrt_ca_on
- service: telegram_bot.send_message
data:
chat_id: "-1002006010424"
parse_mode: html
message: |
<b>⏰ Таймер истёк!</b>
connect-accept включён автоматически.
inline_keyboard:
- "⏸️ Отключить:/wrt_cb_off|-1002006010424, 🔄 Обновить:/wrt_cb_refresh|-1002006010424"
- "🔙 Главное меню:/menu_back"
+304
View File
@@ -0,0 +1,304 @@
scooter:
sensor:
- platform: rest
name: "Traccar Daily Distance"
resource: "https://gps.dddennnisss.ru/api/reports/summary"
headers:
Authorization: "Bearer RzBFAiEA7kYylJY3l1TFjpbLP9E38CbvtV5eIteHN-f2Urj96NgCIBF800289eJIbaiOgQ4C4Jhlc7yYM1sGR2SO2Kk1M-q5eyJ1IjoxLCJlIjoiMjAyOS0xMi0zMFQxNzowMDowMC4wMDArMDA6MDAifQ"
Content-Type: "application/json"
params:
deviceId: 1
type: distance
from: "{{ now().replace(hour=0, minute=0, second=0, microsecond=0).isoformat() }}"
to: "{{ now().isoformat() }}"
json_attributes_path: "$[0]"
json_attributes:
- distance
- averageSpeed
- maxSpeed
- startTime
- endTime
value_template: "{{ value_json[0].distance | float / 1000 | round(2) }}"
unit_of_measurement: "км"
scan_interval: 60
template:
- sensor:
- name: "Самокат Пробег Сегодня"
unique_id: "scooter_daily_distance_formatted"
state: >
{{ states('sensor.traccar_daily_distance') | float | round(2) }}
unit_of_measurement: "км"
icon: mdi:map-marker-distance
- name: "Самокат Максимальная Скорость"
unique_id: "scooter_max_speed_kmh"
state: >
{% set max_speed_knots = state_attr('sensor.traccar_daily_distance', 'maxSpeed') | float %}
{{ (max_speed_knots * 1.852) | round(2) }}
unit_of_measurement: "км/ч"
icon: mdi:speedometer
attributes:
speed_in_knots: "{{ state_attr('sensor.traccar_daily_distance', 'maxSpeed') | round(2) }}"
calculation: "{{ state_attr('sensor.traccar_daily_distance', 'maxSpeed') | float }} узлов × 1.852 = {{ (state_attr('sensor.traccar_daily_distance', 'maxSpeed') | float * 1.852) | round(2) }} км/ч"
- name: "Самокат Начало Поездки"
unique_id: "scooter_start_time_local"
state: >
{% set start_time = state_attr('sensor.traccar_daily_distance', 'startTime') %}
{% if start_time %}
{{ as_timestamp(start_time) | timestamp_custom('%H:%M') }}
{% else %}
Неизвестно
{% endif %}
icon: mdi:clock-start
attributes:
utc_time: "{{ state_attr('sensor.traccar_daily_distance', 'startTime') }}"
local_time: >
{% set start_time = state_attr('sensor.traccar_daily_distance', 'startTime') %}
{% if start_time %}
{{ as_timestamp(start_time) | timestamp_custom('%H:%M (%d.%m.%Y)') }}
{% endif %}
- name: "Самокат Конец Поездки"
unique_id: "scooter_end_time_local"
state: >
{% set end_time = state_attr('sensor.traccar_daily_distance', 'endTime') %}
{% if end_time %}
{{ as_timestamp(end_time) | timestamp_custom('%H:%M') }}
{% else %}
Активно
{% endif %}
icon: mdi:clock-end
attributes:
utc_time: "{{ state_attr('sensor.traccar_daily_distance', 'endTime') }}"
local_time: >
{% set end_time = state_attr('sensor.traccar_daily_distance', 'endTime') %}
{% if end_time %}
{{ as_timestamp(end_time) | timestamp_custom('%H:%M (%d.%m.%Y)') }}
{% endif %}
- name: "Самокат Время в Дороге"
unique_id: "scooter_trip_duration"
state: >
{% set start_time = state_attr('sensor.traccar_daily_distance', 'startTime') %}
{% set end_time = state_attr('sensor.traccar_daily_distance', 'endTime') %}
{% if start_time and end_time %}
{% set duration = (as_timestamp(end_time) - as_timestamp(start_time)) / 3600 %}
{{ duration | round(1) }}
{% else %}
0
{% endif %}
unit_of_measurement: "ч"
icon: mdi:timer
- binary_sensor:
- name: "scooter_gps_data_fresh"
unique_id: scooter_gps_data_fresh
state: >-
{% set scooter_updated = now() - states.device_tracker.samokat_dddennnisss.last_updated %}
{% set you_updated = now() - states.device_tracker.google_maps_108918666344169166438.last_updated %}
{{ scooter_updated.total_seconds() < 180 and you_updated.total_seconds() < 180 }}
device_class: connectivity
attributes:
scooter_last_updated: >-
{{ (states.device_tracker.samokat_dddennnisss.last_updated + timedelta(hours=7)).strftime('%Y-%m-%d %H:%M:%S') }}
dddennnisss_last_updated: >-
{{ (states.device_tracker.google_maps_108918666344169166438.last_updated + timedelta(hours=7)).strftime('%Y-%m-%d %H:%M:%S') }}
scooter_age_seconds: >-
{{ (now() - states.device_tracker.samokat_dddennnisss.last_updated).total_seconds() | round(0) }}
dddennnisss_age_seconds: >-
{{ (now() - states.device_tracker.google_maps_108918666344169166438.last_updated).total_seconds() | round(0) }}
input_boolean:
scooter_protection_active:
name: scooter_protection_active
initial: off
automation:
- alias: ntf|tg|scooter_protection_activate
id: scooter_protection_activate
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.samokat_dddennnisss', 'latitude') %}
{% set lon2 = state_attr('device_tracker.samokat_dddennnisss', 'longitude') %}
{% if lat1 and lon1 and lat2 and lon2 %}
{{ distance(lat1, lon1, lat2, lon2) > 0.05 }}
{% else %}
false
{% endif %}
for:
minutes: 4
condition:
- condition: state
entity_id: input_boolean.scooter_protection_active
state: 'off'
# - condition: not
# conditions:
# - condition: state
# entity_id: device_tracker.samokat_dddennnisss
# state: 'home'
- condition: state
entity_id: binary_sensor.samokat_dddennnisss_motion
state: 'off'
for:
minutes: 2
- condition: template
value_template: >-
{% set scooter_updated = now() - states.device_tracker.samokat_dddennnisss.last_updated %}
{% set you_updated = now() - states.device_tracker.google_maps_108918666344169166438.last_updated %}
{{ scooter_updated.total_seconds() < 180 and you_updated.total_seconds() < 180 }}
action:
- service: input_boolean.turn_on
target:
entity_id: input_boolean.scooter_protection_active
- service: telegram_bot.send_message
data:
chat_id: -1002006010424
message: >-
⚠️ Самокат поставлен в режим защиты!
📈 Скорость: {{ states('sensor.samokat_dddennnisss_speed') }} км/ч
🏃‍♂️ Движение: {% if is_state('binary_sensor.samokat_dddennnisss_motion', 'on') %}Да{% else %}Нет{% endif %}
{% if is_state('input_boolean.scooter_protection_active', 'on') %}🔐 Включена блокировка{% else %}🔒 Отключена блокировка{% endif %}
🛰️ GPS данные свежие: {% if is_state('binary_sensor.scooter_gps_data_fresh', 'on') %}Да ✅{% else %}Нет ❌{% endif %}
⏳ Геоданные самоката: {{ (state_attr('binary_sensor.scooter_gps_data_fresh', 'scooter_age_seconds') or 0) | int }} сек
⏳ Геоданные ddd: {{ (state_attr('binary_sensor.scooter_gps_data_fresh', 'dddennnisss_age_seconds') or 0) | int }} сек
📍 Расстояние до самоката: {{
distance(
state_attr('device_tracker.google_maps_108918666344169166438', 'latitude'),
state_attr('device_tracker.google_maps_108918666344169166438', 'longitude'),
state_attr('device_tracker.samokat_dddennnisss', 'latitude'),
state_attr('device_tracker.samokat_dddennnisss', 'longitude')
) | round(2)
}} км.
inline_keyboard:
- '🔓 Снять защиту:/sc_r_unlocked'
- '🛴 Самокат:/sc_control, ↩️ Меню:/menu_back'
- id: tg|mn|scooter_protection_deactivate
alias: tg|scooter_protection_deactivate
initial_state: true
trigger:
- platform: event
event_type: telegram_callback
event_data: {}
action:
- choose:
- conditions:
- condition: template
value_template: '{{ trigger.event.data.command == "/sc_r_unlocked" }}'
sequence:
- service: input_boolean.turn_off
target:
entity_id: input_boolean.scooter_protection_active
- service: telegram_bot.answer_callback_query
data:
callback_query_id: "{{ trigger.event.data.id }}"
message: "Защита самоката снята."
show_alert: false
- service: telegram_bot.delete_message
data_template:
message_id: '{{ trigger.event.data.message.message_id }}'
chat_id: '{{ trigger.event.data.chat_id }}'
- service: telegram_bot.send_message
data:
chat_id: '{{ trigger.event.data.chat_id }}'
message: "✅ Защита самоката успешно снята."
inline_keyboard:
- '🔓 Включить защиту:/sc_r_locked'
- '{{''\U0001F6F4''}} Самокат:/sc_control, {{''\U000021A9''}} Меню:/menu_back'
- id: tg|mn|scooter_protection_activate
alias: tg|scooter_protection_activate
initial_state: true
trigger:
- platform: event
event_type: telegram_callback
event_data: {}
action:
- choose:
- conditions:
- condition: template
value_template: '{{ trigger.event.data.command == "/sc_r_locked" }}'
sequence:
- service: input_boolean.turn_on
target:
entity_id: input_boolean.scooter_protection_active
- service: telegram_bot.answer_callback_query
data:
callback_query_id: "{{ trigger.event.data.id }}"
message: "Защита самоката включена."
show_alert: false
- service: telegram_bot.delete_message
data_template:
message_id: '{{ trigger.event.data.message.message_id }}'
chat_id: '{{ trigger.event.data.chat_id }}'
- service: telegram_bot.send_message
data:
chat_id: '{{ trigger.event.data.chat_id }}'
message: "✅ Защита самоката успешно включена."
inline_keyboard:
- '🔓 Снять защиту:/sc_r_unlocked'
- '{{''\U0001F6F4''}} Самокат:/sc_control, {{''\U000021A9''}} Меню:/menu_back'
- alias: ntf|tg|scooter_protection_alert
id: ntf_tg_scooter_protection_alert
mode: single
trigger:
- platform: template
value_template: >
{{
is_state('binary_sensor.samokat_dddennnisss_motion', 'on') and
(states('sensor.samokat_dddennnisss_speed') | float > 5.0) and
is_state('input_boolean.scooter_protection_active', 'on')
}}
for:
seconds: 40
condition:
# - condition: template
# value_template: >
# {{ (as_timestamp(now()) - as_timestamp(states.binary_sensor.samokat_dddennnisss_motion.last_changed)) > 15 }}
# - condition: template
# value_template: >
# {{ (as_timestamp(now()) - as_timestamp(states.sensor.samokat_dddennnisss_speed.last_changed)) > 15 }}
action:
- repeat:
while:
- condition: state
entity_id: input_boolean.scooter_protection_active
state: 'on'
sequence:
- service: telegram_bot.send_message
data:
chat_id: -1002006010424
message: >
🚨 Внимание! Самокат движется со скоростью {{ states('sensor.samokat_dddennnisss_speed') }} км/ч.
Защита активна.
inline_keyboard:
- '🔓 Снять защиту:/sc_r_unlocked'
- '{{''\U0001F6F4''}} Самокат:/sc_control, {{''\U000021A9''}} Меню:/menu_back'
- delay: '00:00:30'
+28
View File
@@ -0,0 +1,28 @@
add_sensors:
template:
########################
#room
- sensor:
- default_entity_id: sensor.all_motion
name: Движение в квартире
state: '{{ (is_state(''sensor.0xa4c13834741ffdf4_presence_state'', ''presence'')
or is_state(''sensor.0xa4c1387cda74958b_presence_state'', ''presence'') or is_state(''binary_sensor.0x00158d000707efdf_motion'',
''on'') or is_state(''sensor.room_motion'', ''True''))}}'
- default_entity_id: sensor.room_motion
name: Движение в комнате
state: '{{ (is_state(''binary_sensor.54ef44e32e91_motion'', ''on'') or is_state(''binary_sensor.54ef44e327ba_motion'',
''on'') or is_state(''binary_sensor.54ef44e45e59_motion'', ''on''))}}'
- default_entity_id: sensor.where_people
name: Пристуствие людей в квартире
state: '{{ is_state(''device_tracker.google_maps_108918666344169166438'', ''home'')
or is_state(''device_tracker.google_maps_118311730364158481019'', ''home'')}}'
+168
View File
@@ -0,0 +1,168 @@
steamdeck:
shell_command:
steamdeck_reboot: 'ssh -i /config/ssh/id_ed25519 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@192.168.1.185 "reboot"'
steamdeck_sleep: 'ssh -i /config/ssh/id_ed25519 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@192.168.1.185 "systemctl suspend"'
steamdeck_gamemode: 'ssh -i /config/ssh/id_ed25519 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null deck@192.168.1.185 "steamos-session-select gamescope"'
steamdeck_desktop: 'ssh -i /config/ssh/id_ed25519 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null deck@192.168.1.185 "steamos-session-select plasma-x11-persistent"'
steamdeck_mode: >
ssh -o StrictHostKeyChecking=no -i /config/ssh/id_ed25519 root@192.168.1.185 '
if pgrep -x gamescope >/dev/null; then
echo gaming
else
echo desktop
fi
'
sensor:
- platform: rest
name: SteamDeck System Info
resource: http://192.168.1.185:5050/status
method: GET
value_template: "{{ value_json.cpu.usage_percent }}"
json_attributes:
- cpu
- memory
- disk
- temperature_c
- uptime_seconds
- os
- os_version
- hostname
scan_interval: 60
template:
- sensor:
# CPU
- default_entity_id: sensor.steamdeck_cpu_logical
name: SteamDeck CPU Logical Cores
state: '{{ state_attr(''sensor.steamdeck_system_info'', ''cpu'')[''cores_logical'']}}'
- default_entity_id: sensor.steamdeck_cpu_physical
name: SteamDeck CPU Physical Cores
state: '{{ state_attr(''sensor.steamdeck_system_info'', ''cpu'')[''cores_physical'']}}'
- unit_of_measurement: '%'
default_entity_id: sensor.steamdeck_cpu_usage
name: SteamDeck CPU Usage
state: '{{ state_attr(''sensor.steamdeck_system_info'', ''cpu'')[''usage_percent'']| round(1) }}'
# RAM
- unit_of_measurement: GB
default_entity_id: sensor.steamdeck_ram_total
name: SteamDeck RAM Total
state: '{{ (state_attr(''sensor.steamdeck_system_info'', ''memory'')[''total'']/ 1024**3) | round(1) }}'
- unit_of_measurement: GB
default_entity_id: sensor.steamdeck_ram_used
name: SteamDeck RAM Used
state: '{{ (state_attr(''sensor.steamdeck_system_info'', ''memory'')[''used'']/ 1024**3) | round(1) }}'
- unit_of_measurement: GB
default_entity_id: sensor.steamdeck_ram_free
name: SteamDeck RAM Free
state: '{{ (state_attr(''sensor.steamdeck_system_info'', ''memory'')[''free'']/ 1024**3) | round(1) }}'
- unit_of_measurement: '%'
default_entity_id: sensor.steamdeck_ram_usage
name: SteamDeck RAM Usage
state: '{{ state_attr(''sensor.steamdeck_system_info'', ''memory'')[''usage_percent'']| round(1) }}'
# Внутренний диск
- unit_of_measurement: GB
default_entity_id: sensor.steamdeck_disk_internal_total
name: SteamDeck Disk Internal Total
state: '{{ (state_attr(''sensor.steamdeck_system_info'', ''disk'')[''internal''][''total'']/ 1024**3) | round(1) }}'
- unit_of_measurement: GB
default_entity_id: sensor.steamdeck_disk_internal_used
name: SteamDeck Disk Internal Used
state: '{{ (state_attr(''sensor.steamdeck_system_info'', ''disk'')[''internal''][''used'']/ 1024**3) | round(1) }}'
- unit_of_measurement: GB
default_entity_id: sensor.steamdeck_disk_internal_free
name: SteamDeck Disk Internal Free
state: '{{ (state_attr(''sensor.steamdeck_system_info'', ''disk'')[''internal''][''free'']/ 1024**3) | round(1) }}'
- unit_of_measurement: '%'
default_entity_id: sensor.steamdeck_disk_internal_usage
name: SteamDeck Disk Internal Usage
state: '{{ state_attr(''sensor.steamdeck_system_info'', ''disk'')[''internal''][''percent'']
| round(1) }}'
# SD-карта
- unit_of_measurement: GB
default_entity_id: sensor.steamdeck_disk_sd_total
name: SteamDeck Disk SD Total
state: '{{ (state_attr(''sensor.steamdeck_system_info'', ''disk'')[''sdcard''][''total'']/ 1024**3) | round(1) }}'
- unit_of_measurement: GB
default_entity_id: sensor.steamdeck_disk_sd_used
name: SteamDeck Disk SD Used
state: '{{ (state_attr(''sensor.steamdeck_system_info'', ''disk'')[''sdcard''][''used'']/ 1024**3) | round(1) }}'
- unit_of_measurement: GB
default_entity_id: sensor.steamdeck_disk_sd_free
name: SteamDeck Disk SD Free
state: '{{ (state_attr(''sensor.steamdeck_system_info'', ''disk'')[''sdcard''][''free'']/ 1024**3) | round(1) }}'
- unit_of_measurement: '%'
default_entity_id: sensor.steamdeck_disk_sd_usage
name: SteamDeck Disk SD Usage
state: '{{ state_attr(''sensor.steamdeck_system_info'', ''disk'')[''sdcard''][''percent'']| round(1) }}'
# Температуры
- unit_of_measurement: °C
default_entity_id: sensor.steamdeck_temp_edge
name: SteamDeck Temperature Edge
state: '{{ state_attr(''sensor.steamdeck_system_info'', ''temperature_c'')[''edge'']}}'
- unit_of_measurement: °C
default_entity_id: sensor.steamdeck_temp_composite
name: SteamDeck Temperature Composite
state: '{{ state_attr(''sensor.steamdeck_system_info'', ''temperature_c'')[''Composite'']}}'
- unit_of_measurement: °C
default_entity_id: sensor.steamdeck_temp_battery
name: SteamDeck Temperature Battery
state: '{{ state_attr(''sensor.steamdeck_system_info'', ''temperature_c'')[''BatteryTemp''] }}'
- unit_of_measurement: °C
default_entity_id: sensor.steamdeck_temp_wifi
name: SteamDeck Temperature WiFi
state: '{{ state_attr(''sensor.steamdeck_system_info'', ''temperature_c'')[''ath11k_hwmon'']}}'
# Аптайм
- unit_of_measurement: s
default_entity_id: sensor.steamdeck_uptime_seconds
name: SteamDeck Uptime Seconds
state: '{{ state_attr(''sensor.steamdeck_system_info'', ''uptime_seconds'') |int }}'
- default_entity_id: sensor.steamdeck_uptime_human
name: SteamDeck Uptime
state: "{% set s = state_attr('sensor.steamdeck_system_info', 'uptime_seconds')| int %} {% set h = s // 3600 %} {% set m = (s % 3600) // 60 %} {% set d = h// 24 %} {% if d > 0 %}\n {{ d }}д {{ h % 24 }}ч {{ m }}м\n{% else %}\n {{h }}ч {{ m }}м\n{% endif %}"
input_text:
telegram_message_id:
name: Telegram message ID
max: 10
automation:
- alias: tg|wrt_wol_steamdeck
trigger:
platform: event
event_type: telegram_command
event_data:
command: /wrt_wol_sd
action:
- variables:
chat_id: "{{ trigger.event.data.chat_id }}"
- service: shell_command.wrt_wol_sd
- service: telegram_bot.send_message
data:
chat_id: "{{ trigger.event.data.chat_id }}"
message: "steamdeck разбужен"
parse_mode: ""
- alias: tg|mn|status_sd_update
mode: single
trigger:
- platform: time_pattern
minutes: "/1" # запуск каждые 1 минуту
action:
- service: telegram_bot.edit_message
data:
chat_id: -1002006010424
message_id: 5767
message: >
🎮: {% if is_state('binary_sensor.steamdeck', 'on') %}🟢 {% else %}🔴 {% endif %}
🖧: {{ states('sensor.qemu_haos10_5_100_cpu_used') | round(1) }}% |🌡️ {{ states('sensor.proxmox_cpu_temperature') }}°C
File diff suppressed because it is too large Load Diff
+192
View File
@@ -0,0 +1,192 @@
sensor_chek_lighton_presencenone:
###################################################################################
template:
# Сенсоры автоотключения света
# Сенсор автоотключения света ванна
- binary_sensor:
- name: "Сенсор вкл свет без движения ванная"
unique_id: sensor_vkl_svet_bez_dvizheniia_vannaia
icon: >-
{% if is_state("binary_sensor.sensor_vkl_svet_bez_dvizheniia_vannaia", "on") %}
mdi:timer
{% else %}
mdi:timer-off
{% endif %}
state: >-
{{ (is_state('light.yeelink_ceilc_cc51_light', 'on') or
is_state('light.yeelink_ceilc_cc51_ambient_light', 'on') or
is_state('switch.rele_zerkalo_i_ventiliatsiia_l1', 'on')) and
states('binary_sensor.datchik_prisutstviia_vannaia_presence') in ['off', 'unavailable', 'unknown'] }}
# Сенсор автоотключения света кухня
- name: "Сенсор вкл свет без движения кухня"
unique_id: sensor_vkl_svet_bez_dvizheniia_kukhnia
icon: >-
{% if is_state("binary_sensor.sensor_vkl_svet_bez_dvizheniia_kukhnia", "on") %}
mdi:timer
{% else %}
mdi:timer-off
{% endif %}
state: >-
{{ (is_state('light.yeelink_ceilc_ff3a_light', 'on') or
is_state('light.yeelink_ceilc_ff3a_ambient_light', 'on')) and
states('binary_sensor.datchik_prisutstviia_kukhnia_presence') in ['off', 'unavailable', 'unknown'] }}
# Сенсор автоотключения света коридор
- name: "Сенсор вкл свет без движения коридор"
unique_id: sensor_vkl_svet_bez_dvizheniia_koridor
icon: "{{ 'mdi:timer' if this.state == 'on' else 'mdi:timer-off' }}"
state: >-
{{ (is_state('switch.glavnyi_vykliuchatel_prikhozhaia_left', 'on') or
is_state('switch.glavnyi_vykliuchatel_prikhozhaia_right', 'on')) and
states('binary_sensor.datchik_dvizheniia_prikhozhaia_occupancy') in ['off', 'unavailable', 'unknown'] }}
# Сенсор автоотключения света комната
- name: "Сенсор вкл свет без движения комната"
unique_id: sensor_vkl_svet_bez_dvizheniia_komnata
icon: >-
{% if is_state("binary_sensor.sensor_vkl_svet_bez_dvizheniia_komnata", "on") %}
mdi:timer
{% else %}
mdi:timer-off
{% endif %}
state: >-
{{ is_state('light.yeelink_ceiling19_d85c_light', 'on') and
states('binary_sensor.54ef44e327ba_motion') in ['off', 'unavailable', 'unknown'] and
states('binary_sensor.54ef44e45e59_motion') in ['off', 'unavailable', 'unknown'] and
states('binary_sensor.54ef44e32e91_motion') in ['off', 'unavailable', 'unknown'] }}
###################################################################################
timer:
timer_lighton_presencenone_bathroom:
name: "Таймер вкл свет без движения ванная"
duration: '00:05:00'
timer_lighton_presencenone_kitchen:
name: "Таймер вкл свет без движения кухня"
duration: '00:05:00'
timer_lighton_presencenone_lobby:
name: "Таймер вкл свет без движения коридор"
duration: '00:10:00'
timer_lighton_presencenone_room:
name: "Таймер вкл свет без движения комната"
duration: '01:00:00'
###################################################################################
automation:
# Таймер автоотключения \ /homeassistant/includes/packages/controls_light.yaml
###################################################################################
# Сброс таймера при выключении
# Сброс таймера при выключении ванная
- alias: timer_lighton_presencenone_bathroom_off
initial_state: true
trigger:
- platform: state
entity_id: binary_sensor.sensor_vkl_svet_bez_dvizheniia_vannaia
to: 'off'
action:
- service: timer.cancel
target:
entity_id: timer.timer_lighton_presencenone_bathroom
# Сброс таймера при выключении кухня
- alias: timer_lighton_presencenone_kitchen_off
initial_state: true
trigger:
- platform: state
entity_id: binary_sensor.sensor_vkl_svet_bez_dvizheniia_kukhnia
to: 'off'
action:
- service: timer.cancel
target:
entity_id: timer.timer_lighton_presencenone_kitchen
# Сброс таймера при выключении коридор
- alias: timer_lighton_presencenone_lobby_off
initial_state: true
trigger:
- platform: state
entity_id: binary_sensor.sensor_vkl_svet_bez_dvizheniia_koridor
to: 'off'
action:
- service: timer.cancel
target:
entity_id: timer.timer_lighton_presencenone_lobby
# Сброс таймера при выключении комната
- alias: timer_lighton_presencenone_room_off
initial_state: true
trigger:
- platform: state
entity_id: binary_sensor.sensor_vkl_svet_bez_dvizheniia_komnata
to: 'off'
action:
- service: timer.cancel
target:
entity_id: timer.timer_lighton_presencenone_room
###################################################################################
# Старт таймеров при старте системы
# Старт таймеров при старте системы ванна
- alias: Старт таймера ванная при старте системы
trigger:
- platform: homeassistant
event: start
condition:
- condition: state
entity_id: binary_sensor.datchik_prisutstviia_vannaia_presence
state: "off"
action:
- service: timer.start
target:
entity_id: timer.timer_lighton_presencenone_bathroom
data: {}
# Старт таймеров при старте системы кухня
- alias: Старт таймера кухня при старте системы
trigger:
- platform: homeassistant
event: start
condition:
- condition: state
entity_id: binary_sensor.datchik_prisutstviia_kukhnia_presence
state: "off"
action:
- service: timer.start
target:
entity_id: timer.timer_lighton_presencenone_kitchen
data: {}
# Старт таймеров при старте системы коридор
- alias: Старт таймера коридор при старте системы
trigger:
- platform: homeassistant
event: start
condition:
- condition: state
entity_id: binary_sensor.datchik_dvizheniia_prikhozhaia_occupancy
state: "off"
action:
- service: timer.start
target:
entity_id: timer.timer_lighton_presencenone_lobby
# Старт таймеров при старте системы комната
- alias: Старт таймера комната при старте системы
trigger:
- platform: homeassistant
event: start
condition:
- condition: state
entity_id: binary_sensor.54ef44e327ba_motion
state: "off"
action:
- service: timer.start
target:
entity_id: timer.timer_lighton_presencenone_room
###################################################################################
# Автоматизация отключения света по таймеру \ /homeassistant/includes/packages/controls_light.yaml
+160
View File
@@ -0,0 +1,160 @@
transmission:
# ==========================================
# --- СЕНСОРЫ ДЛЯ ПАРСИНГА ФАЙЛОВ ---
# ==========================================
command_line:
- sensor:
name: tr_file_list
# Добавлена поддержка UTF-8 и правильная обработка кириллицы
command: >-
python3 -c 'import json, os; f="/config/tr_list_files.txt"; data={"file_list": [l.strip() for l in open(f, encoding="utf-8") if l.strip()]} if os.path.exists(f) else {"file_list": []}; print(json.dumps(data, ensure_ascii=False))'
value_template: "{{ value_json.file_list | length if value_json is defined else 0 }}"
json_attributes:
- file_list
scan_interval: 60
automation:
# Обновление списка файлов в фоне
- id: tr_refresh_file_list
alias: "tr|refresh_file_list"
mode: single
trigger:
- platform: time_pattern
minutes: "/1"
action:
- service: shell_command.tr_files
data: {}
# ==========================================
# --- КОМАНДА: ПОЛУЧИТЬ ФАЙЛЫ (/getfiles) ---
# ==========================================
- id: ntf_tg_tr_send_url_file_list
alias: "ntf|tg|tr|send_url_file_list"
trigger:
- platform: event
event_type: telegram_command
event_data:
command: '/getfiles'
- platform: event
event_type: telegram_command
event_data:
command: '/getfiles@ha_dddennnisss_bot'
action:
- service: telegram_bot.send_message
data:
# ИСПРАВЛЕНО: Для send_message нужно использовать target!
chat_id: "{{ trigger.event.data.chat_id }}"
parse_mode: html
disable_web_page_preview: true
message: >
{% set base_url = "https://smb.dddennnisss.ru/files/share/downloads/" %}
{% set files = state_attr('sensor.tr_file_list', 'file_list') %}
{% if files is none or files | length == 0 %}
😔 <b>Нет файлов для скачивания</b>
(Проверьте наличие файлов в /config/tr_list_files.txt)
{% else %}
📥 <b>Ссылки для скачивания:</b>
{% for file in files | reject('equalto', 'incomplete') | reject('equalto', 'unknown') %}
📄 <code>{{ file }}</code>
{{ base_url }}{{ file | urlencode }}
{% endfor %}
{% endif %}
inline_keyboard:
- '⬇️ Меню торрентов:/tr_control'
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
# ==========================================
# --- УВЕДОМЛЕНИЕ: СТАРТ ЗАГРУЗКИ ---
# ==========================================
- id: ntf_transm_torrents_start_download
alias: "ntf|transm_torrents_start_download"
trigger:
- platform: event
event_type: transmission_started_torrent
action:
- service: telegram_bot.send_message
data:
chat_id:
- -1002006010424
- -1003233671944
parse_mode: html
message: |
▶️ <b>Старт загрузки торрента!</b>
📄 Название: <code>{{ trigger.event.data.name }}</code>
inline_keyboard:
- '⬇️ Статус торрентов:/tr_control'
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
# ==========================================
# --- УВЕДОМЛЕНИЕ: ОКОНЧАНИЕ ЗАГРУЗКИ ---
# ==========================================
- id: ntf_torrents_complect_download
alias: "ntf|torrents_complect_download"
trigger:
- platform: event
event_type: transmission_downloaded_torrent
action:
- service: telegram_bot.send_message
data:
chat_id:
- -1002006010424
- -1003233671944
parse_mode: html
message: |
✅ <b>Загрузка завершена!</b>
📄 Название: <code>{{ trigger.event.data.name }}</code>
inline_keyboard:
- '📥 Получить ссылки:/getfiles'
- '⬇️ Статус торрентов:/tr_control'
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
# ==========================================
# --- КОМАНДА: ДОБАВИТЬ ТОРРЕНТ (/add) ---
# ==========================================
- id: tg_add_torrents_transm_magnet
alias: "tg|add_torrents_transm_magnet"
initial_state: true
trigger:
- platform: event
event_type: telegram_command
event_data:
command: '/add'
- platform: event
event_type: telegram_command
event_data:
command: '/add@ha_dddennnisss_bot'
action:
- variables:
torrent_link: "{{ trigger.event.data.args | join(' ') }}"
- choose:
# Если ссылку не передали
- conditions: "{{ torrent_link | length == 0 }}"
sequence:
- service: telegram_bot.send_message
data:
chat_id: "{{ trigger.event.data.chat_id }}"
parse_mode: html
message: "⚠️ <b>Ошибка:</b> Вы не указали ссылку.\nИспользуйте формат:\n<code>/add magnet:?xt=urn:...</code>"
default:
- service: transmission.add_torrent
data:
torrent: "{{ torrent_link }}"
entry_id: "01JJCHRKJJ0GE2K3N9G4K20CB6"
download_path: ""
- service: telegram_bot.send_message
data:
chat_id: "{{ trigger.event.data.chat_id }}"
parse_mode: html
message: |
🔄 <b>Пытаюсь добавить торрент:</b>
<code>{{ torrent_link | truncate(100, true, '...') }}</code>
inline_keyboard:
- '⬇️ Статус торрентов:/tr_control'
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
+437
View File
@@ -0,0 +1,437 @@
# взято тут https://sprut.ai/article/odin-iz-variantov-upravleniya-pylesosom-1c-stytj01zhm-dreame-vacuum-mc1808-iz-home-assistant
select_vacuum_clean_rooms:
xiaomi_miot:
language: ru
translations:
# Global dictionary
'强劲': 'Турбо'
'标准': 'Стандартный'
'节能': 'Средний'
'关': 'Бесшумный'
'低': 'Низкий'
'中': 'Средний'
'高': 'Высокий'
'Sweep': 'Пылесос'
'Sweep And Mop': 'Пылесос и влажная уборка'
'Mop': 'Влажная уборка'
'Global': 'Авто'
'Edge': 'Очистка углов'
'Point': 'Точечная'
'Remote': 'Дистанционная'
'Mi Robot Vacuum-Mop 2 Lite Robot Cleaner Режим': 'Режим уборки'
'Mi Robot Vacuum-Mop 2 Lite Robot Cleaner Sweep Type': 'Вид уборки'
'Mi Robot Vacuum-Mop 2 Lite sweep water_state': 'Уровень воды'
'starting': 'Начало уборки'
'charger disconnected': 'Зарядное устройство отключено'
'idle': 'Ожидание'
'remote control active': 'Включено управление через пульт'
'cleaning': 'Уборка'
'returning home': 'Возвращение на базу'
'manual mode': 'Ручной режим'
'charging': 'Зарядка'
'charging problem': 'Проблема с зарядкой'
'paused': 'Пауза'
'spot cleaning': 'Уборка точки'
'error': 'Ошибка'
'shutting down': 'Выключение'
'updating': 'Обновление'
'docking': 'Остановка у базы'
'going to target': 'Направление до точки'
'zoned cleaning': 'Уборка зоны'
'segment cleaning': 'Уборка'
'emptying the bin': 'Очистка бака'
'charging complete': 'Зарядка завершена'
'device offline': 'Устройство не в сети'
'Sweeping and Mopping': 'Пылесосит и моет полы'
#======================================================================================================================
input_boolean:
room_vacuum:
name: "Комната уборка"
lobby_vacuum:
name: "Прихожая уборка"
hallway_vacuum:
name: "Коридор уборка"
bathroom_vacuum:
name: "Ванная уборка"
kitchen_vacuum:
name: "Кухня уборка"
#======================================================================================================================
group:
all_rooms_for_vac_clean:
name: All rooms for vacuum clean
entities:
- input_boolean.room_vacuum
- input_boolean.lobby_vacuum
- input_boolean.hallway_vacuum
- input_boolean.bathroom_vacuum
- input_boolean.kitchen_vacuum
#======================================================================================================================
template:
# Сенсор просматривает нашу группу на предмет включенных input boolean,
# затем забирает их названия, записывает их в строку, разделяя запятой,
# и, наконец, заменяет каждое имя в списке соотвестовующим набором цифр в квадратных скобках.
- sensor:
- default_entity_id: sensor.select_rooms_for_clean
icon: mdi:vacuum
name: Выбранные комнаты для пылесоса
state: "{% set room = expand('group.all_rooms_for_vac_clean') | selectattr('state',
'eq', 'on') | map(attribute='entity_id') | list | join(',') | replace('input_boolean.room_vacuum','[3,1,3,3,1]')
| replace('input_boolean.lobby_vacuum','[2,1,3,3,1]') | replace('input_boolean.hallway_vacuum','[5,1,3,3,1]')
| replace('input_boolean.bathroom_vacuum','[1,1,3,3,1]') | replace('input_boolean.kitchen_vacuum','[4,1,3,3,1]')
%}\n {\"selects\":[{{room}}]}"
# Сенсор выаода можности всасывания для обходя ограничения редактора карточки
- default_entity_id: sensor.select_vacuum_fan_speed
icon: mdi:vacuum
name: Выбранная мощность всасывания
state: '{{ state_attr(''vacuum.dreame_mc1808_044c_robot_cleaner_2'', ''fan_speed'')}}'
# Сенсор выаода уровня воды для обходя ограничения редактора карточки
- default_entity_id: sensor.select_water_vacum
icon: mdi:vacuum
name: Выбранный уровень воды
state: '{{ state_attr(''vacuum.stytj01zhm'', ''water_level'')}}'
# Сенсор состояния бака с водой
- default_entity_id: sensor.vacuum_water_box
icon: mdi:vacuum
name: Сенсор состояния бака с водой
state: '{{state_attr(''vacuum.dreame_mc1808_044c_robot_cleaner_2'',''clean.water_box'')}}'
#======================================================================================================================
#Скрипт запуска уборки
script:
clean_select_rooms:
alias: VCM|Убрать выбранные комнаты
sequence:
- service: xiaomi_miot.call_action
data_template:
entity_id: vacuum.dreame_mc1808_044c_robot_cleaner_2
siid: 18
aiid: 1
params:
- piid: 1
value: 18
- "{{ {'piid':21, 'value': states('sensor.select_rooms_for_clean') } }}"
force_params: true
#Условия по кторым утсанавливается мощность всасывания и полива
- choose:
- conditions:
- condition: state
entity_id: sensor.select_vacuum_fan_speed
state: Турбо
sequence:
- service: script.set_fanspeed_vacum_turbo
metadata: {}
data: {}
- conditions:
- condition: state
entity_id: sensor.select_vacuum_fan_speed
state: Средний
sequence:
- service: script.set_fanspeed_vacum_strong
data: {}
- conditions:
- condition: state
entity_id: sensor.select_vacuum_fan_speed
state: Стандартный
sequence:
- service: script.set_fanspeed_vacum_standart
data: {}
- conditions:
- condition: state
entity_id: sensor.select_vacuum_fan_speed
state: Тихий
sequence:
- service: script.set_fanspeed_vacum_silent
data: {}
- choose:
- conditions:
- condition: state
entity_id: sensor.select_water_vacum
state: Low
sequence:
- service: script.set_water_vacum_low
data: {}
- conditions:
- condition: state
entity_id: sensor.select_water_vacum
state: Med
sequence:
- service: script.set_water_vacum_middle
data: {}
- conditions:
- condition: state
entity_id: sensor.select_water_vacum
state: High
sequence:
- service: script.set_water_vacum_hight
data: {}
# Смена уровня воды
set_water_vacum_hight:
alias: VCM|Смена уровня воды пылесос высокий
sequence:
- service: xiaomi_miot.set_miot_property
metadata: {}
data:
entity_id: vacuum.dreame_mc1808_044c_robot_cleaner_2
siid: 18
piid: 20
value: 3
set_water_vacum_middle:
alias: VCM|Смена уровня воды пылесос средний
sequence:
- service: xiaomi_miot.set_miot_property
metadata: {}
data:
entity_id: vacuum.dreame_mc1808_044c_robot_cleaner_2
siid: 18
piid: 20
value: 2
set_water_vacum_low:
alias: VCM|Смена уровня воды пылесос низкий
sequence:
- service: xiaomi_miot.set_miot_property
metadata: {}
data:
entity_id: vacuum.dreame_mc1808_044c_robot_cleaner_2
siid: 18
piid: 20
value: 1
# Смена мощности всасывания
set_fanspeed_vacum_silent:
alias: VCM|Смена мощности всасывания пылесос бесшумный
sequence:
- service: xiaomi_miot.set_miot_property
metadata: {}
data:
entity_id: vacuum.dreame_mc1808_044c_robot_cleaner_2
siid: 18
piid: 6
value: 0
set_fanspeed_vacum_standart:
alias: VCM|Смена мощности всасывания пылесос стандартный
sequence:
- service: xiaomi_miot.set_miot_property
metadata: {}
data:
entity_id: vacuum.dreame_mc1808_044c_robot_cleaner_2
siid: 18
piid: 6
value: 1
set_fanspeed_vacum_strong:
alias: VCM|Смена мощности всасывания пылесос интенсивный
sequence:
- service: xiaomi_miot.set_miot_property
metadata: {}
data:
entity_id: vacuum.dreame_mc1808_044c_robot_cleaner_2
siid: 18
piid: 6
value: 2
set_fanspeed_vacum_turbo:
alias: VCM|Смена мощности всасывания пылесос турбо
sequence:
- service: xiaomi_miot.set_miot_property
metadata: {}
data:
entity_id: vacuum.dreame_mc1808_044c_robot_cleaner_2
siid: 18
piid: 6
value: 3
#======================================================================================================================
# автоматизацию, которая сбрасывает булеаны после окончания уборки
automation:
- alias: 'VCM|reset_select_rooms'
id: Reset select rooms
trigger:
- platform: state
entity_id: vacuum.dreame_mc1808_044c_robot_cleaner_2
to: 'docked'
condition: []
action:
- service: input_boolean.turn_off
entity_id:
- input_boolean.room_vacuum
- input_boolean.lobby_vacuum
- input_boolean.hallway_vacuum
- input_boolean.bathroom_vacuum
- input_boolean.kitchen_vacuum
- alias: VCM|button_start_clean
description: ""
trigger:
- platform: device
domain: mqtt
device_id: 975fb5853727f1fa4279bac09fd7fb6b
type: action
subtype: hold_right
discovery_id: 0x00158d0006c6bca8 action_hold_right
condition:
- condition: or
conditions:
- condition: state
entity_id: vacuum.dreame_mc1808_044c_robot_cleaner_2
state: docked
- condition: state
entity_id: vacuum.dreame_mc1808_044c_robot_cleaner_2
state: idle
action:
- device_id: 885672257bd73c7492a4ba8b72b83699
domain: vacuum
entity_id: f9d147842b81972de04c1be4dfd368f3
type: clean
mode: single
- alias: VCM|button_stop_clean
description: ""
trigger:
- platform: device
domain: mqtt
device_id: 975fb5853727f1fa4279bac09fd7fb6b
type: action
subtype: hold_right
discovery_id: 0x00158d0006c6bca8 action_hold_right
condition:
- condition: or
conditions:
- condition: state
entity_id: vacuum.dreame_mc1808_044c_robot_cleaner_2
state: cleaning
- condition: state
entity_id: vacuum.dreame_mc1808_044c_robot_cleaner_2
state: error
- condition: state
entity_id: vacuum.dreame_mc1808_044c_robot_cleaner_2
state: paused
action:
- device_id: 885672257bd73c7492a4ba8b72b83699
domain: vacuum
entity_id: f9d147842b81972de04c1be4dfd368f3
type: dock
mode: single
#======================================================================================================================
# Уведомления Telegram
#======================================================================================================================
- alias: "ntf|tg|VCM|clean_water_box_off"
id: telegram_ntf_vcm_water_box
description: "Напоминание о неснятом баке с водой"
mode: single
trigger:
- platform: state
entity_id: sensor.vacuum_water_box
to: "1"
for:
hours: 1
minutes: 0
seconds: 0
action:
- repeat:
sequence:
- service: telegram_bot.send_message
data:
target: -1002006010424
message: |
💧 ❗ Напоминание: Снимите бак с водой с пылесоса!
Он установлен уже более часа.
inline_keyboard:
- '🌀 Управление пылесосом:/vcm_control'
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
- delay:
hours: 3
while:
- condition: state
entity_id: sensor.vacuum_water_box
state: "1"
- alias: "ntf|tg|VCM|vacuum_clean_finish"
id: telegram_ntf_vcm_finish
description: "Уведомление об окончании уборки"
mode: single
trigger:
- platform: state
entity_id: vacuum.dreame_mc1808_044c_robot_cleaner_2
from: 'cleaning'
to: 'returning'
action:
- service: telegram_bot.send_message
data:
target: -1002006010424
message: |
✅ Пылесос завершил уборку
🕒 Завершена в: {{ states('sensor.time') }}
⏱️ Затрачено времени: {{ state_attr('vacuum.stytj01zhm', 'cleaning_time') | default(0) }} мин
🏠 Убрано: {{ state_attr('vacuum.stytj01zhm', 'cleaning_area') | default(0) }} м²
🔋 Заряд: {{ state_attr('vacuum.dreame_mc1808_044c_robot_cleaner_2', 'battery_level') | default(0) }}%
{% if state_attr('vacuum.dreame_mc1808_044c_robot_cleaner_2', 'clean.water_box') | int(0) == 1 %}
💧 ❗ Внимание: Бак с водой всё ещё установлен!
{% else %}
💧 Бак с водой: Снят
{% endif %}
inline_keyboard:
- '🌀 Управление пылесосом:/vcm_control, 🔙 Главное меню:/menu_back'
- '🗑️ Прочитано:/menu_hide'
- alias: "ntf|tg|VCM|vacuum_error"
id: telegram_ntf_vcm_error
description: "Уведомление об ошибке пылесоса"
mode: single
trigger:
- platform: state
entity_id: vacuum.dreame_mc1808_044c_robot_cleaner_2
to: 'error'
action:
- service: telegram_bot.send_message
data:
target: -1002006010424
message: |
{%- set raw = state_attr('vacuum.dreame_mc1808_044c_robot_cleaner_2', 'vacuum.fault') -%}
{%- set code = raw | int(0) if raw not in ['unknown', 'unavailable', None] else 0 -%}
{%- set errors = {
0: 'Нет ошибки',
1: 'Пылесос подняли (на весу)',
2: 'Щётка заблокирована',
3: 'Ошибка мотора щётки',
4: 'Колесо заблокировано',
5: 'Ошибка датчиков высоты',
6: 'Ошибка колеса',
7: 'Ошибка контейнера для пыли',
8: 'Ошибка лидара (вращение сенсора)',
9: 'Ошибка бампера (столкновение)',
10: 'Ошибка навигации',
11: 'Ошибка зарядки',
12: 'Что-то намоталось на основную щётку',
13: 'Ошибка батареи',
14: 'Ошибка Wi-Fi модуля',
15: 'Ошибка бака с водой',
16: 'Ошибка привода'
} -%}
{%- if code == 0 -%}
✅ Ошибка пылесоса устранена
{%- else -%}
❗ Ошибка пылесоса: {{ errors.get(code, 'Неизвестная ошибка (код ' ~ raw ~ ')') }}
{%- endif %}
inline_keyboard:
- '🌀 Управление пылесосом:/vcm_control, 🔙 Главное меню:/menu_back'
- '🗑️ Прочитано:/menu_hide'
+190
View File
@@ -0,0 +1,190 @@
washer:
automation:
# ==========================================
# --- УВЕДОМЛЕНИЕ: ОШИБКА СТИРАЛКИ ---
# ==========================================
- id: ntf_washing_error
alias: "ntf|washing_error"
mode: single
trigger:
- platform: state
entity_id: binary_sensor.stiralnaia_mashina_s_gorizontalnoi_zagruzkoi_error_state
to: "on"
action:
- service: telegram_bot.send_message
data:
chat_id:
- -1002006010424
- -1003233671944
parse_mode: html
message: |
{% set err = states("sensor.stiralnaia_mashina_s_gorizontalnoi_zagruzkoi_error_message") %}
⚠️ <b>Ошибка стиральной машины!</b>
{% if err == "dE1" %}🚪 Открыт люк!
{% elif err == "UE" %}⚖️ Дисбаланс: бельё плохо распределено. Попробуйте переложить вещи.
{% else %}❓ Неизвестная ошибка: {{ err }}{% endif %}
inline_keyboard:
- '📊 Состояние:/bt_wh_control, 🔙 Меню:/menu_back'
- '🗑️ Прочитано:/menu_hide'
# ==========================================
# --- УВЕДОМЛЕНИЕ: НАЧАЛО СТИРКИ ---
# ==========================================
- id: ntf_wshr_wash_start
alias: "ntf|wshr|wash_start"
trigger:
- platform: state
entity_id: sensor.stiralnaia_mashina_s_gorizontalnoi_zagruzkoi_run_state
to: "Стирка"
for:
seconds: 30
action:
- service: telegram_bot.send_message
data:
chat_id:
- -1002006010424
- -1003233671944
parse_mode: html
message: |
🧼 <b>Стирка запущена</b>
📋 Программа: {{ states('sensor.stiralnaia_mashina_s_gorizontalnoi_zagruzkoi_current_course') }}
🌡️ Температура: {{ states('sensor.stiralnaia_mashina_s_gorizontalnoi_zagruzkoi_water_temp') }}
♻️ Обороты: {{ states('sensor.stiralnaia_mashina_s_gorizontalnoi_zagruzkoi_spin_speed') }}
⏳ Время: {{ state_attr('sensor.stiralnaia_mashina_s_gorizontalnoi_zagruzkoi', 'remain_time') }}
🕒 Завершение в: {{ as_timestamp(state_attr('sensor.stiralnaia_mashina_s_gorizontalnoi_zagruzkoi', 'end_time')) | timestamp_custom('%H:%M:%S') }}
inline_keyboard:
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
# ==========================================
# --- УВЕДОМЛЕНИЕ: ЗАВЕРШЕНИЕ СТИРКИ ---
# ==========================================
- id: ntf_wshr_wash_finish
alias: "ntf|wshr|wash_finish"
trigger:
- platform: state
entity_id: sensor.stiralnaia_mashina_s_gorizontalnoi_zagruzkoi_run_state
from: "Завершено"
to: "-"
action:
- service: telegram_bot.send_message
data:
chat_id:
- -1002006010424
- -1003233671944
parse_mode: html
message: "✅ <b>Стирка успешно завершена!</b>"
inline_keyboard:
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
# ==========================================
# --- УВЕДОМЛЕНИЕ: НУЖНО ДОСТАТЬ БЕЛЬЕ ---
# ==========================================
- id: ntf_wshr_wash_cool_on
alias: "ntf|wshr|wash_cool_on"
trigger:
- platform: state
entity_id: sensor.stiralnaia_mashina_s_gorizontalnoi_zagruzkoi_run_state
from: "Завершено"
to: "Охлаждение"
action:
- service: telegram_bot.send_message
data:
chat_id:
- -1002006010424
- -1003233671944
parse_mode: html
message: "🧺 <b>Сушка завершена!</b> Пора достать бельё."
inline_keyboard:
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
# ==========================================
# --- УВЕДОМЛЕНИЕ: ОХЛАЖДЕНИЕ ОСТАНОВЛЕНО ---
# ==========================================
- id: ntf_wshr_wash_cool_off
alias: "ntf|wshr|wash_cool_off"
trigger:
- platform: state
entity_id: sensor.stiralnaia_mashina_s_gorizontalnoi_zagruzkoi_run_state
from: "Охлаждение"
to: null
action:
- service: telegram_bot.send_message
data:
chat_id:
- -1002006010424
- -1003233671944
parse_mode: html
message: "✅ <b>Охлаждение белья остановлено</b>"
inline_keyboard:
- '🔙 Главное меню:/menu_back, 🗑️ Прочитано:/menu_hide'
# ==========================================
# --- ПОВТОРЯЮЩЕЕСЯ НАПОМИНАНИЕ (УМНОЕ) ---
# ==========================================
- id: ntf_tg_wshr_get_laundry
alias: "ntf|tg|wshr|get_laundry"
description: "Напоминает достать белье тому, кто дома"
mode: single
trigger:
- platform: state
entity_id: timer.timer_cool_washer
from: "idle"
to: "active"
condition:
- condition: state
entity_id: binary_sensor.day_time
state: "on"
action:
- repeat:
while:
- condition: state
entity_id: timer.timer_cool_washer
state: "active"
sequence:
- variables:
denis_home: "{{ is_state('device_tracker.google_maps_108918666344169166438', 'home') }}"
lena_home: "{{ is_state('device_tracker.google_maps_118311730364158481019', 'home') }}"
finish: "{{ state_attr('timer.timer_cool_washer', 'finishes_at') }}"
msg: |
🧺 <b>Напоминание: Бельё в машинке!</b>
{% if finish -%}
{%- set delta = (as_datetime(finish) - now()).total_seconds() | int -%}
{%- if delta > 0 -%}
{%- set hours = delta // 3600 -%}
{%- set minutes = (delta % 3600) // 60 -%}
{%- set seconds = delta % 60 %}
⏳ До автовыключения: {{ '%02d:%02d:%02d' % (hours, minutes, seconds) }}
{%- else %}
⏳ До автовыключения: 00:00:00
{%- endif -%}
{%- else %}
❌ Таймер не активен.
{%- endif %}
# Пишем в группу Дениса, если он дома
- if: "{{ denis_home }}"
then:
- service: telegram_bot.send_message
data:
chat_id: -1002006010424
parse_mode: html
message: "{{ msg }}"
inline_keyboard:
- '🔙 Меню:/menu_back, 🗑️ Прочитано:/menu_hide'
# Пишем в группу Лены, если она дома
- if: "{{ lena_home }}"
then:
- service: telegram_bot.send_message
data:
chat_id: -1003233671944
parse_mode: html
message: "{{ msg }}"
inline_keyboard:
- '🔙 Меню:/menu_back, 🗑️ Прочитано:/menu_hide'
- delay:
minutes: 30
View File
+86
View File
@@ -0,0 +1,86 @@
uborka_koridora:
alias: Уборка коридора
sequence:
- service: xiaomi_miot.call_action
data:
entity_id: vacuum.dreame_mc1808_044c_robot_cleaner_2
siid: 18
aiid: 1
throw: false
params:
- piid: 1
value: 18
- piid: 21
value: '{"selects":[[5,1,3,3,1]]}'
force_params: true
uborka_prihoj:
alias: Уборка прихожей
sequence:
- service: xiaomi_miot.call_action
data:
entity_id: vacuum.dreame_mc1808_044c_robot_cleaner_2
siid: 18
aiid: 1
throw: false
params:
- piid: 1
value: 18
- piid: 21
value: '{"selects":[[2,1,3,3,1]]}'
force_params: true
uborka_vanni:
alias: Уборка ванны
sequence:
- service: xiaomi_miot.call_action
data:
entity_id: vacuum.dreame_mc1808_044c_robot_cleaner_2
siid: 18
aiid: 1
throw: false
params:
- piid: 1
value: 18
- piid: 21
value: '{"selects":[[1,1,3,3,1]]}'
force_params: true
uborka_kuhni:
alias: Уборка кухни
sequence:
- service: xiaomi_miot.call_action
data:
entity_id: vacuum.dreame_mc1808_044c_robot_cleaner_2
siid: 18
aiid: 1
throw: false
params:
- piid: 1
value: 18
- piid: 21
value: '{"selects":[[3,1,3,3,1]]}'
force_params: true
uborka_zal:
alias: Уборка зала
sequence:
- service: xiaomi_miot.call_action
data:
entity_id: vacuum.dreame_mc1808_044c_robot_cleaner_2
siid: 18
aiid: 1
throw: false
params:
- piid: 1
value: 18
- piid: 21
value: '{"selects":[[4,1,3,3,1]]}'
force_params: true
openweather_forecast:
alias: openweather_forecast
sequence:
- service: weather.get_forecasts
metadata: {}
data:
type: hourly
target:
device_id: 6e9d8372f8fb9df3f377095eea1d932b
response_variable: openweather_forecast
mode: single
+1
View File
@@ -0,0 +1 @@
УСПЕХ! Ссылка: rtsp://vcore-jkh08.video.goodline.info:5...
+97
View File
@@ -0,0 +1,97 @@
import urllib.request
import urllib.error
import json
import traceback
import os
def get_token_from_file():
# Теперь читаем токен из обычного текстовика, а не из secrets
token_path = '/config/scripts/goodline_token.txt'
if os.path.exists(token_path):
with open(token_path, 'r') as f:
return f.read().strip()
return None
def request_new_sms(log_file):
# Данные твоего бота (замени BOT_TOKEN на свой)
bot_token = "8329968936:AAFWZz2RTNKWvnhhKXpEXOC55qoj5Cg4_Kk"
chat_id = "-1002006010424" # Твой ID группы из прошлой автоматизации
url_sms = 'https://api-video.goodline.info/ords/mobile/vc2/auth/phone'
payload = {
"id_device": "5116c3f1822f08",
"id_platform": 3,
"phone": "79134374202"
}
data = json.dumps(payload).encode('utf-8')
headers = {'Content-Type': 'application/json'}
try:
# 1. Запрос СМС у провайдера
req = urllib.request.Request(url_sms, data=data, headers=headers, method='POST')
urllib.request.urlopen(req, timeout=10)
# 2. Уведомление в Телеграм о попытке
tg_msg = "🔄 <b>Внимание:</b> Токен камеры протух. Запросил новое СМС с кодом..."
tg_url = f"https://api.telegram.org/bot{bot_token}/sendMessage"
tg_payload = json.dumps({
"chat_id": chat_id,
"text": tg_msg,
"parse_mode": "HTML"
}).encode('utf-8')
tg_req = urllib.request.Request(tg_url, data=tg_payload, headers=headers, method='POST')
urllib.request.urlopen(tg_req, timeout=5)
with open(log_file, 'a') as f:
f.write("СЕРВЕР: Запрошена новая СМС с кодом и отправлено уведомление в TG!\n")
except Exception as e:
with open(log_file, 'a') as f:
f.write(f"ОШИБКА в request_new_sms: {e}\n")
def get_url():
log_file = '/config/scripts/camera_log.txt'
master_token = get_token_from_file()
if not master_token:
with open(log_file, 'w') as f:
f.write("ОШИБКА: Файл goodline_token.txt пуст или не существует!\n")
request_new_sms(log_file) # Просим СМС, если токена вообще нет
return
url = 'https://api-video.goodline.info/ords/mobile/vc2/v2/cameras/23079'
headers = {
'token': master_token,
'origin': 'https://video.online-dozor.ru',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)'
}
try:
req = urllib.request.Request(url, headers=headers)
with urllib.request.urlopen(req, timeout=15) as response:
data = json.loads(response.read().decode())
rtsp = data.get('STREAM_LIVE_RTSP_HD')
sig = data.get('SIGNATURE', '').replace('wmsAuthSign=', '')
if rtsp and sig:
final_link = f"{rtsp}?wmsAuthSign={sig}"
print(final_link, end='')
with open(log_file, 'w') as f:
f.write(f"УСПЕХ! Ссылка: {final_link[:40]}...\n")
except urllib.error.HTTPError as e:
error_body = e.read().decode()
with open(log_file, 'w') as f:
f.write(f"ОШИБКА 401: Токен устарел!\n")
# ТОКЕН ПРОТУХ - ЗАПРАШИВАЕМ СМС!
request_new_sms(log_file)
except Exception as e:
with open(log_file, 'w') as f:
f.write(f"КРИТИЧЕСКАЯ ОШИБКА:\n{traceback.format_exc()}\n")
if __name__ == "__main__":
get_url()
+1
View File
@@ -0,0 +1 @@
566AFC0A-AE12-4F15-E063-2965660ADC25
+44
View File
@@ -0,0 +1,44 @@
import urllib.request
import json
import sys
def verify_code(sms_code):
url = 'https://api-video.goodline.info/ords/mobile/vc2/auth/token/sms'
# Данные из твоего скриншота
payload = {
"phone": "79134374202",
"code": str(sms_code)
}
data = json.dumps(payload).encode('utf-8')
headers = {
'Content-Type': 'application/json',
'origin': 'https://video.online-dozor.ru',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)'
}
req = urllib.request.Request(url, data=data, headers=headers, method='POST')
try:
with urllib.request.urlopen(req, timeout=10) as response:
resp_json = json.loads(response.read().decode('utf-8'))
new_token = resp_json.get('TOKEN')
if new_token:
# Записываем свежий токен в текстовый файл
with open('/config/scripts/goodline_token.txt', 'w') as f:
f.write(new_token)
print(f"Успех! Новый токен сохранен: {new_token[:10]}...")
else:
print("Ошибка: Токен не найден в ответе сервера!")
except Exception as e:
print(f"Ошибка при отправке кода: {e}")
if __name__ == "__main__":
# Скрипт принимает код из аргумента командной строки
if len(sys.argv) > 1:
verify_code(sys.argv[1])
else:
print("Ошибка: Не передан СМС код!")