Midea branded AC’s with ESPhome (no cloud)

Ok…i am at someones mercy here now who has some more knowledge.
Got following state:

remote_transmitter:
  pin: GPIO14
  carrier_duty_percent: 100%

#new added for test
sensor:
  - platform: homeassistant
    id: follow_me_sensor
    entity_id: sensor.ble_temperature_schlafzimmer_a4c13888d685
    internal: true
    filters:
      - throttle: 10s
      - heartbeat: 2min       
      - debounce: 1s
    on_value:
      midea_ac.follow_me:
        temperature: !lambda "return x;"
        beeper: false
  • Logs show follow me does know the temperature and tries to send it
    BUT
    I cannot use the remote; meaning no beep no control nothing as long cables is connected and while cable is connected it seems like wall unit is kinda frozen state but does not react on HA commands that are directed to the remote part like swing state, beeper on off or Display toggle.
    As soon i disconnect the wire, remote works, frozen state of wall unit frees up and i can do remote follow me, dispaly toggle and swing state.

Does that sound anywhere logic to anyone?
Do i need a diode in the communication line? or amplified signal?
HELP…

That makes sense. I don’t think there is a Relative Humidity Sensor in my Mr Cool Unit.

Any updates with this USB to RS485 test? I also have a system without H1 and H2 I think. Did Midea give you any documentation?
I’m guessing they won’t unfortunately. You’ll need to get in touch with one of their engineers, not tech support.

Does anyone have information on what unit’s support tracking their energy usage And reporting relative humidity? On the models I have now, HA either shows 0 or random values that don’t make sense, and it’s not shown in the official app either.

As far as I know, one ESPhome project uses UART over the USB dongle pins and another Modbus ESPhome project uses H1/H2 for external integration and XYE, (which also carry line voltage) for communication between the units.
Is this correct?

Hello everyone! I have an HA server on my home, using it already a half of year with no problems, but actually i am not really advanced user, and i am really bad with all this code that people writing in a .yamls.
I am able to flash esp device via UART, but i am not able to wtite my own config from zero, for now at least.
I have a couple of Royal Clima TMN09HN which are works fine i suppose click, but i cant find in this topic where i should start from. What controller should i buy and what image i should flash it before connecting to USB connector under the capony of my A/C. And then - what should i do further to add a A/C into my HA?
I will really appreciate any help.

All is in the 1st topic :wink:

Also the yamls you can just copy and paste (maybe edit some lines like wifi details/name/hotspot etc)

Hi I’m new here and just new in general :). I plan to look at all the rest of the posts above tonight. I was reading and I saw someone “kokuo81” get success with their esp board controller. And I am wondering if I can do this with the factory esp dongle? If not I would enjoy building my own esp board based controller. But programming is not something I do much is there a repository of the code?

does anyone know if there is away to have the LED always off on the inside unit. my MRCOOL remote has an LED button, was wondering if there is a away to add this parameter to HA? the midea esphome component is working great other than that i guess its a niche request…

I check this usb on esp home and it shows up and is easily flashed but fails on internet connection. her is the log. INFO Reading configuration /config/esphome/senville.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing senville (board: esp32dev; framework: arduino; platform: platformio/espressif32 @ 5.2.0)
--------------------------------------------------------------------------------
`HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3````````````````
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf``````````````
Dependency Graph
|-- AsyncTCP-esphome @ 1.2.2
|-- WiFi @ 2.0.0
|-- FS @ 2.0.0
|-- Update @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 2.1.0
|   |-- AsyncTCP-esphome @ 1.2.2
|-- DNSServer @ 2.0.0
|-- ESPmDNS @ 2.0.0
|-- noise-c @ 0.1.4
|   |-- libsodium @ 1.10018.1
Compiling /data/senville/.pioenvs/senville/src/main.cpp.o
Linking /data/senville/.pioenvs/senville/firmware.elf
RAM:   [=         ]  12.4% (used 40520 bytes from 327680 bytes)
Flash: [=====     ]  49.0% (used 898561 bytes from 1835008 bytes)
Building /data/senville/.pioenvs/senville/firmware.bin
Creating esp32 image...
Successfully created esp32 image.
esp32_create_combined_bin(["/data/senville/.pioenvs/senville/firmware.bin"], ["/data/senville/.pioenvs/senville/firmware.elf"])
Wrote 0xecc90 bytes to file /data/senville/.pioenvs/senville/firmware-factory.bin, ready to flash to offset 0x0`
========================= [SUCCESS] Took 5.12 seconds =========================
INFO Successfully compiled program.
INFO Resolving IP address of senville.local
ERROR Error resolving IP address of senville.local. Is it connected to WiFi?
ERROR (If this error persists, please set a static IP address: https://esphome.io/components/wifi.html#manual-ips)
ERROR Error resolving IP address: Error resolving address with mDNS: Did not respond. Maybe the device is offline., [Errno -5] No address associated with hostname
What might I do next?`

I have also removed the wifi credentials ssid and password to attempt to get this to create its own hotspot. not sure if the esp32 pico v3 zero can do that.

Apparently there is something wrong with your mDNS (which is something common happening on many routers).
Easiest way around it is to use a fixed static IP address :wink:

There’s a toggle to turn it off, but it looks like you need an IR blaster maybe? You could try putting it in your yaml and see if it works. Unfortunately it’s a toggle, so doesn’t an explicit off if it does work. I personally couldn’t get it to work on mine.

# Example configuration entry

remote_transmitter:
  pin: GPIO13                       # For iot-uni-stick.
  carrier_duty_percent: 100%        # 50% for IR LED, 100% for direct connect to TSOP IR receiver output.

sensor:
  - platform: homeassistant
    entity_id: sensor.room_sensor   # Sensor from HASS
    internal: true
    filters:
      - throttle: 10s
      - heartbeat: 2min             # Maximum interval between updates.
      - debounce: 1s
    on_value:
      midea_ac.follow_me:
        temperature: !lambda "return x;"
        beeper: false               # Optional. Beep on update.

# template buttons for sending display control command and swing step actions
button:
  - platform: template
    name: Display Toggle
    icon: mdi:theme-light-dark
    on_press:
      midea_ac.display_toggle:
  - platform: template
    name: Swing Step
    icon: mdi:tailwind
    on_press:
      midea_ac.swing_step:

Esphome makes a guess about the device’s network, and sometimes it guesses wrong. You can fix this by using:

use_address (Optional, string): Manually override what address to use to connect to the ESP. Defaults to auto-generated value. Example, if you have changed your static IP and want to flash OTA to the previously configured IP address.

Example:

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  use_address: <your devices IP or DNS name here>
  ap:
    ssid: "${friendly_name} Fallback"
    password: !secret wifi_password
  power_save_mode: HIGH # for ESP8266 LOW/HIGH are mixed up, esphome/issues/issues/1532

More info:

ah, ill give it a try, i suppose technically Icould get the bond bridge and integrate that into HA to get the those parameters in maybe? A bit silly for just one or two buttons at the Bond’s price point.

Nothing, I abandoned the project for now due lack of time.

any ideas why my esp01 is dropping from the network nearly ever minute or so and then back on?

That would be the part with follow me.
According to the documentation, u either have to set up a led sender in front of the unit or u wire a lead from your gpioxyz to the the signal leg of the tsop inside.
I am at that spot right now but as soon i connect the lead to the signal leg, remote is frozen/unresponsive to my esp commands and the original remote…
So i am prob missing something but…
If you figure it out, let me know

I just realized what exactly the follow me is supposed to do, and realized I have something similar. Basically if I understand it right there’s a temp sensor in the remote, and it replaces the temp sensor in the heat pump.

Instead of the remote though, I’m using an ESP8266 with a Dallas temp sensor. The basic idea is when the dallas sensor gets a new value, connect to the heatpump esp chip and set a template number to have that value. Then in an automation treat the template number as a thermometer and handle it like you like.

Here’s an example:

In the heatpump ESP chip yaml add this:

globals:
   - id: auto_mode
     type: bool
     restore_value: false
     initial_value: 'false'


switch:
  - platform: template
    name: ${friendly_node_name} Auto Mode
    id: ${node_id}_auto_mode
    icon: mdi:car-turbocharger
    optimistic: true
    lambda: return id(auto_mode);  
    turn_on_action:
        - lambda: |-
            id(auto_mode) = true;
            id(${node_id}_automation_lambda).press();
    turn_off_action:
        - lambda: |-
            id(auto_mode) = false;
button:
  - platform: template
    internal: true
    id: ${node_id}_automation_lambda
    on_press:
        - lambda: |-
                  if (id(auto_mode)) {
                       float tempDifference = id(${node_id}_my_climate).target_temperature - id(${node_id}_room_temperature_c).state;
                      ESP_LOGW(
                              "climate_temp", "difference: %f°F,  target: %f°F, room: %f°F", 
                              (tempDifference * 1.8), 
                              (id(${node_id}_my_climate).target_temperature * 1.8 + 32),
                              (id(${node_id}_room_temperature_c).state * 1.8 + 32)
                      );
                       if(tempDifference > $heat_on_below_set_temp) {
                          ESP_LOGW("climate_mode", "Mode: [%s]","heat");
                           if (ClimateMode::CLIMATE_MODE_HEAT != id(${node_id}_my_climate).mode) {
                              ESP_LOGW("climate_mode", "Mode: [%s]","setting mode heat");
                              id(${node_id}_my_climate).make_call().set_mode(ClimateMode::CLIMATE_MODE_HEAT).perform();
                           }
                           delay(2000);
                           if(tempDifference > $heat_turbo_on_below_set_temp) {
                              ESP_LOGW("climate_preset",    "Preset: [%s]", "boost");
                               if (ClimatePreset::CLIMATE_PRESET_BOOST !=  id(${node_id}_my_climate).preset.value()) {
                                  ESP_LOGW("climate_preset",    "Preset: [%s]", " setting boost heat");
                                  id(${node_id}_my_climate).make_call().set_preset(ClimatePreset::CLIMATE_PRESET_BOOST).perform();
                               } else if (tempDifference < -$heat_turbo_off_above_set_temp) {
                              ESP_LOGW("climate_preset",    "Preset: [%s]", "none");
                               if (ClimatePreset::CLIMATE_PRESET_NONE !=   id(${node_id}_my_climate).preset.value()) {
                                  ESP_LOGW("climate_preset",    "Preset: [%s]", " setting none heat");
                                  id(${node_id}_my_climate).make_call().set_preset(ClimatePreset::CLIMATE_PRESET_NONE).perform();
                               }
                              }
                           }
                      } else if(tempDifference < -$cool_on_above_set_temp) {
                          ESP_LOGW("climate_mode", "Mode: [%s]", "cool");
                           if (ClimateMode::CLIMATE_MODE_COOL != id(${node_id}_my_climate).mode) {
                              ESP_LOGW("climate_mode", "Mode: [%s]", "setting mode cool");
                              id(${node_id}_my_climate).make_call().set_mode(ClimateMode::CLIMATE_MODE_COOL).perform();
                           }
                           delay(2000);
                           if (tempDifference < -$cool_turbo_on_above_set_temp) {
                              ESP_LOGW("climate_preset",    "Preset: [%s]", "boost");
                               if (ClimatePreset::CLIMATE_PRESET_BOOST !=  id(${node_id}_my_climate).preset.value()) {
                                  ESP_LOGW("climate_preset",    "Preset: [%s]", " setting boost cool");
                                  id(${node_id}_my_climate).make_call().set_preset(ClimatePreset::CLIMATE_PRESET_BOOST).perform();
                               } else if  (tempDifference > $cool_turbo_off_below_set_temp) {
                              ESP_LOGW("climate_preset",    "Preset: [%s]", "none");
                               if (ClimatePreset::CLIMATE_PRESET_NONE !=   id(${node_id}_my_climate).preset.value()) {
                                  ESP_LOGW("climate_preset",    "Preset: [%s]", " setting none cool");
                                  id(${node_id}_my_climate).make_call().set_preset(ClimatePreset::CLIMATE_PRESET_NONE).perform();
                               }
                              }
                           }
                       }
                  }
number:
  - platform: template
    name: ${friendly_node_name} Room Temperature °C
    id: ${node_id}_room_temperature_c
    optimistic: true
    min_value: -40
    max_value: 100
    restore_value: true
    step: 0.1
    on_value:
      then:
        - lambda: |-
            id(${node_id}_automation_lambda).press();

in the Dallas Esp chip yaml have it include this:


http_request:
  id: http_request_data
  useragent: esphome/device
  timeout: 10s
  esp8266_disable_ssl_support: true

dallas:
  - pin: ${dallas_pin}
    id: ${device_name}_pin
    update_interval: ${dallas_update}

sensor:
  - platform: dallas
    address: ${dallas_address}
    name: ${friendly_name}
    id: ${device_name}
    dallas_id: ${device_name}_pin
    on_value:
      then:
      - http_request.post: !lambda |- 
              return "http://some-heatpump.lan/number/some_heatpump_room_tempreture_c/set?value=" + std::to_string(x);

Net result is a pure wifi and ESP replacement for follow me.

1 Like