+
Skip to content

Notes on Smartmi Evaporative Humidifier 2 (zhimi.humidifier.ca4) #26

@szymucha94

Description

@szymucha94

Pins:
xeh2_pins

Commands used to backup stock firmware:
python esptool.py -p /dev/ttyUSB0 read_flash 0x0 0x400000 original-firmware.bin
(windows version, only one that worked)
esptool.exe -p COM9 read_flash 0x0 0x400000 original-firmware.bin

Do not power up the board via serial adapter. Use standard power brick provided with humidifier.
Bridge gpio0 and gpio2, then connect gpio2 to ground (for example gnd for STM serial)
Mobo is sealed with some slimy substance to prevent corrosion due to the vapor, hence little bit more heat for soldering is useful. I didn't find any test point that is connected gpio2. There is tiny gpio0 TP on the other side of mobo but it's not a hole and it's pretty far from gnd, so it's easier to solder all at the same side of board.
Working (for me) esp config. Replace "xxx" with your keys or just use the variable from secret.yaml.
Water level readings are broken for me, but this is due to long dead (probably shorted) sensor above the power port. Typical failure of this model. Speaking from experience if you get values above 100% (or "unknown" state in HA) that either means your sensor is dead or it's gonna die soon.
Source is temporary because repo's version doesn't compile. It's taken from one of the comments.

# https://home.miot-spec.com/spec/zhimi.humidifier.ca4

external_components:
  source: github://pchmura4/esphome-miot@main

esphome:
  name: living_room_air_humidifier
  friendly_name: Living Room Air Humidifier
  comment: Smartmi Evaporative Humidifier 2 (zhimi.humidifier.ca4)
  project:
    name: "dhewg.esphome-miot"
    version: "zhimi.humidifier.ca4"

esp32:
  board: esp32doit-devkit-v1
  framework:
    type: esp-idf
    sdkconfig_options:
      CONFIG_FREERTOS_UNICORE: y
    advanced:
      ignore_efuse_mac_crc: true

logger:
  level: INFO

api:
  encryption:
    key: "xxx"
  reboot_timeout: 0s
  services:
    - service: mcu_command
      variables:
        command: string
      then:
        - lambda: 'id(miot_main).queue_command(command);'

ota:
 - platform: esphome
   password: "xxx"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  ap:
    ssid: "Mihumidifier Fallback"
    password: "xxx"

uart:
  tx_pin: GPIO17
  rx_pin: GPIO16
  baud_rate: 115200

miot:
  id: miot_main

switch:
  - platform: "miot"
    miot_siid: 2
    miot_piid: 1
    name: "Power"
    icon: mdi:power
  - platform: "miot"
    miot_siid: 2
    miot_piid: 8
    name: "Dry"
    icon: mdi:water-minus
  - platform: "miot"
    miot_siid: 4
    miot_piid: 1
    name: "Notification Sounds"
    icon: mdi:volume-high
    entity_category: config
  - platform: "miot"
    miot_siid: 6
    miot_piid: 1
    name: "Child Lock"
    icon: mdi:lock
    entity_category: config
  - platform: "miot"
    miot_siid: 7
    miot_piid: 5
    name: "Clean Mode"
    icon: mdi:water-minus
    entity_category: config

select:
  - platform: "miot"
    miot_siid: 2
    miot_piid: 5
    name: "Fan level"
    icon: mdi:fan
    options:
      0: "Auto"
      1: "Low"
      2: "Medium"
      3: "High"
  - platform: "miot"
    miot_siid: 5
    miot_piid: 2
    name: "Display brightness"
    icon: mdi:brightness-6
    entity_category: config
    options:
      0: "Dark"
      1: "Glimmer"
      2: "Brightest"

sensor:
  - platform: "miot"
    miot_siid: 2
    miot_piid: 2
    name: "Device Fault Code"
    icon: mdi:fan-alert
    entity_category: diagnostic
  - platform: "miot"
    miot_siid: 3
    miot_piid: 7
    name: "Temperature"
    unit_of_measurement: "°C"
    device_class: temperature
    state_class: "measurement"
    icon: mdi:thermometer
  - platform: "miot"
    miot_siid: 3
    miot_piid: 9
    name: "Relative Humidity"
    unit_of_measurement: "%"
    device_class: humidity
    state_class: "measurement"
    icon: mdi:water-percent
  - platform: "miot"
    miot_siid: 2
    miot_piid: 7
    name: "Water Level"
    unit_of_measurement: "%"
    state_class: "measurement"
    icon: mdi:water-percent
    filters:
      - clamp:
          min_value: 0
          max_value: 100
          ignore_out_of_range: true
  - platform: "miot"
    miot_siid: 2
    miot_piid: 11
    name: "Motor Speed"
    unit_of_measurement: "rpm"
    icon: mdi:fan
  - platform: "miot"
    miot_siid: 7
    miot_piid: 1
    name: "Actual Speed"
    unit_of_measurement: "rpm"
    icon: mdi:fan
  - platform: internal_temperature
    name: "MCU Temperature"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载