Midea branded AC’s with ESPhome (no cloud)

sorry for late reply… RS485 doesnt have exactly tx, rx there are 2 connectors on the control unit of my heatpump marked as H1 and H2 not sure for your AC after you’ve connected everything you can access different registers and then you have to figure out which value relates to what. also since there is no software available and basicly no documentation of a modbus mapping table this is kinda time consuming. I was successful for our heatpump, still have a lot of work to do but once it’s done i promise i’ll upload it to github here are some images what i extract and can do with it :stuck_out_tongue:


and pure extracted data

Also just FYI if anybody tries to connect to modbus don’t bother doing it through XYE connection as it’s not standard modbus i wasted few days trying to but realised i got corrupt data as start bit had shorter duration and because of that RS-485->RS-323->USB device was useless… would have to write a custom software serial for arduino… anyway there is a rotary switch inside main indoor unit that sets modbus adress of device and you can connect to it using H1 and H2 terminals on the control unit (display where you set everything) they are covered with an antistatic foil but clearly visible when removed image
this is the control unit i’m talking about

3 Likes

I need more information of that.
my A/C has XYE connection , can you help me with that?

check if you can find if it supports modbus and where to connect RS485 to… if it does not you cant connect to it using modbus will have to find another way… check this thread there is an usb device for A/C s

Hello.
This is my first post so please bear with us.
I have a question for StarKiller99 if you connect the pump with esphome modbus controller please help. I have installed the Midea heat pump and cannot connect. My esphome configuration and manufacturer modbus table.
Wires connected to the heat pump under H1 and H2, the indoor unit address is set to 0.
What am I doing wrong.

esphome:
  name: pompa-modbus

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:
  level: VERY_VERBOSE
#  baud_rate: 9600

# Enable Home Assistant API
api:

ota:
  password: !secret WI_FI_password

wifi:
  ssid: !secret WI_FI_ssid
  password: !secret WI_FI_password

# Optional manual IP
  manual_ip:
    static_ip: 192.168.100.170
    gateway: 192.168.100.1
    subnet: 255.255.255.0

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: !secret WI_FI_AP_ssid
    password: !secret WI_FI_password

captive_portal:
    
uart:
  id: mod_bus
  tx_pin: 16
  rx_pin: 17
  baud_rate: 9600
  stop_bits: 1

modbus:
#  flow_control_pin: 5
  send_wait_time: 500ms
  id: pompa_modbus

modbus_controller:
  - id: modbus_1
    ## the Modbus device addr
    address: 0x00
    modbus_id: pompa_modbus
#    command_throttle: 100ms
    setup_priority: -10
    update_interval: 10s

text_sensor:

  - platform: wifi_info
    ip_address:
      name: IP Address

  # Send Uptime in raw seconds
  - platform: template
    name: Uptime
    id: uptime_human
    icon: mdi:clock-start


sensor:  
  - platform: wifi_signal
    name: WiFi sygnał
    update_interval: 60s

  - platform: uptime
    name: Czas pracy
    id: uptime_sensor
    update_interval: 60s
    on_raw_value:
      then:
        - text_sensor.template.publish:
            id: uptime_human
            # Custom C++ code to generate the result
            state: !lambda |-
              int seconds = round(id(uptime_sensor).raw_state);
              int days = seconds / (24 * 3600);
              seconds = seconds % (24 * 3600);
              int hours = seconds / 3600;
              seconds = seconds % 3600;
              int minutes = seconds /  60;
              seconds = seconds % 60;
              return (
                (days ? to_string(days) + "d " : "") +
                (hours ? to_string(hours) + "h " : "") +
                (minutes ? to_string(minutes) + "m " : "") +
                (to_string(seconds) + "s")
              ).c_str();

  - platform: modbus_controller
    id: modbus_T5
    name: "Temperatura ciepła woda"
    state_class: measurement
    register_type: holding
    address: 0x115
    unit_of_measurement: "°C"
    value_type: S_WORD
    accuracy_decimals: 1
#    skip_updates: 10
#    filters:
#      - multiply: 0.1
web_server:
  port: 80

hi i dont know tbh because i never used esphome for it, wrote my own software but is not finnsihed and cant share it yet. can you tell me which model is your heatpump. i am also using 115 adress for reciving DHW temp but i believe you wrote it down incorrectly as 115 is in decimal you need to use hexadecimal value which in this case would be 0x73 (just write 115 to hex in google) so max adress is 255(0xff) you went over that as adress 0x115 coresponds to 341

i just updated my comment. basicly try to use 0x73 adress because you have to use it in hexadecimal form 0x indicates hexadecimal and 0x73 = 115 in decimal

I installed a midea M-Thermal-8B1HB heat pump.
I tried to set the address to 0x73 but it still doesn’t work. What else can I change. Any ideas.

tried swaping the terminals? do you have GND connected? in screenshot you provided it says it did not recieve response…

I have updated and streamlined the example YAML a bit in the first post, hoping to make it more universal/user friendly.
I also added the fan setting to the web interface.

Hi,
I’ve got a problem: one of my AC unit is working with an esp01 board. I ordered an esp01s board and installed the esphome firmware with the same yaml as the original. If I power up the esp01s unit with a ch340g programmer it seems ok: I can open the page of the unit, and I can check the log.
If I change the working esp01 and esp01s boards on the AC unit, all goes wrong: nothing happens, only one short blue blink from the board, but thats all. No log, the device seems offline in esphome.
I created an other device, but the same result.

esphome:
  name: climate-upstairs
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  ap:
    ssid: "UpstairsAC"
    password: !secret wifi_password

captive_portal:

logger:
  baud_rate: 0

api:

ota:

web_server:
  port: 80

uart:
  tx_pin: 1
  rx_pin: 3
  baud_rate: 9600

text_sensor:
  - platform: version
    name: Emeleti klíma ESPHome verzió
    
  - platform: wifi_info
    ip_address:
      name: Emeleti klíma IP
    ssid:
      name: Emeleti klíma SSID
    bssid:
      name: Emeleti klíma MAC

sensor:
  - platform: uptime
    name: Emeleti klíma uptime

  # WiFi Signal sensor.
  - platform: wifi_signal
    name: Emeleti klíma WiFi signal
    update_interval: 60s

# Main settings
climate:
  - platform: midea
    name: "Emeleti klíma"
    autoconf: true
    visual:
      min_temperature: 17 °C
      max_temperature: 30 °C
      temperature_step: 1 °C
    beeper: true
    outdoor_temperature:
      name: "Emeleti klíma kültéri egység hőmérséklet"

Any advice?
Thx:
P!

Can you try to measure the voltage?
I suspect the esp01s draws more current, and the powersupply doesn’t support it….

Ok, I will try, it takes a bit…
Let’s assume this is the cause of the error. What can be done?
(U will be right. I found a webpage, which says the esp01s needs 250mA, the esp01 needs 150mA.
FCK)

@petikeje You could use an external power supply (f.e.for an USB charger)
Don’t forget to use a common ground :wink:

Hey Jay, did you solved the problem, I’m having the same issue and the same units



How can I manage this model by esphome? someone??
thanks!

If i am not mistaken this unit supports ModBus
Not a part of this topic (only for wifi)
but there are some people working on it

1 Like

it does i made a custom board… please read whole post… i have a working version of custom software and custom firmware

and also this kinda still belongs here even though its modbus… you can still use it with esphome …

That i knew, I just wasn’t sure id @arizagol ’s unit is the same what you use…i’m not even sure if it actually is Modbus :thinking:
And yeah, exactly…it kindah belongs here, but info in this topic it mainly deals with Midea wifi protocol.
I guess when the time is right, you will create a new topic for Midea Modbus protocol ?(but if you want you can stick it in here too)

But great job btw :+1:t4:

1 Like