Sending RS232/UART Commands to HDMI Matrix over WLAN with ESP8266

Hey everyone!

I have a EZ-MX42PRO-HAS HDMI Matrix from ezcoo (LINK). With the micro-USB connector on the front you can control the matrix via serial and query the status (You can read the documentation when you download the “Update and setting kit”.). Now i want to integrate it to my HA over WLAN. I have already found out that HA offers a serial integration, but I would prefer a solution via WLAN since my HA host is located further away.

An integration via IR I also do not want because I can not query the status. (And I have lost the remote control to be able to record the signals :confused: [And I do not want to pay 25€ shipping for a 8€ remote control :wink: ])

I already searched Google and blog posts and came across this git-project from jeelabs (LINK) which might be a good fit. But I’m having trouble figuring out how to connect the micro-USB cable to my ESP8266. I already found out that I need a development board that acts as a USB host, but I can’t find one that fits. All boards I find I think are more for programming the ESP like this one: andino.shop/en/p/ftdi-232-adapter

Am I on the right track or do I have to rethink the whole concept and start over?
I hope someone can help me.

Thanks in advance for your help!
Greetings from Germany!

Get a microusb cable, doesn’t matter what is on the other end.

Cut the other end off.

Solder the serial cable onto the esp and use esphome. Search here https://esphome.io/ for ‘uart’

1 Like

Hey thanks for your Answer!

I searched a bit but cand find a picture or something how i have to connect the wires to the ESP8266?

Won’t work as it’s serial over USB so not supported so far in ESPHome !! Maybe with the latest ESP that integrates an USB port but even not sure it would work as you need a driver to get ESP to be able to handle serial on USB :confused:

It is just serial. One wire RX, one wire TX.

I don’t think so as usb port is used for fw upgrade from a computer so it’s a regular USB port not a serial one !

The clue is in the name. USB universal SERIAL bus.

yeah but no !! you make confusions here, good luck to get it working with the ESP :wink:

Hey @vincen thanks for your answer!

Do you have any other solution? It dont have to be an ESP8266, would be nice because i habe those laying around.

@da_hepfe unhappy not as control through an USB port is quite complicated to handle in an automation system. I’m always very careful to select products I buy to have a proper control on it (serial mode through an RS-232/422/485 port, or TCP/IP :wink:
As indicated before it might be possible with the new ESP that have an USB port native but you’ll need to code it by yourself as it’s far to be supported in ESPHome right now :frowning:

I Hope this helps anyone that found this post via Google.

The EZ-MX42PRO-HAS has a USB port that has a rs232 to usb chip onboard (CH340). I think the reason is to make it easier for people to use the product. Anyone that is serious about Home Automation and Home Theater does not use USB todo anything.

So I bought one, why??? Because the old version of the EZ has a serial port and if it doesn’t I have a soldering iron :wink:

Once received I opened it up and low and behold a serial connector right on the PCB.

The only issue I had to hook it up to a ESP32 is that the serial is 5 volt and the esp32 and 5 volt really do not match.

Here is the Diagram

VCC pin is on the right towards the 5 volt DC connector (power supply)
vUSB is connected to 5 volt so as to power the ESP32 (LOLIN D32)

And here is the ESPHOME yaml

esphome:
  name: esphome-web-55806c
  friendly_name: EZ-MAX42-PRO-HAS

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "XXXXXXXX"

ota:


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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esphome-Web-55806C"
    password: "XXXXXX"

captive_portal:
    
uart:
  tx_pin: GPIO17
  rx_pin: GPIO16
  baud_rate: 57600

button:
  - platform: template
    name: UART TEST
    on_press:
      then:
        - logger.log: Button Pressed
        - uart.write: "EZS OUT1 VS IN3\r\n"



select:
  - platform: template
    name: HDMI 1 Input
    id: HDMI1_input
    options:
     - "1"
     - "2"
     - "3"
     - "4"
    initial_option: "1"
    optimistic: true
    set_action:
      - logger.log:
          format: "Chosen option: %s"
          args: ["x.c_str()"]
      - uart.write: !lambda
                    std::string s = "EZS OUT1 VS IN" + x +"\r\n";
                    return std::vector<unsigned char>(s.begin(),s.end());

Baud rate is pretty high… some level shifter clones go barf at those speeds
I used TXD/RXD 2 on the LOLIN, if you use a and ESP8266 be aware that TX/RX is shared for Firmware upload. Using anything else for UART goes into software UART and no clue if that works… just get a bigger ESP32 for 4 bucks :wink:
Enjoy!