Create automation that blinks a light

Remove the [

1 Like

Thank you!

No ā€œServicesā€ under Developer Tools on my install of the most current version ā€¦

Itā€™s now called ā€œActionsā€.

ā€¦Things have changed in 3 years.

Thanks. I clearly donā€™t get to the developers page much.

Sadly, none of the dozen bulbs in my HA system from 4 manufacturers flash.

Plus, thereā€™s a programming thing I cannot figure out, and might not even be possible in HA.

So the current plan is to simply build a standalone device, entirely outside of HA. Seems a shame, but Iā€™ve already spent more time trying to program this (simple) functionality than if Iā€™d just built it.

Thanks again.

What exactly are you trying to do? Pretty much anything is doable in HA. You donā€™t need the bulbs to have a built-in flash function to get it to flash, as shown in the example above.

I have an aeration pump for my Koi pond. This pump NEEDS to be running 7x24 or the fish will die. (The pond is smallish for the number of fish and size of the fish.)

So I bought the nicest pump I could find ā€¦ German and just a jewel of a device.

And yesterday it stopped pumping, nit because of a failure in the pump but because the GFCI powering it failed.

I was lucky enough to catch it in time THIS time, but next time ā€¦

So my plan is (was) to just plug in a Zigbee smart plug to the same power source and monitor for online/offline status of that plug using an automation.

Flashing with a repeat and toggle is easy enough, as described above. And triggering on offline is similarly easy.

But I CANNOT figure out how to get the ā€œUntil ā€¦ Online againā€ to work. (I donā€™t want the lights to continue to flash away if all is in fact OK.)

The YAML editor finds fault with almost everything Iā€™ve tried. The things it was OK with didnā€™t work.

At this point, a wee bit of external hardware from the scrap box is looking pretty good.

So using the above example as a starting point, you can just replace the condition used there for that of your zigbee plug being unavailable.

  action:
  - repeat:
      while:
      - condition: state
        entity_id: YOUR_ZIGBEE_PLUG_ENTITY
        state: 'unavailable'
      sequence:
      - service: light.toggle
        target:
          entity_id: light.l_escritorio_switch_1
      - delay: '00:00:01'

FWIW, this approach creates dozens of junk log messages (on, off, on, off, ā€¦)

For those that might not yet know: The logbook correctly captures these events, you will see the on/off changes recorded. One method to prevent this is to exclude the related sensor from the recorder - this has the benefit of reducing wear on your storage (SD card, HDD, SDD etc) and keeps the logbook tidy. See the instructions here.

1 Like