ESPHome - nathanmarlor/foxess_modbus GitHub Wiki
Summary
While not supported by this project users have had success using an ESPHome supported device like an ESP32/ESP8266/etc and a $1 RS485<->TTL UART module board such as those based on the MAX485 chip.
Connections
Follow this wiring guide for your inverter. And this guide if you're not familiar with RS485.
Note that with RS485 the A terminal of the module connects to the A terminal on the inverter. No ground is shared between devices.
Conversely with TTL UART the Tx on the ESP connects to the Rx on the RS485 module.
Check your RS485 module's datasheet, this MAX485 module runs on 5V and not 3.3V so connect it appropriately.
ESPHome config
This example uses Oxan's Stream Server to pipe the RS485 commands over TCP.
external_components:
- source: github://oxan/esphome-stream-server
uart:
tx_pin: GPIO17
rx_pin: GPIO18
baud_rate: 9600
parity: NONE
data_bits: 8
stop_bits: 1
id: uart_bus
stream_server:
buffer_size: 512
uart_id: uart_bus
port: 502
When adding your device to Home Assistant chose the following:
- Device type: "Ethernet to Modbus/RS485 Adapter"
- Device model: "Other"
- Protocol: "Modbus RTU over TCP"