- 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
15 lines
595 B
YAML
15 lines
595 B
YAML
# 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
|