I am building a project that measure power consumption from a blinking LED. A variation of this super good project: GitHub - klaasnicolaas/home-assistant-glow: ⚡ The power of energy measurements in your house.
In order to test the setup I need a “blinking” LED to simulate real life condition. For testing I need af short blink randomly every 1-3 seconds.
I did this to blink shortly every 1 second, but how do I make it random?
switch:
Bummer. My only other thought was to try a random function in lambda to generate the delay, but a quick google shows limited or no success - the only example I could find came up against compile errors.
Solved the problem in a little different way
I used Node Red from Home Assistant to turn on the LED for 200ms, turn it of and wait for a random time interval (between 0.5 sec and 5 sec.) and then repeat the sequence.