Yes, i use ESPHome config yaml as github's online readme code. turn ON/OFF switch in home assistant. it's ok. i suggest you try to test with another ESP32 board with RS485 interface. Perhaps there is a problem with the circuit in the "send" direction of your ESP32 board RS485 circuit.
YouTube: https://www.youtube.com/c/KinCony
Online Store: https://shop.kincony.com
Alibaba Store: https://kincony.en.alibaba.com/
Online Store: https://shop.kincony.com
Alibaba Store: https://kincony.en.alibaba.com/

