Code Monkey home page Code Monkey logo

esp32_midea_rs485's Introduction

ESP32_Midea_RS485

Home Assistant Integration:

  1. copy the file GitHub\ESP32_Midea_RS485\example\esp32_midea_RS485_HA_sample\bunicutz_AC.h in HA in the folder /config/esphome/
  2. initialize your esp32 device following normal esphome plugin procedure (if you do not have esphome plugin installed then install it)
  3. copy the configuration of the sensor from the template GitHub\ESP32_Midea_RS485\example\esp32_midea_RS485_HA_sample\aer-conditionat.yaml

HW connection:

Master configuration from: https://microcontrollerslab.com/rs485-serial-communication-esp32-esp8266-tutorial/

RS485 communication protocol

Special thanks to XYE for reverse engineering the protocol: https://codeberg.org/xye/xye

Interface description:

Functions:

begin:
   hwSerial - ESP32 HW serial unit connected to the bus
   ro_pin - RI pin
   di_pin - RO pin
   re_de_pin - RE/DE pin
   master_id - id of the master
   slave_id - id of the slave
   command_time - time in ms needed for command: ~40ms (you can play with it untill no message is lost anymore)
   response_timeout - time after which the response is read: ~100ms
   
SetMode
   mode  - ac mode
SetFanMode
   fan_mode - ac fan mode
SetTemp
   temp - ac temperature
SetAuxHeat_Turbo
   value - switch on or off the feature
SetEcho_Sleep
   value - switch on or off the feature
SetSwing
   value - switch on or off the feature
SetVent
   value - switch on or off the feature

Update - call cyclically to send the commands

Lock - call to lock the AC

Unlock - call to unlock the AC

Globals

State
  Unknown1 - see https://codeberg.org/xye/xye
  Capabilities - see https://codeberg.org/xye/xye
  OpMode - operation mode
  FanMode - fan mode
  SetTemp - set temp in C
  T1Temp - Temp in C
  T2ATemp - Temp in C
  T2BTemp - Temp in C
  T3Temp - Temp in C
  Current - see https://codeberg.org/xye/xye
  Unknown2 - see https://codeberg.org/xye/xye
  TimerStart - time to start in minutes
  TimerStop - time to stop in minutes
  Unknown3 - see https://codeberg.org/xye/xye
  ModeFlags - see https://codeberg.org/xye/xye
  OperatingFlags - see https://codeberg.org/xye/xye
  ErrorFlags - see https://codeberg.org/xye/xye
  ProtectFlags - see https://codeberg.org/xye/xye
  CCMComErrorFlags - see https://codeberg.org/xye/xye
  Unknown4 - see https://codeberg.org/xye/xye
  Unknown5 - see https://codeberg.org/xye/xye
  ACNotResponding - flag indicating the communication status with the AC
  
SentData - send buffer : for debug purpose
ReceivedData - receive buffer : for debug purpose

esp32_midea_rs485's People

Contributors

bunicutz avatar evlo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.