Exploring Randomized Duty Cycles for Smart Devices

I’ve been diving into the world of smart home automation, and it’s been an exciting journey! One feature I’ve been particularly interested in is automating devices with randomized duty cycles. I recently came across a post where someone shared their experience with setting up a humidifier using a timer, which got me thinking about how I could apply similar logic to my diffuser.

Here’s my use case: I want to run my diffuser for a total of 15 minutes every hour, but instead of having it run continuously, I’d like to spread those 15 minutes into random bursts throughout the hour. Each burst should be between 30 to 120 seconds, and the timing should be completely random. This way, the diffuser isn’t predictable, and it adds a nice, subtle touch to my home environment.

I’ve already set up a tank empty sensor to turn off the unit when the tank is empty, and I plan to add a presence sensor in the future. The challenge now is figuring out how to implement this randomized duty cycle. I’ve heard that OpenHAB has some powerful rule engine capabilities, but I’m not entirely sure how to structure the rules to achieve this randomness.

If anyone has experience with this or can provide some coding examples, I’d be incredibly grateful! It would be amazing to see how others have tackled similar problems and maybe even learn some new tricks along the way. Let’s explore this together and make our smart homes even smarter! :blush: