esp8266-midea-dehumidifier
esp8266-midea-dehumidifier copied to clipboard
Tank full alert
There doesn't seem to be a tank full alert in the firmware. Is it possible to add? Will be quite useful
Thanks
I would like to second this. This is really the issue preventing me from using this approach. Midea cloud does support tank full indication so this should be part of the serial protocol.
The issue here is that the "Tank Full" Error is the same as "No Tank at all". At least as far as my testing goes.
The error code already visible in the JSON published to the MQTT state topic so you can also take a look at that and observe it changing.
I agree that there should be some kind of autoconfigured HA sensor reporting the error state, however personally I'd want it to be reliable.
can you point me to where this is in the JSON, please? I'm going to access the raw MQTT topic here in order to include this into openHAB. Many thanks!
I did a search for both "tank" and "full" strings in the ino files and it doesn't seem to be anything related to this. Also can't seem to find anything in the MQTT topics. Am I doing something wrong?
OK, it seems to be in the error code reported in the JSON. But, what is the error code for tank full / tank missing? For the dehumidifier device it is the same issue, both shows "P2" on the display. Is there a list of know error codes available? Besides this, great job done here!
@elvenpath
The error code is read from the state response here: https://github.com/Hypfer/esp8266-midea-dehumidifier/blob/51d6799d6a0166339e04c2e4e52cbb83cb9e4792/src/esp8266-midea-dehumidifier/serialCommunication.ino#L18
and set to the published mqtt json here: https://github.com/Hypfer/esp8266-midea-dehumidifier/blob/51d6799d6a0166339e04c2e4e52cbb83cb9e4792/src/esp8266-midea-dehumidifier/esp8266-midea-dehumidifier.ino#L217
with the state topic being declared here:
https://github.com/Hypfer/esp8266-midea-dehumidifier/blob/51d6799d6a0166339e04c2e4e52cbb83cb9e4792/src/esp8266-midea-dehumidifier/esp8266-midea-dehumidifier.ino#L78
@clh27
Is there a list of know error codes available?
Unfortunately no. You'd have to figure those out by yourself by testing. Just cause an error state and then look at the mqtt payload.
I guess it would be possible to introduce something like a errorDescription property for the known values
0 => "no error" etc.
and then just have a HA sensor which shows that text.
At least that's what Valetudo is doing:

I just finished my OpenHAB configuration and tested the consequences of removing the water tray while the machine is running. The error code did not change. Everything else works like a charm.

New insight: Errorcode for filled tank is 38.
So I made an mqtt binary_sensor for home assistant to check for full tank. Unfortunately couldn't parse the json to use {{ value_json }} and therefore I parsed everything as attribute an then checked for errorCode:
- platform: mqtt
state_topic: 'esp8266-midea-dehumidifier/YOURDEHUMIDIFIER/state'
json_attributes_topic: 'esp8266-midea-dehumidifier/YOURDEHUMIDIFIER/state'
payload_on: "38"
payload_off: "0"
name: YOURNAME
value_template: >
{{ state_attr("binary_sensor.YOURNAME","errorCode") | default(0,true) | string }}
change YOURDEHUMIDIFIER with your dehumidifier name from mqtt topic and YOURNAME for the name from your sensor to also match the binary_sensor in value_template