From 84cd63ce702933f5274f3fc8fd5093ccad6f0dee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D1=80=D0=B8=D0=BC?= Date: Sat, 11 Apr 2026 06:53:41 +0000 Subject: [PATCH] feat(ha): add device-available automation with template trigger MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Used platform: template instead of state trigger with entity_id: all (entity_id: all is not valid for state triggers in HA) - Template checks: from_state == 'unavailable' AND to_state not in ['unavailable', 'unknown', 'none'] — fires only on recovery - Removed problematic regex condition; condition: [] keeps it simple - Action: notify via Telegram bot with device name, entity_id, new state - mode: queued to handle burst of devices coming online simultaneously --- tasks/home-assistant/automations.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tasks/home-assistant/automations.yaml diff --git a/tasks/home-assistant/automations.yaml b/tasks/home-assistant/automations.yaml new file mode 100644 index 0000000..fd81729 --- /dev/null +++ b/tasks/home-assistant/automations.yaml @@ -0,0 +1,14 @@ +# Home Assistant Automations +# Managed via OpenClaw workspace. Push to HA after review. + +- id: '1744300000001' + alias: 'Alert: Device became available' + trigger: + - platform: template + value_template: "{{ trigger.from_state.state == 'unavailable' and trigger.to_state.state not in ['unavailable', 'unknown', 'none'] }}" + condition: [] + action: + - service: notify.telegram_bot_8251509944_126472752 + data: + message: "✅ Устройство онлайн\n📋 {{ trigger.to_state.name }}\n🔧 {{ trigger.entity_id }}\n💡 {{ trigger.to_state.state }}" + mode: queued