ESPHome Modbus WiFi for T80 4-20mA (originally without RS485)

Hello everyone in the community.
I purchased a T80 220VAC 4-20mA. While tinkering with it, I noticed that the menu has settings for BaudRate and Unit ID. The T80 I bought did not come with an RS485 module, so I opened it up and found unpopulated pads labeled “GAB.” After experimenting with an RS485 module and the T80, I managed to establish Modbus communication.

If anyone would like to play around with this, I’m attaching a description of how to do it.

I used a Wemos D1 because it has a built-in regulator from 5V to 3.3V, and I did the RX/TX level conversion from the 5V T80 to 3.3V for the Wemos D1. GAB pin 8 PWM.

For testing, it is necessary to simulate 4-20mA. A 3k3 resistor is needed, connected from T80 +24V to terminal 7 of the T80. Otherwise, the T80 does not communicate!

The code for integration into Home Assistant is created in ESPHome. It’s not complete — maybe someone will step up and fine-tune it :smiley:

yaml: https://gist.github.com/GeorgeWatch/9e73c7cb279fcaee0217332526ca8724