Seeking A Solution: Essential Oil Diffuser

Does anyone have a solution for an essential oil diffuser? I cannot seem to find one that I can automate.

hi did you find one
im also looking for one that may be integreated in homeassistant

Unfortunately, no, I have not found a solution. :frowning:

Have a look at https://moodo.co

Why not just buy a diffuser, then hack it? If it turns on automatically when plugged in, a sonoff will work just fine to turn it on/off. Integration can be simple.

If a button press is needed to turn it on, you could use an ESP (Wemos D1 Pro Mini’s are easy to work with) wired to the button, and have the ESP trigger the button with an MQTT command or something similar. Numerous possibilities my friend!

1 Like

Thanks for the suggestion. I have a REIDEA 400ml Essential Oil Diffuser, Ultrasonic Aroma Cool Mist Humidifier with Adjustable Mist Mode and it would be great if I could automate on/off. It does not turn-on with power; it turns-on with an ON-button. I already have a MQTT server running, so I like your MQTT/ESP solution.

I think I can probably figure out how to code up a little routine and flash an image, but the MQTT packet composition/reading, the on/off management and the ESP power-cabling/power-mgmt is a bit out of my comfort zone. Any guidance would be appreciated.

Is there a library I can use to read the MQTT packets, do I have access to socket interface or something else?

I’m not really clear on how/what to do for the on/off. I assume I’m running a new wire from the power button to the ESP and then coding that when I get a MQTT event I power on the pin of the board that is connected to the on/off button. Is that right?

Are you aware of any project/guide that does something similar that I can leverage?

Also, I think I also have to run another wire to the ESP for power. Is there no simple way to leverage the diffuser’s power line? If there’s no easy way to do this, which is my suspicion, then I’d either need to poke a hole in the diffuser to run the second power/usb line to the ESP, sitting in the diffuser, or I’d need the ESP to sit in a little chassis outside of the diffuser and I’d need the wire running from the ESP chassis into diffuser. Either way I’m poking a hole in the diffuser; am I misunderstanding something?

I think I have a solution that in theory should work.

Use a wemos d1 mini pro and flash it with espeasy. This will give you easy integration with home assistant. If you’ve never worked with espeasy there are quite a few tutorials online or I could probably give you more info if needed, but I find flashing wemos d1 minis to be the easiest. I just threw one into my tv yesterday so now home assistant can see my tv’s on/off state as well as control the power.

After flashing espeasy, run a wire from the button of the diffuser to one of the GPIO’s of your Wemos. Let’s say GPIO8. Im assuming there is a light in the diffuser that illuminates. If you have a multimeter measure the voltage and see if it’s less than 5 volts. If it is, go ahead and run a wire from there to another GPIO, say GPIO7.

Log onto the espeasy’s webserver and set up your MQTT credentials, for Home Assistant select Openhab as your config. Under the Devices tab you’ll want to add a device, Switch input, and select GPIO7. Ensure “Send to controller” is enabled. This will send a 0 or a 1 to your MQTT server if your diffuser is turned on or off.

Controlling the button itself, you’ll want to create an MQTT switch in your Home Assistant config.

According to the Espeasy wiki:
Pulse,, 0…16 , To send a short pulse to a certain pin.

Example to send an active high (1) pulse on GPIO 14 for 500 mSeconds. Pulse duration is in milliseconds. State is 1 or 0. http:///control?cmd=Pulse,14,1,500 MQTT: Pulse,14,1,500

So you will create your MQTT switch and tell it to publish “Pulse,8,1,500” to the topic your esp is listening to. You will also need to create a binary sensor which will show your diffusers on/off state in Home Assistant. After that all of that, you will then create a template switch which will combine the two into one switch that shows a true on/off.

If you’re willing to go that far I could give you more help on the config.

As far as powering the device, I notice the diffuser is powered by an adapter. What’s the voltage? If it’s 9-12v, buy a cigarette lighter usb adapter and rip it apart to make it small enough to fit inside the diffuser and then solder it to the incoming connections. Then get a small enough usb cable to connect it to the wemos.

I think I’ve covered most of it lol.

1 Like

Thanks for the ideas, timpro. I am willing to do this.

Can you confirm the HW I’m going to need for this? I already have computers I can use to download and run the flashing SW.

Clearly I need an ESP, WINGONEER D1 Mini Pro - 16M Bytes External Antenna Connector ESP8266 WIFI IoT Board is what I’m eyeing.

This article suggests that I’m going to need:
Breadboard 3.3V power supply
3.3V FTDI USB module
Breadboard
Jumper wires

I suppose I also need a mini-USB to USB cable.

Regarding power, I think it’s 24V, here it is:

If you don’t mind waiting a little bit for shipping, I highly suggest buying from Aliexpress (find a shipper that ships ePacket as you get a tracking number and ships faster), you will save yourself a lot of money. Type in Wemos D1 Mini, they use an ESP-12 mounted to a prototype board which you can easily work with. The version you found on amazon will need an external antenna, this may be a little overkill for an oil diffuser :wink:

I’d suggest buying a couple, as you may accidentally burn it out if you’ve never worked with one before. I still make mistakes and blow the odd one up. Plus, chances are once you get your oil diffuser automated you’ll want to keep going!

Once you have your Wemos, you will connect it to your computer using a micro-usb to usb cable. You’ll need to go to the ESPEasy site to download their firmware.

Tutorial ESPEasy Firmware Upload - Let's Control It

The wemos d1 mini with an esp-12 will have 4096K of memory, so you’ll need to select that when uploading the firmware.

Once uploaded, unplug the usb and plug it back in to give it a good powercycle, then let it sit for a minute. Eventually it will broadcast an access point that you will log onto, and this is where you tell the Wemos what wifi network to connect to, and password. Once it completes its setup, it’ll give you it’s IP address. You can then log back onto your wifi network and navigate to the IP of the Wemos.

From this point, you will enter your mqtt credentials and configure your gpio’s. Once done, you will need to solder a wire from the button to which ever GPIO you’ve configured it to, etc. Then comes the Home Assistant configuration.

If you let me know how far you get, I can help you out some more. :slight_smile:

As far as powering goes, it might be easiest to run a separate power cable to power the wemos using a cheap wall brick and cable from the dollarstore. It is possible to use the 24v adapter but that would require the use of step-downs and what not. If someone else wanted to weigh in on this that would be great, powering isn’t my specialty (as I mentioned I’ve blown a few things up, you learn as you go lol).

Here’s my current candidate: ESP8266 ESP-12 ESP12 WeMos D1 Mini Module Wemos D1 Mini WiFi Development Board Micro USB 3.3V Based On ESP-8266EX 11 Digital Pin

Also, FWIW, here’s the inside of the diffuser.

The link you provided is the correct one. If they ship with ePacket (it usually costs a $1-2) you might want to select that option otherwise it you’ll be waiting over a month to receive it, in my experience :). I find on Aliexpress I will look at multiple listings until I find a seller that ships ePacket at a reasonable price.

Looking at the inside of your diffuser, it seems simple enough. Essentially you’re going to want to tap onto the LED that turns on with power and solder it to one of the GPIO’s on the Wemos. Then the same for the push button.

I’ve received the ESPs and I’ve flashed one with ESP Easy R120. v2.0 would not connect to my wireless access point.

The ESP is on my local network, accessible via the web interface. I’ve entered my mqtt broker credentials.

A few questions:

  1. The ESP may be subscribing with the client ID: “ESPClient0” and not “diffuser”. At least this is what my MQTT broker’s (mosca) log suggests.

    `logs/mosca.log:11811:{“pid”:14,“hostname”:“mosca”,“name”:“mosca”,“level”:20,“time”:1524614051222,“msg”:“pingreq”,“client”:“ESPClient0”,“v”:1}
    logs/mosca.log:11812:{“pid”:14,“hostname”:“mosca”,“name”:“mosca”,“level”:20,“time”:1524614051222,“msg”:“setting keepalive timeout”,“timeout”:22500,“client”:“ESPClient0”,“v”:1}

I’m not terribly worried about this but it’s not what I expected.

  1. How do I map ESPEasy’s GPIO layout to the ESPs? The ESP8266 has labels like D[0-8], but the ESPEasy suggests labels like GPIO-[0-16], but with a few entries greyed-out. Does D0 map to GPIO-0? I cannot understand the greyed-out GPIOs in the input.

This post suggests that I should be able to set the ‘First GPIO: GPIO-5 (D1)’ but I don’t seem to have that setting. I wonder if it’s a ESPEasy v2 feature vs. R120 that I am using (see above wireless AP problem).

ESP8266

  1. Can I create a log entry or some LED-blinks on the ESP upon receiving the MQTT event? I’d like to confirm that I’m receiving events properly before cutting any wires on the diffuser.

Wouldn’t wiring in a sonoff basic be easier and potentially cheaper option?
Flash with Tasmota and integration is easy

I filed a ticket against ESP Easy and found that the ESP_Easy_v2.0-20180322_normal_ESP8266_4096.bin image allowed me to connect to my AP.

I’ve answered a few of my own questions:

Q1) The ESP may be subscribing with the client ID: “ESPClient0” and not “diffuser”. At least this is what my MQTT broker’s (mosca) log suggests.

A1) There is better logging with the new ESP Easy image. ESPClient_XX:XX:XX:XX:XX:XX is the client ID, and it subscribes to “/diffuser/#”. This all looks fine to me.

Q2) How do I map ESPEasy’s GPIO layout to the ESPs? The ESP8266 has labels like D[0-8], but the ESPEasy suggests labels like GPIO-[0-16], but with a few entries greyed-out. Does D0 map to GPIO-0? I cannot understand the greyed-out GPIOs in the input.

A2) I seem to have the better labeled selections for the GPIO to ESP tag mapping. For example, the drop-down-box allows me to select “1st GPIO: GPIO-0 (D3)”. I’m not sure what the significance of “1st” is. I suppose I need to read more…

Q3) Can I create a log entry or some LED-blinks on the ESP upon receiving the MQTT event? I’d like to confirm that I’m receiving events properly before cutting any wires on the diffuser.

This last one is still open. I’ll post progress if I make any…

It looks like a simpler device, but if I read correctly it’s also a few inches long. I’m not sure if it will fit in the diffuser enclosure. Also, most instructional videos I watched had the Sonoff intercepting the power cable. I need to intercept the wire from the button-press (what would you call this wire?). Is this possible from the sonoff? The diffuser requires a button-press to activate.

I’m not proficient in EE, so sorry for the sloppy language. :slight_smile:

I know this thread is a bit old, but I’m looking for the same ability – controlling a diffuser. What about one of these WiFi ones, like this? I can’t find any info about an API, but if it works with Alexa, there must be an API, right? Perhaps it can be reverse engineered?

2 Likes

I looked into this same setup using a Wemos D1 Mini into a diffuser. The Wemos Power shield can take 7-24V input so that was taken care of. I never got around to probing the diffuser to see if the board converted to 12v for the LED’s and control board. I think 24v is usually needed for the ultrasonic mister and fan.

I found no room to mount a flat pcb as the units are all rounded. Maybe a bigger 500ml model with a larger base would have the room to fit the electronics needed. I also found it low priority since its a pretty useless feature with such a small resovoir in these units.

For anyone still looking for an aromatherapy / oil diffuser, this one works as a Sonoff device right out of the box.
https://amzn.to/2I39lou

The only catch is that it is on/off only and can’t control the LED color or brightness. Other than that, it works great and going through HA is much easier than using the eWeLink app.

1 Like

Thank you for the update! I actually bought this device last year because I could program a timer, which was at least some level of automation.

What do I need to integrate it with HA? Do I need a Sonoff RF Bridge or something else? Any recommendation would be appreciated.

1 Like