Fix: disable auto-open after door opens, re-enable on leaving gps_home_high zone
This commit is contained in:
@@ -99,8 +99,6 @@ intercom:
|
|||||||
- condition: state
|
- condition: state
|
||||||
entity_id: input_boolean.intercom_auto_open
|
entity_id: input_boolean.intercom_auto_open
|
||||||
state: "on"
|
state: "on"
|
||||||
- condition: template
|
|
||||||
value_template: "{{ this.attributes.last_triggered == none or (now() - this.attributes.last_triggered).total_seconds() > 300 }}"
|
|
||||||
action:
|
action:
|
||||||
# Цикл открытия двери: 3 раза с интервалом 7 секунд
|
# Цикл открытия двери: 3 раза с интервалом 7 секунд
|
||||||
- repeat:
|
- repeat:
|
||||||
@@ -113,12 +111,19 @@ intercom:
|
|||||||
- delay:
|
- delay:
|
||||||
seconds: 5
|
seconds: 5
|
||||||
|
|
||||||
|
# Выключаем автооткрытие — больше не будет работать, пока не выйдешь из gps_home_high
|
||||||
|
- service: input_boolean.turn_off
|
||||||
|
target:
|
||||||
|
entity_id: input_boolean.intercom_auto_open
|
||||||
|
|
||||||
# Уведомление с кнопками управления
|
# Уведомление с кнопками управления
|
||||||
- service: telegram_bot.send_message
|
- service: telegram_bot.send_message
|
||||||
data:
|
data:
|
||||||
target: -1002006010424
|
target: -1002006010424
|
||||||
parse_mode: html
|
parse_mode: html
|
||||||
message: "🏠 <b>Зона INTERCOM достигнута!</b>\nДверь открыта 3 раза с интервалом 7 сек."
|
message: "🏠 <b>Зона INTERCOM достигнута!</b>
|
||||||
|
Дверь открыта 3 раза с интервалом 7 сек.
|
||||||
|
Автоотключение — выйди из gps_home_high, чтобы включить снова."
|
||||||
inline_keyboard:
|
inline_keyboard:
|
||||||
- "🔔 Домофон:/intercom_menu"
|
- "🔔 Домофон:/intercom_menu"
|
||||||
- "🏠 Главное меню:/menu_back"
|
- "🏠 Главное меню:/menu_back"
|
||||||
@@ -133,20 +138,23 @@ intercom:
|
|||||||
priority: high
|
priority: high
|
||||||
|
|
||||||
# ==========================================
|
# ==========================================
|
||||||
# 4. ВЫКЛЮЧЕНИЕ GPS ПРИ ВЫХОДЕ (Работает ВСЕГДА для экономии заряда)
|
# 4. ВЫХОД ИЗ ЗОНЫ gps_home_high
|
||||||
# ==========================================
|
# ==========================================
|
||||||
- id: turn_off_high_accuracy_on_leave
|
# Включаем автооткрытие обратно и выключаем GPS
|
||||||
alias: "gps|turn_off_on_leave"
|
- id: leave_gps_home_high_rearm_auto_open
|
||||||
|
alias: "gps|leave_gps_home_high_rearm_auto_open"
|
||||||
trigger:
|
trigger:
|
||||||
- platform: zone
|
- platform: zone
|
||||||
entity_id: device_tracker.cph2573_2
|
entity_id: device_tracker.cph2573_2
|
||||||
zone: zone.gps_home_high
|
zone: zone.gps_home_high
|
||||||
event: leave
|
event: leave
|
||||||
condition:
|
|
||||||
- condition: state
|
|
||||||
entity_id: binary_sensor.oneplus12_high_accuracy_mode
|
|
||||||
state: "on"
|
|
||||||
action:
|
action:
|
||||||
|
# Включаем автооткрытие двери
|
||||||
|
- service: input_boolean.turn_on
|
||||||
|
target:
|
||||||
|
entity_id: input_boolean.intercom_auto_open
|
||||||
|
|
||||||
|
# Выключаем точный GPS для экономии заряда
|
||||||
- service: notify.mobile_app_oneplus12
|
- service: notify.mobile_app_oneplus12
|
||||||
data:
|
data:
|
||||||
message: "command_high_accuracy_mode"
|
message: "command_high_accuracy_mode"
|
||||||
|
|||||||
Reference in New Issue
Block a user