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