Automation help and condition for running a script

Hello, I’d ask for some help how to run this stuff, it works mostly just one condition I guess.
I saw a more complex code for this stuff but its a bit too advanced for me at the moment so I’ll try to get a solution for this first.

So I have 2 shelly power plugs that notify me when the usage of a washing machine and tumble dryer drops under 10 watts for 3mins.
This stuff works great for now the only problem is that as it seems the connection to shelly plugs drops 1-3 times per day for a second or two. That means that the script runs again and because the wattage is under 10watts for 3mins it triggers a notification. It kinda gets annoying so I’d only need some delay or something that it does not trigger the script if drops connection.

Any suggestions would be great, thanks in advance.

You can simply insert a pause at the desired location in the automation:

  • delay: 00:00:20
    between teams

So the “delay: 00:00:20” means that the script wont be triggered for the first 20secs after the power plug is back online?

no, if you put this command () between your commands, then after
command1
there will be a pause of 20 seconds
and then it will be executed
command2

How about an automation to set (true/false) an input boolean. Set true when under 10 watts for 3 minutes and false when it exceeds 10 watts. Don’t set the initial value of the input_boolean

alias: Set Boolean Based on Power
description: ''
mode: single
trigger:
 - platform: numeric_state
   entity_id: sensor.light_power
   for:
     hours: 0
     minutes: 3
     seconds: 0
   below: '10'
   id: below_10
 - platform: numeric_state
   entity_id: sensor.washer_power
   id: above_10
   above: '10'
   for:
     hours: 0
     minutes: 0
     seconds: 2
condition: []
action:
 - choose:
     - conditions:
         - condition: trigger
           id: below_10
       sequence:
         - service: input_boolean.turn_off
           target:
             entity_id: input_boolean.washer
   default:
     - service: input_boolean.turn_on
       target:
         entity_id: input_boolean.washer

Trigger the notification on the Boolean going from on to off.

I use a similar idea but with a binary template sensor:

template:
  - binary_sensor:
      - name: "Washing Machine Running"
        icon: "mdi:washing-machine"
        state: "{{ states('sensor.washing_machine_power')|float(0) > 2.5 }}"
        device_class: moving
        delay_off:
          minutes: 1

Automation:

- id: bfde5668-53b4-40a7-83a9-4cbcd54a0081
  alias: 'Washing Machine Finished'
  trigger:
    platform: state
    entity_id: binary_sensor.washing_machine_running
    from: 'on'
    to: 'off'
  action:
...etc