Maxcio 400ml Smart Aromatherapy Diffuser Tasmota Install (Part 2)

Diffuser Tasmota Install

NOTICE: This device now comes with a Wi-Fi module incompatible with Tasmota. If you wish to do diffuser Tasmota install in a modified way, you will need to start with a processor transplant of some sort, likely an ESP-12 module (I think might work)…

In addition, I am scooping the text below from Blakadder’s website so that it is not revised-severely / removed from his site as I rely on that to help you thru this…

In this video (dated 2020) I pull my Maxcio 400ml Smart Aromatherapy Diffuser out of the Tuya cloud and bring it home to my Home Assistant instance.

I use TuyaConvert and TuyaDonor to load Tasmota 8,2 on the Device. Then I use the Template from BlackAdder’s website to make it work in HA without the SmartLife App.

Along the way we find a bug (real one) and almost brick the device. You also get to see what happens if you don’t do Reset 5 or set SetOption65 to 1 when the thing tries to explode.

Notice: The following content is based on Blakadder’s page: (https://templates.blakadder.com/GD-30W.html)

It was copied here so that it was available to my readers and not removed from Blakadder’s site due to obsolescence. Please check Blakadder’s site for updates but if this is no longer on that site, please contact me for information regarding this.

I have made a few changes from the original…

Blakadder’s site is an invaluable asset to the community and I encourage you to check for Tasmota firmware changes to devices there first.

Template:

{"NAME":"GD-30W","GPIO":[255,255,255,255,255,255,0,0,255,255,255,255,255],"FLAG":0,"BASE":54}

by blakadder

Please read TuyaMCU article to understand the terminology and configuration process.

There are a few different looking devices using the same PCB marked GD-HDFW05-v1.0 so this process should work on those.

Functions

  • dpID 1 device power: 0 = off / 1 = on

  • dpID 11 led power: 0 = off / 1 = on

  • dpID 12 error notification: 0 = ok / 1 = error

  • dpID 13 countdown mode options: 0 = off / 1 = 1hr / 2 = 3hr not needed with Tasmota

  • dpID 14 countdown status: reports value of 0…360 minutes not needed with Tasmota

  • dpID 103 mist strength: 0 = low / 1 = high

  • dpID 108 led color: 14 char value in hex (can define only RGB and send HSV value as max: RRGGBBffff6464)

  • dpID 110 led mode: 0 = rgb_cycle / 1 = color / 2 = white

  • dpID 111 led dimmer color and white mode only it is important to define ‘DimmerRange 1,255’

Configuration

After applying the template and configuring Wi-Fi and MQTT issue:

Backlog SetOption66 1; TuyaMCU 21,111; TuyaMCU 11,1; TuyaMCU 12,11; TuyaMCU 13,103; TuyaMCU 14,12; TuyaMCU 15,110; DimmerRange 1,255; SetOption59 1
Rule1 on TuyaReceived#Data=55AA010700056E040001007F do power5 0 endon on TuyaReceived#Data=55AA010700056E0400010180 do power5 1 endon on power5#state=0 do tuyasend4 110,0 endon on power5#state=1 do tuyasend4 110,1 endon  

Breaking that down:

(NOTE: You will have to adjust these topics to match your device requirements)

  • Tuya tells HA that it selected light cycle mode (power5 off): –> "on TuyaReceived#Data=55AA010700056E040001007F do power5 0 endon"

  • Tuya tells HA that it selected set color mode (power5 on): –> "on TuyaReceived#Data=55AA010700056E0400010180 do power5 1 endon"

  • HA tells Tuya that it selected light cycle mode: –> "on power5#state=0 do tuyasend4 110,0 endon

  • HA tells Tuya that it selected set color mode: –> "on power5#state=1 do tuyasend4 110,1 endon"

Rule2 on event#ON do backlog tuyasend 11,1 ; 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 on TuyaReceived#data=55AA010700050C050001011F do power4 1 endon on TuyaReceived#data=55AA010700050C050001001E do power4 0 endon

Breaking that down:

  • HA tells Tuya to turn it all on. –> "on event#ON do backlog tuyasend 11,1 ; tuyasend4 110,0 endon"

  • HA tells Tuya to turn it all off. –> "on event#OFF do tuyasend1 11,0 endon"

  • HA tells Tuya that it set the fan (mist) to high speed. –> "on power3#state=1 do tuyasend4 103,1 endon"

  • HA tells Tuya that it set the fan (mist) to low speed. –> "on power3#state=0 do tuyasend4 103,0 endon"

  • Tuya tells HA that it ran out of water (Error Condition) –> "on TuyaReceived#data=55AA010700050C050001011F do power4 1 endon"

  • Tuya tells HA that there is water (No Error) –> "on TuyaReceived#data=55AA010700050C050001001E do power4 0 endon"

Backlog Rule1 1; Rule2 1

Breaking that down:

  • Make sure Rule1 and Rule2 are enabled: –> "Backlog Rule1 1; Rule2 1"

Optional rule used to prevent the device going into countdown mode (f.e. using on device controls) and complete MCU status update on restart

Rule3 on TuyaReceived#data=55AA000700050D040001011E do tuyasend4 13,0 endon on TuyaReceived#data=55AA000700050D040001021F do tuyasend4 13,0 endon on mqtt#connected do serialsend5 55aa0001000000 endon

Breaking that down:

  • Turn countdown timer off. –> "on TuyaReceived#data=55AA000700050D040001011E do tuyasend4 13,0 endon "

  • Turn countdown timer off. –> "on TuyaReceived#data=55AA000700050D040001021F do tuyasend4 13,0 endon "

  • Turn countdown timer off on MQTT Connect. –> "on mqtt#connected do serialsend5 55aa0001000000 endon"

Rule3 1

Breaking that down:

  • Make sure Rule3 is enabled: –> "Rule3 1"

What you get:

  • Relay1 turns the diffuser on or off in stored mist strength mode, turns led on or off in stored mode and serves as device power status
  • Relay2 turns light on or off and serves as light power status.
  • Relay3 mist strength mode and control using Rules
  • Relay4 is used for error status (ON = error), no control
  • Relay5 is used for light mode status (0 = rgb_cycle, 1 = color), no control

Label webUI buttons:

Backlog WebButton1 Power; WebButton2 Light; WebButton3 Mist Mode; WebButton4 Error; WebButton5 Light Mode

LED mode status is reported to mqtt topic stat/GD-30W/EFFECT and command Event is used to control some functions using TuyaSend4 command. All this is defined in Rules.

Color can be changed using TuyaSend3 108,RRGGBB64646464 (RR, GG and BB are hex value) only in color mode.

Dimming works using slider and Dimmer command but only when in color mode, in rgb_cycle there are no brightness controls.

Long press on device’s power button initiates Tasmota’s Wi-Fi config

Home Assistant configuration

This implementation is suited to specific needs and does not incorporate all features of the device, mostly to avoid weird situations and wrong states being reported.

Fan is the diffuser. Oscillation switch is used to toggle between rgb_cycle (oscillation on) and color (oscillation off). Light component is the device’s RGB light but only when its in color mode, when in rgb_cycle mode light state in HA is off since you cannot control anything anyway. Binary_Sensor uses the dpId 12 to show when the diffuser is out of water.

configuration.yaml

NOTE: You will have to adjust these topics to match your device requirements and you will need to replace the following in each code sample below with 3 unique strings to identify the entity within Home Assistant.

#/enter any unique string here/
fan:
  - platform: mqtt
    name: "Diffuser"
    unique_id: #/enter any unique string here/
    availability_topic: "tele/GD-30W/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
    state_topic: "tele/GD-30W/STATE"
    state_value_template: "{{ value_json.POWER1 }}"
    command_topic: "cmnd/GD-30W/POWER1"
    payload_on: "ON"
    payload_off: "OFF"
    percentage_state_topic: "tele/GD-30W/STATE"
    percentage_value_template: >
      {% set forces_diffusion={"OFF":1,"ON":2} %}
      {{ forces_diffusion[value_json.POWER3] if value_json.POWER1!='OFF' else 0 }}
    percentage_command_topic: "cmnd/GD-30W/POWER3"
    percentage_command_template: >
      {% set forces_diffusion={0:"OFF",1:"OFF",2:"ON"} %}
      {{ forces_diffusion[value] }}
    speed_range_max: 2
    qos: 1
light:
  - platform: mqtt
    name: "Diffuser Lamp"
    unique_id: #/enter any unique string here/
    command_topic: "cmnd/GD-30W/EVENT"
    state_topic: "tele/GD-30W/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"
    brightness_command_topic: "cmnd/GD-30W/Dimmer"
    brightness_state_topic: "tele/GD-30W/RESULT"
    brightness_scale: 100
    on_command_type: brightness
    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/GD-30W/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
    qos: 1
    retain: false
    rgb_command_topic: "cmnd/GD-30W/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/GD-30W/RESULT"
binary_sensor:
  - platform: mqtt
    name: "Water you GOT"
    unique_id: #/enter any unique string here/
    state_topic: "stat/GD-30W/POWER4"
    payload_on: "ON"
    payload_off: "OFF"
    availability_topic: "tele/GD-30W/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
    qos: 1
    device_class: problem

Episode 24

Video related links:
Template Repository from Blackadder:
https://templates.blakadder.com/
TuyaConvert / TuyaDonor Video by Digiblur:
https://youtu.be/dt5-iZc4_qU
Amazon buy affiliate link ink:
https://amzn.to/2wLme3p

Contact Links:
What are we Fixing Today Homepage / Website:
https://www.WhatAreWeFixing.Today/
Channel Link URL: (WhatAreWeFixingToday)
https://bit.ly/WhatAreWeFixingTodaysYT
What are we Fixing Today Facebook page (Sir GoodEnough):
https://bit.ly/WhatAreWeFixingTodaybFB
What are we Fixing Today Twitter Account (Sir GoodEnough):
https://bit.ly/WhatAreWeFixingTodayTW
Discord Account: (Sir_Goodenough#9683)
https://discord.gg/Uhmhu3B

Please help support the channel:

Patreon: https://www.patreon.com/WhatAreWeFixingToday

Buy me Coffee: https://www.buymeacoffee.com/SirGoodenough
PayPal one-off donation link: https://www.paypal.me/SirGoodenough
Cash App $CASHTAG: https://cash.me/$SirGoodenough
Venmo cash link: https://venmo.com/SirGoodenough

If you would like to donate anything to this channel, please use this address:
C/O: Sirius GoodEnough
322 Buena Vista Ave.
Department: DYT
Waukesha, Wisconsin, 53188-3602

Link to this video on YouTube:
https://youtu.be/ajnb5Gc_kFA

I retired from a large mid-western medical equipment manufacturer on December 31 (2019) and decided to try to let everyone in on my life and my transition into retirement. I have a varied set of interests. I live in a 90 year old cape cod in the middle of a small city of 70,000 people. I have a small lot across the street from the city seat of government, but despite that I have a 1952 Allis Chalmers farm tractor that I drive around the city from time to time. My wife has a business that has me fixing and creating cool home decor out of broken windows and drywall screws. I have been known to buy things on 'for sale' lists, fix it up, clean it up, generally add value and sell it off. Oh, yes, I'm getting chickens! But first I have to build the chicken coop and run. It will be like no other you have ever seen. Also will give me something to do. I am into home automation, have a Home Assistant enabled home and so will the chickens! I'll have to give them a password...
Social Media Auto Publish Powered By : XYZScripts.com