How to prevent automations to run on reboot?

Right now if I reboot my raspberry pi some automations that depend on the state of a device are triggered. My guess is that when I reboot their state is set to NULL and then when zigbee2mqtt starts, it sets then again to what they were.

So now my automaitons like

when power plug goes on/off

are triggered when I reboot or do something in zigbee2mqtt that restarts it

I assume state or event triggers, (show us your triggers)…
You would add not_from: unavailable unknown…
Example:

automation:
  triggers:
    - trigger: state
      entity_id: vacuum.test
      not_from:
        - "unknown"
        - "unavailable"
      to: "on"
alias: energia voltou
description: ""
triggers:
  - type: not_moist
    device_id: d626eca66a9c739a435c31e12b1423a4
    entity_id: ae9e3f6ec50d17fc0f294a2c800458ae
    domain: binary_sensor
    trigger: device
conditions: []
actions:
  - action: notify.notify
    metadata: {}
    data:
      message: energia voltou
mode: single

in this case it looks like the trigger is different. Where do I put the not_from?

It’s a device trigger. change it to a state trigger and add code similar to the example.