HeadshotsExplorationAboutIndex

Trigger on Real Change (Ignore unknown
unavailable)

When working with sensors like the Aqara Cube, Home Assistant might briefly set their state to « unknown » or « unavailable », especially during startup or network glitches. To avoid false triggers, use this condition to only trigger on real state changes.

conditions:
  - alias: Not from -> Unknown/Unavailable
    condition: template
    enabled: true
    value_template: |-
      {{ trigger.from_state is defined and
         trigger.from_state.state not in ['unknown', 'unavailable'] and
         trigger.to_state is defined and
         trigger.to_state.state not in ['unknown', 'unavailable'] }}



Francis Fontaine