Midea branded AC’s with ESPhome (no cloud)

Am I missing something or can the target temperature not be changed by automation in HA?

I have my unit set up as an ESPhome appliance and I am able to change the temperature though a climate card no problem.

However, I cannot find the right automation settings to change the temperature.

When in the action part of the automation, I pick action type Device and then midea and only get HVAC Mode or Preset.

If I change to action type Condition, I select Entity Midea Climate and then attribute temperature, then set the state to the target temperature. When I run the action, the target temperature doesn’t change.



I can go into the developer settings and change the temperature state that way and it work.

I thought this would be easier lol

You’re looking at the wrong place. :slight_smile:

Device means in this situation, you want to control a specific device, eg. a Midea unit and it’s specific functions. What you’re looking for is to control a climate entity, so you have to call services from the climateintegration.

In your case under actions use not device but service. There you’ll find the climate specific services.

I know, this is a hard to understand thing, especially with climate or fan entities.

EDIT: You might want to tell us, what it is exactly, what you want to achieve, eg. “turn on the climate unit, if someone opens the backdoor”. :wink:

Thanks for the response!

I am trying to adjust the temperature based on time. So at 7 AM the unit changes to 76F and at 8PM the unit goes to 70F.

Your explanation was great!

I had messed with call service and it didn’t work, but it was because used the Midea device not the entity Midea Climate.

Now this config works just fine!! Thank you!!

1 Like

Hi,

2022 midea AC - AG2ECO 09NXD0-I
Original dongle was EU-SK105
Replaced with Smartlight ESPhome dongle
Home assistant detect dongle but no communication or control of AC unit

already replied to you on telegram😉
but you might as well answer the question here;telegram is not really related to HA🤔

[D][midea_ac:069]: TX: control
[D][midea_dongle:094]: TX: AA 22 AC 00 00 00 00 00 03 02 40 41 45 00 7F 7F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 50 19

the dongle is not receiving anything from the ac.
Tried swapping tx/rx?
Also possible gpio’s are configured wrong?
(easy to test when connecting tx to rx, you should see the same on tx and rx then)

when you say swap the TX/RX how would I do this when it’s a dongle? Do you mean at the usb header end? Can this be done via software and update via the web browser OTA?

You can select the pins in the ESPHome yaml file. :slight_smile:

uart:
  tx_pin: 1         # hardware dependant
  rx_pin: 3         # hardware dependant

Just change them there. :slight_smile:

Can you give me more info please, I’ve downloaded esphome from within home assistant but it doesn’t detect the dongle if I plug it into my mac. I’m guessing I need to flash it again but no idea how/ what image to use

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?