Automation Power below x but don't trigger when from unavailable

Hi,

Tried a lot but wasn’t successful.

I want the zigbee2mqtt integrated power plug to trigger when power consumption is below a specific value for a couple of minutes.

Works fine but I cannot exclude it from fireing when the device came available (after ha restart for example).

Can anyone help me?

Here is my automation code:

alias: "Tts + Noti: Washing machine is ready "
description: ""
trigger:
  - type: power
    platform: device
    device_id: 3f960502b2da2ce98004841c3de6ea00
    entity_id: sensor.waschmaschine_power_plug_power
    domain: sensor
    id: powerchange
    below: 0.5
    for:
      hours: 0
      minutes: 2
      seconds: 0
condition:
  - condition: time
    after: "08:00:00"
    before: "23:00:00"
action:
  - service: script.tts_wama_fertig
    data: {}
  - service: notify.mobile_app_yal_l41
    data:
      message: "Waschmaschine fertig "
  - service: notify.mobile_app_iphone_von_franziska
    data:
      message: "Waschmaschine ist fertig! "
mode: single

I think I figured it out - here is my yaml for anyone interested:

alias: "Tts + Noti: Washing machine is ready "
description: ""
trigger:
  - platform: numeric_state
    entity_id: sensor.waschmaschine_power_plug_power
    below: 0.2
    for:
      hours: 0
      minutes: 3
      seconds: 0
condition:
  - condition: template
    value_template: "{{ trigger.from_state.state not in ['unknown', 'unavailable'] }}"
    enabled: true
  - condition: time
    after: "08:00:00"
    before: "23:00:00"
    enabled: true
action:
  - service: script.tts_wama_fertig
    data: {}
  - service: notify.mobile_app_yal_l41
    data:
      message: "Waschmaschine fertig "
  - service: notify.mobile_app_iphone_von_franziska
    data:
      message: "Waschmaschine ist fertig! "
    enabled: true
mode: single