Following HA’s documentation, I’d created a random sensor, but despite the doc saying “it generates a new state every time it is polled”, that wasn’t my experience (though I haven’t tried it since Oct 2020, can anyone confirm whether it works reliably now?).
Elsewhere in this forum I’ve seen mention of calling a python script, but I’m not currently a python coder. I could do it in a shell script, but am unaware how to import the value back into the automation.
My automation does the following – is this perhaps not “polling” the sensor sufficiently?
Keep in mind that most “random” is not very random at all.
Most is a programmed sequence where you start at a different place and it loops the sequence.
There are some languages and functions that do better random than other, but I have no knowledge of yaml and python in this area.