I recently had a Midea Xtreme smart aircon installed, I went with that brand / model because it looked as though an integration had been built for Home Assistant so I thought it would be pretty easy to get it linked up with Home Assistant using the HACS integration I found, well I was wrong I struggled for quite a while and couldn’t get it to work, I wasn’t too keen to go this route as it still relied on the cloud server which was sometimes quite slow and really prefer to control all of my devices via the LAN.
I stumbled across a post on the HA forum where guys had built ESPHome integrations and I sort of wasn’t keen because I thought it would be a hack and wouldn’t work as well as the wifi dongle but it turns out it was incredibly easy and took me probably 10 minutes to get it working, I later added a CT clamp so that I could also monitor the power usage on the aircon.
I saw a post on here with someone who had installed a Midea and also noted that the ESPHome integration supports quite a few vendors so thought I’d pop this up here in the hope that someone else finds it useful.
The guys on our DIY WhatsApp group spoke about this ESP setup for the Midea unit. I’m running a new unit with the usb dongle and so far it works super smooth.
Mine also has the USB dongle and was working fine just sometimes it would take a while for the cloud app to pickup the aircon, not long 20s or so but enough to irritate me. My main objection was to get the aircon into HA so that I can then use it for heat based automations when my batteries are fully charged etc…
Either way is fine I guess but like I said I prefer having direct WLAN access, don’t like the idea of half my homes smart devices sitting in a cloud with passwords etc…
Thank you so much for posting! This has been the one thing I’ve been struggling with and wanting to do. I also read the posts, but it looked like a hack for me too. I’m so glad you posted this. Would you mind sharing pictures of how you connected everything to the mainboard inside the white box?(where the CT is connected to) Also, did you use an ESP32 board?
I’m only asking, because there are a lot of different solutions on the same thread. I just want to know which mainboard you used and how the connections were done please.
I’m using ESPHome with an ESP8266 but ESP32 board will work, I actually think the one I built for my lounge was an ESP32, I can take a photo a bit later and post but its basically VIN / GND and then the corresponding GPIO pin, you need to wire in a resistor if I recall but its all on the ESPHome website, I’ve linked to it in my config which is posted below.
name: main-bedroom-ac-v2
platform: ESP8266
board: nodemcuv2
# Enable Home Assistant API
api:
ota:
platform: esphome
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Main-Bedroom-Ac Fallback Hotspot"
password: "1qaz2wsx"
captive_portal:
web_server:
port: 80
auth:
username: admin
password: XXXXXXXX
sensor:
## Get input voltage
- platform: adc
pin: VCC
name: "Main Bedroom AC VCC Voltage"
# Wireless Signal and uptime
- platform: wifi_signal
name: "Main Bedroom AC Wifi Signal"
update_interval: 60s
- platform: uptime
name: "Main Bedroom AC Uptime"
filters:
- lambda: return x / 3600;
unit_of_measurement: "hours"
accuracy_decimals: 2
################################################################################
# Add power consumption
#https://esphome.io/components/sensor/ct_clamp.html
################################################################################
- platform: ct_clamp
sensor: adc_sensor
name: "Main Bedroom AC V2 Power Consumption"
update_interval: 30s
filters:
- calibrate_linear:
# Measured value of 0 maps to 0A
- 0 -> 0
# Known load: 4.85A
# Value shown in logs: 0.1333A
- 0.12 -> 4.95
- lambda: return x * 230.0 ;
unit_of_measurement: "W"
##
## Created below sensor so I can track power usage with the energy card
##
- platform: ct_clamp
sensor: adc_sensor
name: "Main Bedroom ENERGY AC V2 Power"
update_interval: 30s
filters:
- calibrate_linear:
# Measured value of 0 maps to 0A
- 0 -> 0
# Known load: 4.85A
# Value shown in logs: 0.1333A
- 0.12 -> 4.95
- lambda: return x * 230.0 ;
unit_of_measurement: "W"
- platform: adc
pin: A0
id: adc_sensor
##############################################################################
## Aircon integration
## Project Source: https://community.home-assistant.io/t/support-for-midea-a-c
## https://esphome.io/components/climate/midea.html
##############################################################################
# Disable logging over UART (required)
logger:
baud_rate: 0
# UART settings for Midea dongle (required)
uart:
tx_pin: 1 # hardware dependant
rx_pin: 3 # hardware dependant
baud_rate: 9600
# Optional (if you want modify settings)
#midea_dongle:
# period: 1s
# timeout: 2s
# num_attempts: 3
# Main settings
climate:
- platform: midea
name: "Midea AC V2" # Use a unique name.
autoconf: true
beeper: true # Beep on commands.
visual: # Optional. Example of visual settings override.
min_temperature: 16 °C # min: 16
max_temperature: 30 °C # max: 30
temperature_step: 1 °C # min: 0.5
supported_modes: # All capabilities in this section detected by autoconf.
- FAN_ONLY
- HEAT_COOL
- COOL
- HEAT
- DRY
custom_fan_modes:
- SILENT
- TURBO
supported_presets: # All capabilities in this section detected by autoconf.
- ECO
- BOOST
- SLEEP
custom_presets: # All capabilities in this section detected by autoconf.
- FREEZE_PROTECTION
supported_swing_modes:
- VERTICAL
- HORIZONTAL
- BOTH
# outdoor_temperature: # Optional. Create outdoor unit temperature sensor (may display incorrect values after long inactivity).
# name: "Temp"
# power_usage: # Optional. Create power usage sensor (only for devices that support this feature).
# name: "Power"
# humidity_setpoint: # Optional. Create indoor humidity sensor.
# name: "Humidity"
Thank you so much for sharing the code! I’d appreciate the pictures a lot since I only recently started with this stuff. Can you please share your exact AC model? I see “Wi-Fi Enabled” and “WiFi Compatible” ranges on AC Direct. I’m worried that the “Wi-Fi Enabled” won’t work since I suspect it could possibly not have a USB input.
I think wifi enabled and wifi compatible are the same, one thing I noticed though was that with the 12000BTU the dongle was not included in the price, I bought it at additional cost as this was before I used ESPHome, when I ordered the 24000BTU it was included in the price and I couldn’t get it taken out of the price, so I now have 2 of these sitting in the cupboard
Thanks a lot! I think I’ll be replacing my AC before the end of this year. I’ll be buying the parts in the meantime. Would you mind sharing the links / store where you bought the parts?