commit 84cd63ce702933f5274f3fc8fd5093ccad6f0dee Author: Стрим Date: Sat Apr 11 06:53:41 2026 +0000 feat(ha): add device-available automation with template trigger - 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 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