How do I output hex data from GPIO1?

I have 2 ESP8266 relay modules that I was hoping to use to open/close my garage door and open/close my front gates. Each module has a STM8S103F mpu to control each of the 2 relays in response to commands from the ESP8266.

To turn relay 1 ON, the ESP8266 must output the hex sequence “A0 01 01 A2” from GPIO1 (Tx).

To turn relay 1 OFF, the ESP8266 must output the hex sequence “A0 01 00 A1” from GPIO1 (Tx).

Could someone guide me as to what I need to add to the xxxxx.yaml file in ESPHome to enable me to output those hex sequences and thus control that relay?

I am new to all this ESPHome stuff and I have looked through all the ESPHome documentation, but could not find anything that looked relevant …

Thanks in anticipation.

If you search the forum someone has solved this, I have seen it. It uses uart. See UART Switch — ESPHome

Thanks Nick, I think I found the forum thread that you mentioned, and it has all the information that I was looking for … :smiley:

That looks like the one. As this forum grows and grows it gets harder to find things!