RM for Nebulizer control

I've just bought one of those essence nebulizers. It's cool because instead of having an on/off switch as many do it just has a rotary knob for the amount of nebulizer action and so coupled with a cheap smart plug I will automate its operation.

Here's my first attempt at a rule for this.

The idea is that if we are home, it's during the day, and we are not in bed then it should switch on for a short time every 15 mins, but only if motion has been sensed nearby during that period. Didn't test all the permutations yet, but will this work? I'm not at all competent with private booleans and worried if I get this wrong the thing will stay on all day! How to improve?

I also have integrated the switch into other rules to switch on briefly when we get home, off when we go to bed/out, etc. Maybe I need another rule to switch on for 30 mins when the toilet door opens lol? :sweat_smile:

Also because I'm using a cheap Chinese WiFi plug via IFTTT, I'm using the very excellent simple 'virtual always switch' driver found elsewhere on this forum to avoid the inevitable issues I've found in the past managing switches with drivers that don't send a command if they think the device is already in the desired state.

All improvement suggestions welcome!

This is not what will happen because your trigger is based on motion. This rule will only fire if the motion sensor changes from inactive to active. So, if you are in the space and the motion sensor stays active for an hour without going inactive the switch will only turn on once.

Also, you have your private boolean setting back to true via the else statement. That means that motion will have to be active a second time in order for the PB to be set back to true. Any action in an else if only happens if you trigger the rule a second time. You also have a delay of 15 mins but then no action after it, so I'm not 100% sure what you thought that would do. I would recommend removing the else if and setting the private boolean back to true after a delay of 15 minutes. At a minimum you would have to do that to get it to work the way you have designed.

Do you use Modes in your house? It would be a lot easier if you had particular modes that were in effect when you were home and someone was up. Then you could simply use a periodic trigger with the single condition being the mode the house is in.

Ah, thanks for the helpful feedback. The idea is for it to only trigger on when there is motion, but then wait 15 mins before checking again if there has again been motion. I don't want the device on if we are upstairs for example. So just checking if we are home with a mode isn't enough. My thinking was I could use similar rules to trigger nebulizer in other rooms or areas based on this idea. But yeah, I think the rule sucks right now and won't work as-is. Maybe I need 2 rules. This one which just checks a simple virtual switch that gets separately set by a different rule that looks at motion across a 15 minute period.

Will try your ideas and see if I can improve it! Will repost when I finally get it working as I'd like.

Cheers.

Right now the rule will fire, turning the switch on. Then the next time motion goes from inactive to active, the PB will be set to true. Then the next time motion changes from Inactive to Active, the switch will turn on again. I don't know what the timeout of your motion sensor is, but if it is 30 seconds, the switch might turn on every minute instead of every 15.

Yeah, agreed. I have some Xiaomi's which have a 60 second timeout and some Iris which have 30 secs. I'm sure it won't work properly as above. Will try to improve it. I basically just want it to switch on every 15 mins for 2 mins, but only if motion during that time (eg. the room is probably occupied).

Not to go too far off the RM topic here, but since it's relevant to your use (and I'm wondering, too): can I ask what device you're actually using? I've considering automating an essential oil diffuser, but anything I can find either has a "soft" power button (and won't work with cut/restore on a smart outlet) or is basically a small humidifier that seems overkill for the task at hand. (I'm assuming this is the category of device you're talking about, but if "nebulizer" is something totally different, feel free to ignore!)

1 Like

Yeah, I searched and searched in shops and all these devices have momentary buttons for on/off. Which is a pain then to automate. Then I discovered this type of device which has the rotary knob. So now it is very simple to automate (well If only I could get this wretched, seemingly simple rule sorted out lol) :cry:

Here are 2 examples. You can find them in all shapes and sizes. These ones work with pure oil in the glass container. It's really strong. There are others that work with water and a few drops of essence but I can't find a link for that type right now. I have one of that type too that I bought from a shop in Singapore but it broke after a couple of years.

#Aliexpress THB 929.91 50%OFF | Waterless Pure Essential Oil Diffuser Nebulizer Wood Glass Aromatherapy Aroma Diffusers Aroma Diffuser Kids For Home Fog Maker
https://a.aliexpress.com/_dVHANED

2 Likes

Ok, this seems to work nicely. I'm gradually getting the hang of Private Booleans :joy:

1 Like

Now I think to add some type of counter, then send myself a notification when the device needs refilling (based on number of times used and assuming no one messes with the "volume" control). HA is so cool when it works. Now to wait for the hub to crash and leave this thing on all day...

And just in case it may help someone in the future, here is the final result!

3 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.