Midea branded AC’s with ESPhome (no cloud)

That would be a question for ESPHome then. First you have to get the dongle running, or better ESPHome must be able to communicate with it under MacOS. I’m sorry, but I can’t help here, I’m a total noob regarding MacOS and Macs in general.

Maybe ask in the ESPHome section here in this forum, or even better, ask the seller to help you out there! :slight_smile: I’m using a “self-made” ESP dongle running on an ESP-01, so I unfortunately have no idea how that dongle is working.

After you got it running on MacOS, and you can reach it via ESPHome-AddOn (the one in the sidebar of HA), report back here and we can help to get the correct firmware running.

On a second thought, where did you get that log from above? That looks like you already have it running?

Anyway, you need to get the dongle running with your ESPHome-AddOn, otherwise we can’t work on the configuration. As I said, ask the seller. If someone is making money out of this, that should be the least, to support the first install. :slight_smile:

Yeh the dongle came pre-flashed and creates its own browser. I can connect to this and make it connect to my Wi-Fi. I also have the ability to flash OTA, but I don’t know how to build a new firmware or put back to factory.
The company I bought from are from Ukraine so emails are a little busy for them

Maybe try https://web.esphome.io/
It claims to compile and install all from the web…haven’t tried it myself though

oh, hold on, i remember one user also had issues with the usb connector having bad connection.
Can you re-insert it, or maybe wiggle it a bit?
I myself threw away the usb2header cable, and used dupont connection cables instead (as i also use esp01, which does not have usb)

@metaljay
I’m not up to my game today, sorry. :slight_smile: What I totally oversaw was, where did you install ESPHome? On your Home Assistant server I guess, right?

So you have the following setup (please fill in):

  • You have a _______ to run Home Assistant (a RaspberryPi, a XY)
  • You run Home Assistant OS on that computer? _____ (yes/no)
  • Here you installed ESPHome as an AddOn? _____ (yes/no)

What does the web server show, is it possible to get some more info here? Maybe you could make some screenshots of the page(s). I’m quite sure, the web server should be able to offer some possibilities to upload a new firmware. If so, we can built a “new” firmware in ESPHome (in your AddOn) and flash it over the now used firmware via the webserver.

Anyway, I think, we don’t need the Mac here, just to get to a web page, but nothing more. :slight_smile:

I guess the issue is that he doesn’t have an entry for his dongle in esphome, so he doesn’t have a yaml config either…


and since the design is unknown, it would be guessing for gpio pin layout, board type as well as platform…
But it looks like esp-12e

and i guess gpio 1 + 3.
(as gpio 4 + 5 are for auxiliary sensors)

Ofc another thing worth trying is to swap orange and brown wires… ut it wouldn’t surprise me either if it is just a bad connection :wink:

Not yet. :wink: :smiley:

If the web server is running on the dongle, we should be able to get the data we need from it. And this data we use to setup the dongle as a new device in ESPHome. Could work, I guess… :rofl:

@paddy0174 His screenshot on Telegram doesn’t show much data…

That’s really not much to go on… :frowning:

So, it will be a guessing game! :rorl: :rofl: What else could we do on such a nice Friday evening? :wink:

I managed to speak to the seller and they gave me the config.yaml

substitutions:
  node_name: midea-ac
  node_id: midea_ac
  friendly_node_name: "Midea AC"

esphome:
  name: ${node_name}
  comment: ${friendly_node_name}
  platform: ESP8266
  board: esp12e
  name_add_mac_suffix: true
  project:
    name: "lizardsystems.midea_mini_dongle"
    version: "1.4.0"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  ap:
    ssid: "AC-wifi"
    password: "slwf01pro"

captive_portal:

dashboard_import:
  package_import_url: github://lizardsystems/midea-mini-dongle/edit/main/midea_ac.yaml

logger:
  baud_rate: 0
#  level: ERROR
  esp8266_store_log_strings_in_flash: false

ota:

web_server:
  port: 80
  css_url: ""
  js_url: "www.js"
  local: true
  version: 2
  

api:

uart:
  tx_pin: 1
  rx_pin: 3
  baud_rate: 9600
  
climate:
  - platform: midea
    name: ${friendly_node_name} Climate         # Use a unique name.
    id: ${node_id}_climate
    period: 1s                  # Optional
    timeout: 2s                 # Optional
    num_attempts: 3             # Optional
    autoconf: true              # Autoconfigure most options.
    beeper: true                # Beep on commands.
    visual:                     # Optional. Example of visual settings override.
      min_temperature: 17 ∞C    # min: 17
      max_temperature: 30 ∞C    # max: 30
      temperature_step: 0.5 ∞C  # min: 0.5
    supported_modes:            # All capabilities in this section detected by autoconf.
      - FAN_ONLY                # This capability is always used.
      - HEAT_COOL
      - COOL
      - HEAT
      - DRY
    custom_fan_modes:
      - SILENT
      - TURBO
    supported_presets:          # All capabilities in this section detected by autoconf.
      - ECO
      - BOOST
      - SLEEP                   # This capability is always used.
    custom_presets:             # All capabilities in this section detected by autoconf.
      - FREEZE_PROTECTION
    supported_swing_modes:
      - VERTICAL                # This capability is always used.
      - HORIZONTAL
      - BOTH
    power_usage:                # Optional. Outdoor temperature sensor (may display incorrect values after long inactivity).
      name: "${friendly_node_name} Power Usage" 
      id: ${node_id}_power_usage
    outdoor_temperature:        # Optional. Power usage sensor (only for devices that support this feature).
      name: "${friendly_node_name} Outdoor Temperature"
      id: ${node_id}_outdoor_temperature
    humidity_setpoint:          # Optional. Indoor humidity sensor (only for devices that support this feature).
      name: "${friendly_node_name} Humidity"
  
switch:
  - platform: template
    name: ${friendly_node_name} Beeper
    icon: mdi:volume-source
    restore_state: true
    optimistic: true
    turn_on_action:
      midea_ac.beeper_on:
    turn_off_action:
      midea_ac.beeper_off:
      
binary_sensor:
  - platform: status
    name: ${friendly_node_name} Connection Status
    id: ${node_id}_connection_status

text_sensor:
  - platform: template
    name: Uptime Human Readable
    id: uptime_human
    icon: mdi:clock-start

  - platform: version
    name: ${friendly_node_name} ESPHome Version
    id: ${node_id}_esphome_version    

  - platform: wifi_info
    ip_address:
      name: ${friendly_node_name} IP Address
      id: ${node_id}_ip_address
      icon: mdi:ip-network

sensor:
  - platform: uptime
    name: Uptime Sensor
    id: uptime_sensor
    update_interval: 60s
    on_raw_value:
      then:
        - text_sensor.template.publish:
            id: uptime_human
            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: wifi_signal
    name: ${friendly_node_name} WiFi Signal
    id: ${node_id}_wifi_signal
    update_interval: 60s

button:
  - platform: restart
    name: ${friendly_node_name} Restart
    id: ${node_id}_restart
    icon: "mdi:restart"
  - platform: shutdown
    name: ${friendly_node_name} Shutdown
    id: ${node_id}_shutdown
  - platform: safe_mode
    name: ${friendly_node_name} Restart (Safe Mode)"
    id: ${node_id}_safe_mode

Im guessing I need to switch 1 and 3 around at UART and then try flash it?

So I made the changes to

uart:
  tx_pin: 1
  rx_pin: 3

downloaded the firmware, flashed it OTA and now can see way more data in the web viewer. ESPhome for some reason cannot adopt the dongle though

What does tx/rx say in log?

as long as either tx or rx is missing, it won’t work

im getting this now:

14:05:31	[D]	[ApplianceBase:139]	
Response timeout...
14:05:31	[D]	[ApplianceBase:154]	
Destroying the request...
14:05:31	[D]	[AirConditioner:178]	
Enqueuing a GET_STATUS(0x41) request...
14:05:31	[D]	[ApplianceBase:173]	
Enqueuing the request...
14:05:31	[D]	[ApplianceBase:075]	
Getting and sending a request from the queue...
14:05:31	[D]	[ApplianceBase:162]	
TX: AA 21 AC 8D 00 00 00 00 00 03 41 81 00 FF 03 FF 00 02 00 00 00 00 00 00 00 00 00 00 00 00 03 18 68 5B 
14:05:33	[D]	[ApplianceBase:139]	
Response timeout...
14:05:33	[D]	[ApplianceBase:146]	
Sending request again. Attempts left: 2...

still no RX…

Can you explain more what you mean? The log just outputs what I posted above, the yaml I’ve switched around like you said

i meant, the unit does not answer back (the esp sends (tx), but the ac doesn’t respond (rx)

I’de suggest to change gpio’s back to as they where, and check to usb2header connection for bad contact.
Ofc. it could also be that the esp12 simply is malfunctioning….
i noticed gpio4 and 5 are available on the pins on the back, you could try it with that ones by connecting it to brown and orange wires (or swapped) :thinking:

In my opinion, this is going the wrong way. I’d prefer a more basic approach, where we set up the dongle in ESPHome and flash it with a “ESPHome” firmware from your server.

But to give a good advise, I’d really need to know how your setup is. That ESPHome can’t detect your own firmware isn’t a good sign, and makes me guess, something else might be wrong… :wink:

i think that is what he did, as he received the config from the maker, and recompiled , i assumed on his own server…

This doesn’t sound to me, as it would be working with ESPHome(HA). The firmware is created, downloaded to a PC/Mac and uploaded via integrated web server. ESPHome should at least get the device, maybe with errors, but it should still get it.

That’s why I was asking last night for the setup. :slight_smile: And how, in general, is worked with the system. For me, it sounds like the “usual” approach from people asking for support - we click, we do that, we adjust there. In my experience there is a point where useful things get buggy, when people “try for their own”. In Germany we call that “blind actionism”. It’s not important what we do, as long as it looks like we are doing something. :rofl: :rofl: :rofl:

That being said, I’m a fan of starting with the basics. ESPHome must be running without errors, next step, the dongle must be recognizable, and then I’d start with a minimal setup, like OTA and wifi and work my way upwards. For now, we can’t rule out any general problems with ESPHome and the connections there in. Might very well be, that everything is all right and woking as it should, but I personally like to check that before I go deeper. But that’s me, maybe all these years in IT support have made me more suspicious than I’d need to be. :slight_smile: :rofl:

I agree, but it appears esphome was already working according the screenshot made in telegram…


so as far as i can see the whole (and only) issue is no RX….