ESPHome Smart Oil Diffuser & Nightlight

Rule1 0
Rule1 on TuyaReceived#data=55AA010700056E040001007F do publish2 stat/diffuser/EFFECT rgb_cycle endon on TuyaReceived#data=55AA010700056E0400010180 do publish2 stat/diffuser/EFFECT color endon on event#rgb_cycle do tuyasend4 110,0 endon on event#color do tuyasend4 110,1 endon on event#ON do backlog tuyasend4 110,1 ; tuyasend1 11,1 endon on event#OFF do tuyasend1 11,0 endon on power3#state=1 do tuyasend4 103,1 endon on power3#state=0 do tuyasend4 103,0 endon

Rule1 1

21:34:54 CMD: Rule1 1
21:34:54 MQT: stat/diffuser/RESULT =

Turn on choose color and it spin , so i turn off oscillate when it get the right color and it is fixed but as soon as i pick up a color from the board oscillate comes back to onā€¦

weirdā€¦

I think this is because homeassistant sends and ā€˜onā€™ event with every change on a light. I must have disabled this in my homeassistant mqtt configuration at some point.

Thanks , thatā€™s a start ā€¦ if you find it shareit , i ll try to search for it as well :slight_smile:

Hi sorry , any clue where to add the line ?
thanks

Compare this to your mqtt configuration in homeassistant. I think I may have removed a line so not sure what I changed.

light:
    - platform: mqtt
      name: "Diffuser Lamp"
      command_topic: "cmnd/asakuki/EVENT"
      state_topic: "tele/asakuki/STATE"
      state_value_template: "{% if value_json.POWER2 == 'ON' %}{% if value_json.POWER5 == 'ON' %}ON{% else %}OFF{% endif %}{% else %}OFF{% endif %}"
      payload_on: "ON"
      payload_off: "OFF"
      on_command_type: brightness
      brightness_command_topic: "cmnd/asakuki/Dimmer"
      brightness_state_topic: "tele/asakuki/RESULT"
      brightness_scale: 100
      # brightness_value_template: "{{ value_json.Dimmer }}"
      brightness_value_template: "{% if value_json.TuyaReceived is defined and value_json['TuyaReceived'].DpId == 108 %}{{ value_json['TuyaReceived'].Type3Data[12:14]|int(base=16) }}{% endif %}"
      availability_topic: "tele/asakuki/LWT"
      payload_available: "Online"
      payload_not_available: "Offline"
      qos: 1
      retain: false
      rgb_command_topic: "cmnd/asakuki/tuyasend3"
      rgb_command_template: "{% set brightness = state_attr('light.diffuser_lamp','brightness') | int %}{{ '108,%02x%02x%02x646464' | format(red, green, blue)}}{{ '%02x' | format(brightness) }}"
      rgb_value_template: "{% if value_json.TuyaReceived is defined and value_json['TuyaReceived'].DpId == 108 %}{{ (value_json['TuyaReceived'].Type3Data[0:2]|int(base=16),value_json['TuyaReceived'].Type3Data[2:4]|int(base=16),value_json['TuyaReceived'].Type3Data[4:6]|int(base=16)) | join(',')}}{% endif %}"
      rgb_state_topic: "tele/asakuki/RESULT"

thanks , is the ā€œon_command_typeā€ , it solves the rgb

so how did you solve your RGB rainbow? I stuck with it :frowning: everything else works

Asakuki Wifi, Tasmota 8.3.1, GD-30W template:

Hi I solved the constant switching to rgb_cycle from Hassio by changing Rule1 in tasmota to:

Rule1 on TuyaReceived#data=55AA000700056E040001007E do publish2 stat/GD-30W/EFFECT rgb_cycle endon on TuyaReceived#data=55AA000700056E040001017F do publish2 stat/GD-30W/EFFECT color endon on event#rgb_cycle do tuyasend4 110,0 endon on event#color do tuyasend4 110,1 endon on event#ON do backlog tuyasend4 110,1 endon on event#OFF do tuyasend1 11,0 endon on power3#state=1 do tuyasend4 103,1 endon on power3#state=0 do tuyasend4 103,0 endon

To make this work you have to turn Light mode (Power5) to 1. Still work in progress, but functional.

1 Like

ESPHome has released 1.15 which includes Tuya Fan and Tuya Binary sensor. This could be interesting.

1 Like

Hi, wonder if someone could help me. I flashed tasmota using tuya convert, my device broadcasts the tasmota wifi ap and I connect to it to enter my home wifis ssid and password. I click save and it says its rebootingā€¦

I assume at this point it is supposed to connect to my home wifi network, but all that happens is the tasmota ap appears back up. Now I am stuck in this loop. What am I doing wrong? Thanks.

Are you connecting to a regular 2.4Ghz network? Anything 5Ghz will not work with 95% of consumer IoT devices.
Beyond that all I can suggest is using the ā€˜show passwordā€™ button to make 100% certain of the password, sometimes mobile keyboards mess with us.

1 Like

Thanks. I tried a few times and Iā€™m not sure what got it working but eventually it took the ssid and password, very odd. I think I may have cleared out both ssid and password fields and typed manually, its possible I had always had the ssid populated by clicking discover networks and clicking my network which populated the ssid field and that upset it? Not sure.

Iā€™ve now been at it for some time (a lot of trial and error and reading through other tasmota threads), and somewhat shockingly I have actually got as far as getting it into HA and I can control it somewhat :slight_smile: I have in entities 4 switches, 1 light. 1 binary sensor and a state sensor which were auto discovered. They are named in HA tasmota, tasmota2, tasmota3 etc., these are making the light turn on etcā€¦ At first I could not get HA to discover it but then I found in another tasmota thread SetOption19 1 command to send in the console. Then HA discovered the device and the entities above.

So now I have these entities but none of which appear to allow me to control the colour correctly (seems just on or off and no brightness or specific colour picker). Further down on https://templates.blakadder.com/GD-30W.html in the HA configuration section I added that code shown to my configuration.yaml and now have those entities from the screenshot there which I can add to my HA dashboard. But they show as unavailable. If I click on them and their settings it says they dont have a unique ID and so can not be configured in the UI - I assume because I added directly to config file I must edit them there also.

I guess my issue is I am new to HA and still very much stumbling through the learning curve. My assumption is the new entities are not bound to the device correctly, looking at the yaml I again assume the topics are how they are associated to something so maybe the topics are wrong in config.yaml? - but its a little beyond me. Any thoughts?

Did you manage to get it working?

Hi i bought this one:

Partially it is working with this:

But I can not changle color only turn it on and off, but that is also working very buggy.

Simple power off and on works okay.
How the config should change for HA?

My device resembles this one (https://templates.blakadder.com/maxcio_400ml_diffuser.html).

I know this isnā€™t exactly the 100% correct place for this but it seemed to fit well in this thread. I have a wifi diffuser (https://www.amazon.com/Smart-Wifi-Essential-Aromathery-Diffuser/dp/B0799D1TDH). I was able to flash tasmota on it after a little soldering. But that is basically as far as I can get. I have tried several different configurations but no matter what I do none of the buttons from the rules are able to control the device at all. The physical buttons on the diffuser still work without issues.

The console just continually repeats these messages

SRC: Rule
15:24:39 CMD: Group 0, Index 5, Command ā€œSERIALSENDā€, Data ā€œ55aa0001000000ā€
15:24:39 RSL: stat/tasmota_3C28C8/RESULT = {ā€œSerialSendā€:ā€œDoneā€}
15:24:40 RUL: MQTT#CONNECTED performs ā€œserialsend5 55aa0001000000ā€
15:24:40 SRC: Rule
15:24:40 CMD: Group 0, Index 5, Command ā€œSERIALSENDā€, Data ā€œ55aa0001000000ā€
15:24:40 RSL: stat/tasmota_3C28C8/RESULT = {ā€œSerialSendā€:ā€œDoneā€}
15:24:41 RUL: MQTT#CONNECTED performs ā€œserialsend5 55aa0001000000ā€
15:24:41 SRC: Rule

This is literally my first custom firmware and first mqtt device, so I am really struggling trying ot figure out the next troubleshooting step. Any help is greatly appreciated. I also have no issues moving to esphome if it is easier for these kinds of devices.

Welcome to the forums. To get started try the ā€˜consoleā€™ view of tasmota to enter ā€˜serialsendā€™ type commands (or any really) from other diffuser templates until you find some that work. Make sure you have a new version of tasmota.

There is now a Tuya Home Assistant integration. Iā€™m curious to know whether this simplifies things with the diffuser and maybe removes the requirement to flash it? Anyone tried it? Are there any disadvantages?

Edit: It looks like the Tuya integration does not include diffusers, so I assume that means no chance of control in HA?

Doesnt help you, but if you do find a solution Iā€™d love to here it. Basically mine is unused now as it doesnt work as required and Iā€™m clearly not smart enough to figure it out. Wish Iā€™d never flashed it!

We have the Maxcio 400ML since christmas and it works with the normaly tuya integration but you only get an on/off switch no light control.
i made a scene in the tuya app that it is on for 1 hour and this also shows up in ha without doing anything else

hi, and sorry my bad english, i have this BlitzWolfĀ®BW-SH2 4L humidifier and last tasmota, template blitzwolf BW-FUN 3, i can on/off and one light, the on is slow speed, cant found for fast speed, read and read 3 days and cant do it, somebody flash this model?, thanls

2 Likes