Thanks! I got my recent purchase working using your config with a generic ESP-07 ESP8266 module wired to the 4 pin connector - just changed the TX/RX pins to suit. I did try programming the Duux board but it wasn’t having it - either locked now or I had some other issue.
@KipK I didn’t know about macvlan, sound like a good additional tool!
After getting the MQTT part sorted out I now also created an MQTT Fan config in Home Assistant:
# MQTT fan
mqtt:
- fan:
name: "DUUX Whisper Flex 1"
unique_id: "DUUX Whisper Flex 1"
# On/Off command and state
command_topic: "sensor/[mac-address]/command"
command_template: "tune set power {{ value }}"
state_topic: "sensor/[mac-address]/in"
state_value_template: "{{ value_json.sub.Tune[0].power }}"
payload_on: 1
payload_off: 0
# Oscillation command and state
oscillation_command_topic: "sensor/[mac-address]/command"
oscillation_command_template: "tune set swing {{ value }}"
oscillation_state_topic: "sensor/[mac-address]/in"
oscillation_value_template: "{{ value_json.sub.Tune[0].swing }}"
payload_oscillation_on: 1
payload_oscillation_off: 0
# Preset modes
preset_mode_command_topic: "sensor/[mac-address]/command"
preset_mode_command_template: "{{ {'normal': 'tune set mode 0', 'wind': 'tune set mode 1', 'night': 'tune set mode 2'}[value] | default('tune set mode 0') }}"
preset_mode_state_topic: "sensor/[mac-address]/in"
preset_mode_value_template: "{{ {0: 'normal', 1: 'wind', 2: 'night'}[value_json.sub.Tune[0].mode] | default('0') }}"
preset_modes:
- "normal"
- "wind"
- "night"
# Fan speed
percentage_command_topic: "sensor/[mac-address]/command"
percentage_command_template: "tune set speed {{ value }}"
percentage_state_topic: "sensor/[mac-address]/in"
percentage_value_template: "{{ value_json.sub.Tune[0].speed }}"
speed_range_max: 26
speed_range_min: 1
this should allow you to not use DNAT but just DNS entry.
DNAT can slow down a bit your browsing experience ( depending of your router/fw specs )
I have my Threesixty 2 working now, through MQTT with a load of DHCP, DNS and mosquitto magic. In case anyone is interested, here’s my configuration:
mqtt:
climate:
- name: Duux Threesixty 2
unique_id: duux360_1
modes: ["off", "auto"]
mode_state_topic: "sensor/90:38:0c:eb:5a:80/in"
mode_state_template: "{% if value_json.sub.Tune[0].power == 0 %}off{% else %}auto{% endif %}"
mode_command_topic: "sensor/90:38:0c:eb:5a:80/command"
mode_command_template: "tune set power {% if value == 'off' %}0{% else %}1{% endif %}"
payload_on: 1
payload_off: 0
fan_modes: ["low", "medium", "high"]
fan_mode_state_topic: "sensor/90:38:0c:eb:5a:80/in"
fan_mode_state_template: "{% if value_json.sub.Tune[0].mode == 0 %}high{% elif value_json.sub.Tune[0].mode == 1 %}normal{% else %}low{% endif %}"
fan_mode_command_topic: "sensor/90:38:0c:eb:5a:80/command"
fan_mode_command_template: "tune set mode {% if value == 'high' %}0{% elif value == 'medium' %}1{% else %}2{% endif %}"
temperature_state_topic: "sensor/90:38:0c:eb:5a:80/in"
temperature_state_template: "{{ value_json.sub.Tune[0].sp }}"
temperature_unit: "C"
temp_step: 1
max_temp: 25
min_temp: 15
temperature_command_topic: "sensor/90:38:0c:eb:5a:80/command"
temperature_command_template: "tune set sp {{ value }}"
current_temperature_topic: "sensor/90:38:0c:eb:5a:80/in"
current_temperature_template: "{{ value_json.sub.Tune[0].temp }}"
Do you lot think this also works with the Edge? I’m thinking of biting the bullet and getting a couple, and if I can de-cloudify them it’d be incredible.
I’ve just upgraded my Duux Whisper Flex Fan with M5NanoC6.
The Grove connector on “Unbuckled Grove Cable” almost perfectly fits into the connector on the fan’s main board. First, cut off the clip (it is a little bit in the way) and then pull out the pins (use a needle to gently lift little plastic locks to release the pins). Then rearrange the pins to match the pinout on the board and put them back into the connector. The polarity is oposite than in the original Grove connector, so be careful and double check the wiring.
The fan will provide the power through the Grove connector, so don’t connect the USB and the fan at the same time.
Before connecting the other end of the modified cable to the M5 device, add it to Home Assistant. I’ve used the snippet from devices.esphome.io, but with some modifications. The pinout of the connector is as written on the board - do not cross RX and TX lines. The M5NanoC6 has GPIO 1 and 2 on the connector, therefore:
uart:
tx_pin: GPIO2
rx_pin: GPIO1
baud_rate: 9600
Also, the M5NanoC6 needs a little bit of configuration, because it is a new device:
esp32:
board: esp32-c6-devkitc-1
variant: esp32c6
flash_size: 4MB
framework:
type: esp-idf
version: latest
platform_version: 6.5.0 # Need at least 6.4 for ESP32-C6
sdkconfig_options:
CONFIG_ESPTOOLPY_FLASHSIZE_4MB: y
After this, the fan just works with ESPHome. No soldering required. The fan is super easy to take apart and really wel built and marked.
The last step is to place the M5NanoC6 somewhere safe. I’ve put the original cable under the original board and used the bend to secure the M5NanoC6. There is plenty of space. Just keep it a little bit away from other boards and metal parts for better signal.
The best part is, that this is fully reversible with no damage to the fan. The original ESP32 board stays disconnected in the fan, so to undo the changes, simply disconnect the M5Nano and connect the original board back.
In the following photo, you can see the blue M5NanoC6, hanging on the modified cable. The original ESP32 board is on the right with the original cable suffed under the board.
Also, the M5NanoC6 has Bluetooth, Zigbee, and Matter over Thread support, so feel free to make it even more awesome.
Thank you so much, sharing this saved me a lot of time!
This may be a really stupid question (and I really apologies it’s not quite in line with the purpose of this thread) but how did you get the M5NanoC6 installed with ESPHome? When I go to prepare for first use I get:
Error: Unsupported platform ESP32C6. Only ESP8266, ESP32, ESP32S2, ESP32S3, ESP32C3 are supported.
I’m planning to adapt the esphome configuration for the threesixty 2.
@jkufner , how did you get the correct tuya datapoint for each features ? Is there some documentation somewhere?
Thanks