ESPHome Smart Oil Diffuser & Nightlight

Hi, I have a Asakuki 500ml Oil Diffuser. If you have a similar wifi-enabled diffuser, the chances are the below, or something similar will work for you. (Beware, various new diffusers do not ship with ESP chips potentially including Asakuki, Feb 2022)

I flashed it with tyua-convert (not possible, wiring required Sep 2021) and had it setup with Tasmota and realized that much of the information on the template page were incorrect. Fortunately a better way of doing things and correct codes were in a similar device. Everything was working 100% but I wanted to use the home-assistant API and I <3 ESPHome.

I compiled an ESPHome config, uploaded it andā€¦ boom was unable to reach the device completely :dizzy_face:.
Use the below code or face the same fate.

logger:
  baud_rate: 0

Fortunately a co-worker helped me with some soldering so I flashed it manually

For anyone else looking to use esphome with their diffuser, this esphome config may be a useful starting point.
Bugs: No ā€˜out of water alertā€™, Does not use a ā€˜lightā€™ in homeassistant, so only the 9 defined colors.

13 Likes

thx for your codes !!!

Thank you very much for sharing! Can you tell us how you did the tuya convert? Is it like any other plug convert, over Wifi? Or any soldering?

Tuya convereted over wifi just like a plug. I donā€™t recall if I had to hold the wifi button to get it into the correct state - or if it just worked without additional interaction. It did take me several attempts and I think I had to fix my tuya convert installation but thatā€™s just due to my setup.

Just be careful to disable logging if/when you flash esphome -

logger:
  baud_rate: 0
1 Like

OK clear thanks a lotā€¦
So basically step by step:
1 Tuya convert to Tasmota
2 Flash with ESPHome with logging disabled
3 Tinker with ESPHome or put the config you proposed here, but make sure you keep logging disabled
Right?

If you know how to use the ā€˜compileā€™ option in esphome, you could probably flash that .bin file instead of the tasmota one at the outset and skip a few steps.
Otherwise your steps look good.

1 Like

I use Jinvoo Smart but believe Tuya and Jinvoo Smart work the sameā€¦ To simply control turning on and off(and disabling rainbow light on start up) I created an automation for On( Triggered by Power On, Actions are Light: Off and Fog: Large Spray) and Off(Triggered by Power Off, Actions are Light: Off and Fog: Off) you can then find them in Home assistant as Scenes that you can activate to turn on or off. Hopefully this helps someone as I did not want to solder.

Thanks OP, this worked very well. I have the exact same diffuser. Compiled the firmware with ESPHome, then flashed with tuya-convert.

I made some changes to your config, mainly to move away from API/service calls to switches.

For all of these I have assumed_state=True, since I may use the buttons on the device itself. If you donā€™t plan on using the buttons, or donā€™t care that the state may become incorrect, you can set these to False.

Replace the service block from the OP with this:

switch:
  - platform: template
    name: ${devicename} Light Static
    id: light_static
    icon: mdi:lightbulb
    optimistic: true
    assumed_state: true
    turn_on_action:
      - if:
          condition:
            switch.is_off: light_rainbow
          then:
            - uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x05, 0x0b, 0x01, 0x00, 0x01, 0x01, 0x18]
      - uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x05, 0x6e, 0x04, 0x00, 0x01, 0x01, 0x7E]
      - switch.template.publish:
          id: light_rainbow
          state: OFF
    turn_off_action:
      - uart.write: [0x55, 0xAA, 0x00, 0x06, 0x00, 0x05, 0x0B, 0x01, 0x00, 0x01, 0x00, 0x17]
      - switch.template.publish:
          id: light_rainbow
          state: OFF

  - platform: template
    name: ${devicename} Light Rainbow
    id: light_rainbow
    icon: mdi:lightbulb
    optimistic: true
    assumed_state: true
    turn_on_action:
      - uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x05, 0x0b, 0x01, 0x00, 0x01, 0x01, 0x18]
      - switch.template.publish:
          id: light_static
          state: OFF
    turn_off_action:
      - uart.write: [0x55, 0xAA, 0x00, 0x06, 0x00, 0x05, 0x0B, 0x01, 0x00, 0x01, 0x00, 0x17]
      - switch.template.publish:
          id: light_static
          state: OFF

  - platform: template
    name: ${devicename} Power High
    id: power_high
    icon: mdi:fan
    optimistic: true
    assumed_state: true
    turn_on_action:
      - uart.write: [0x55, 0xAA, 0x00, 0x06, 0x00, 0x05, 0x67, 0x04, 0x00, 0x01, 0x01, 0x77]
      - switch.template.publish:
          id: power_low
          state: OFF
    turn_off_action:
      - uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x05, 0x67, 0x04, 0x00, 0x01, 0x02, 0x78]
      - switch.template.publish:
          id: power_low
          state: OFF

  - platform: template
    name: ${devicename} Power Low
    id: power_low
    icon: mdi:fan
    optimistic: true
    assumed_state: true
    turn_on_action:
      - uart.write: [0x55, 0xAA, 0x00, 0x06, 0x00, 0x05, 0x67, 0x04, 0x00, 0x01, 0x00, 0x76]
      - switch.template.publish:
          id: power_high
          state: OFF
    turn_off_action:
      - uart.write: [0x55, 0xaa, 0x00, 0x06, 0x00, 0x05, 0x67, 0x04, 0x00, 0x01, 0x02, 0x78]
      - switch.template.publish:
          id: power_high
          state: OFF

Nice! This all makes a lot of sense. I eventually setup all this kind of thing in Homeassistant itself using template switches and service calls (see below). Doing it in esphome would have been way better,.

My main usecase is that it turn itself on and off automatically based on presence and time of day. also only stay on for a few minutes at a time. This means I can stop wasting oil due to olfactory fatigue (noseblindness). It also means the water lasts a very long time.

Have you wondered how to set it up as a light in homeassistant?

I wondered a little bit, but I barely use the light anyway. If I do use it, itā€™s generally Rainbow Mode just for fun.

So, I didnā€™t really bother as it wasnā€™t worth the effort. I think it would be possible, but probably would be fairly hacky.

If you or someone does make it work as a proper light, please post the configs here!

Also, I really wish there was a way to read the state from the diffuser. I would love to know when it runs out of water so I can refill it. When it runs out, it turns off automatically, but HA/ESPHome still think itā€™s on, as the updated state doesnā€™t get reported anywhere. One idea I had was to use an energy monitoring smart plug, and if the diffuser is on according to HA but not using a certain number of watts, mark it as off in HA.

I usually like using esphome whenever possible but in this particular cases, you lose functionality by choosing it over tasmota. With tasmota I can configure to show the states should anyone press the physical buttons. If this feedback would be present in esphome, I would switch in an instant

Hey peopleā€¦ Iā€™d be highly interested in this awesome pice of hack! I just ordered a ASAKUKI Humidifier which should arrive me already tomorrw. Amazon thanks :stuck_out_tongue:

No I am a bit wondering how to Flash this device. I normally work with ESPHome but already playe with Tasmota back in the daysā€¦ Whatā€™s the softare to slash this Humidifier Tuya COnverster? Nev heard if this. Is it part of tasmota?

If yomeone could write a small quick and dirty how-to Iā€™d highly appreciate :slight_smile: I need a WAF immediatelyā€¦ if not I am in D A N G E R :stuck_out_tongue:

@JibbsIsMe I totally agree with @gureyes Tasmota has some clear advantages here such as getting no-water notifications and granular light control.
I may switch back at some point.

@thundergreen, Everything youā€™ll need to OTA convert is here https://github.com/ct-Open-Source/tuya-convert.
WAF?

You have me interested. Iā€™ve only used Tasmota as a temporary firmware to flash ESPHome. How would I get this working with Tasmota? Do you have example configs for this?

WAF = Wife Approval Factor. Basically, things need to work easily and as expected :slight_smile:

Shit I think I bought the wrong one ā€¦thereā€™s no wifi and nothing maked on the device

You were so close! That looks exactly the same as mine, and the one I got was from your link, but you need to get the ā€œWiFi Smart Versionā€ which has the WiFi button on the device and in the pictures. Iā€™d return that and swap it for the right one! Itā€™s a couple bucks more but worth it.

Most recent wifi-diffusers have almost identical features and codes. Take a look through the tasmota ā€˜miscā€™ category for a ā€˜provenā€™ list. Each one has documentation provided by an author who may or may not have improved on the work of the previous.
IIRC the best one had the least setup instructions and utilized a feature only in the newer firmware called TuyaMCU : https://blakadder.github.io/templates/GD-30W.html

That page is rather complex, I might wait to see if someone gets it working on our model of diffuser first, before trying to switch over!