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 2000W? 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
A big thank you to you, @jkufner!
Last week I flashed my M5NanoC6 with ESPHome and plugged it into my DUUX Whisper Flex Smart DXCF11, which I bought last summer.
This is the perfect permanent solution and even the possibility to revert back to the original board.
Just after I bought the DXCF11, I contacted DUUX support to ask if local support is on the roadmap. Unfortunately, they don’t. It’s a shame because they have some great products.
Homey does have integration. Even if it is cloud based… why can we not create this for HA?
I’m not entirely sure what you’re asking, but the goal here was to gain local control without the cloud stuff.
If you want cloud based integration of the DuuX stuff with home assistant, it’s probably already possible with existing integrations.
Info prefer local integration but any integration would be great. Currently looking for a Dehumidifier that can be connected to home assistant. Duux Bora smart looks great as product but I prefer integration. That is why I am checking local (preferable) or cloud integration.
I can only find local tuya or tuya connections for devices based on the old app. New devices do not seem to connect with tuya.
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?
I have HTTPS configured on my Home Assistant, so I can flash directly from my own instance with the correct configuration, rather than using the online tool.
How did you get the correct tuya datapoint for each features ? Is there some documentation somewhere?
See the yaml in the linked comment. I have not used anything else. The only bug I found is that the speed steps are off by one (which was an easy fix). Otherwise it is working just like the included remote or the original app.
Hi, did you make any progress in the meantime? I have a Threesixty 2 myself, and would love to manage it local with esphome.
I am using your template and am experiencing a strange issue.
Since the temp sensor in the Duux is worthless, I changed the current_temperature_topic to a mqtt sensor which has an accurate temp.
This is being displayed perfectly, but the thermostat is not acting when the set point is being reached. Any toughts or suggestions why this is not working as expected?
you should set a thermostat on HASS side instead, would be more efficient.
Can you elaborate a bit more on your suggestion? With the MQTT config a climate entity is created, when working properly that’s a perfect solution for me.
It’s nearly winter again and I’d like to find the easiest way to a software hack for the Duux Threesixty 2. It would be great if we can reproduce the redirection using the reasonably popular pi-hole alone, using the Local DNS feature.
Using the query log I see my Threesixty connects to both collector.cloudgarden.nl
and collector3.cloudgarden.nl
. I can’t just redirect them to my local mqtt server, because it is password protected.
I have spend the evening trying to write a python listener proxy in an Alpine container on Proxmox using the good old socket
:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.bind((host, port))
sock.listen(5)
while True:
client_socket, client_address = sock.accept()
client_thread = threading.Thread(target=handle_client, args=(client_socket, client_address))
client_thread.daemon = True
client_thread.start()
Not much luck. I’m not receiving any raw messages on my socket. @runnane @anoppe @KipK @chises @hamido are you all using passwordless mosquitto, or is there a simple proxy I need to know about?