从云端解放小米加湿器
Freeing a Xiaomi humidifier from the cloud

原始链接: https://0l.de/blog/2025/11/xiaomi-humidifier/

## 带有Home Assistant的智能加湿器:DIY方法 出于对注重隐私、面向未来的基于Home Assistant的智能家居的渴望,作者着手解决寻找兼容加湿器的问题。对容易过时且依赖云服务的选项不满意,他们选择更换现有智能加湿器的固件。 小米智能抗菌加湿器(型号ZNJSQ01DEM,内部ID deerma.humidifier.jsq)因其ESP8266微控制器而被选中,该控制器可以使用ESPHome轻松编程。现有的固件已过时,促使作者将其重新实现为ESPHome“外部组件”(可在[这里](https://github.com/stv0g/esphome-config/components/xiaomi_deerma_humidifier)找到)。 该过程包括拆卸加湿器、拆焊原始WiFi模块以及焊接电源(3.3V)、地线、RX和TX的连接。刷新新的ESPHome固件需要临时接地GPIO0并使用串行适配器。**至关重要的是,在刷新之前建议备份原始固件。** 这允许在Home Assistant中直接控制加湿器,避免依赖专有应用程序和云服务。

一个黑客新闻的讨论集中在将小米加湿器从云端依赖中解放出来,并由此引发了关于加湿器类型的对话。一位评论员警告说,除非使用蒸馏水,否则超声波加湿器会释放PM2.5颗粒,建议使用蒸发式加湿器,并特别提到了 Smartmi 蒸发式加湿器。 然而,另一位用户指出 Smartmi 型号仍然包含“有毒物联网”功能。他们建议 Vornado EV100 蒸发式加湿器作为一种非物联网替代方案,并指出一些小缺点,如滤芯更换、风扇噪音和明亮的 LED 灯。最后,第三位评论员分享了一个 Technology Connections 视频链接,提供了详细的加湿器比较。这场讨论强调了便利性/功能与避免连接设备及潜在健康问题之间的权衡。
相关文章

原文

I recently moved into a new apartment which I used as an opportunity to make our home a little smarter. As a big open source supporter I built my smart home platform with Home Assistant of course.

Unfortunately, there are still far too few products that are directly compatible with Home Assistant. Especially in the area of humidifiers where I only found products that rely on a proprietary app or cloud from the manufacturer. Something that I would like to avoid at all costs. For one thing, such dependence is a certain form of planned obsolescence, as the product becomes useless as soon as the app loses its compatibility with new smartphone operating system versions or the manufacturer’s cloud is no longer operated.

Therefore, it was important for me to find a smart humidifier that integrates directly with my Home Assistant setup. To achieve this goal, I identified two options:

  1. Add sensors / actuators to a classic humidifier to make it smart.
  2. Replace the firmware of a smart humidifier with my own source code.

I decided to use the second approach, because it required less effort, since I would have had to implement my own firmware anyway.

Next, I was faced with the task of finding a suitable humidifier whose firmware I could easily replace. I specifically looked for devices that contained an ESP8266 or ESP32 microcontroller from Espressif, because for these I could easily create a new firmware with ESPHome.

ESPHome is a system that allows you to control your ESP8266/ESP32 through simple but powerful configuration files and remotely control it through home automation systems.

Xiaomi Mi Smart Antibacterial Humidifier.

Thanks to Sören Beye /Hypfer , I quickly became aware of the Xiaomi Mi Smart Antibacterial Humidifier, as Sören himself wrote his own firmware for this humidifier.

Unfortunately, his original version of the customized firmware ( /Hypfer/esp8266-deerma-humidifier ) is no longer compatible with the current version of the producr, as Xiaomi has modified the internal communication protocol.

Therefore, I decided to re-implement the firmware based on ESPHome as an “external component”.

You can find the code for this component here: /stv0g/esphome-config/components/xiaomi_deerma_humidifier

This section is going to walk you through the process of modifying your own Xiaomi Humidifier.

  1. Find the correct model

    The internal Mi Model ID of the supported device is deerma.humidifier.jsq. The Model on the packaging being ZNJSQ01DEM.

  2. Disassembly

    There are 4 Philips-head screws hidden under the rubber foot ring which can be easily pealed of. Its usually find to remove the rubber only in areas where the screws are located. That way you can easily reattach it later.

    Internals of the Humidifier.
    Bottom view of Humidifier. Screws are behind rubber foot ring.

    In the inside, you will find a small Wifi module attached to the back of the housing. Remove the module and solder on the wires as shown in the picture below.

  3. Wire UART

    Wifi board featuring an ESP-WROOM-02 module.

    In the last picture, the colors of the wires correspond to the following:

    • Orange: GND
    • Grey: VCC (3.3 Volt!)
    • Yellow: GPIO0
    • Brown: RX
    • Red: TX

    In order to flash the module, you will need to tie GPIO0 to GND and attach a 3.3V serial adapter to the RX, TX pins. I recommend to also to disconnect the module from the humidifier and power it via your Serial to USB adapter via the VCC pin.

    To flash the ESP8266 chip you can either use ESPHome’s build-in web flasher or esptool.py.

  4. Create backup of original firmware

    But before we flash the new firmware, I recommend to first make a backup of the original Xiaomi firmware by running:

    --port /dev/tty.usbserial-31310 \

    read_flash 0x0 0x200000 xiaomi-deerma-humidfier-original-2mb.bin

  5. Flash new firmware

    Afterwards, we can flash the new firmware:

    --port /dev/tty.usbserial-31310 \

    write_flash 0x0 deerma.bin

联系我们 contact @ memedata.com