Hi there,
I’ve been troubleshooting this all day, but finally got it working!
I ordered a Renogy smart LFP battery for my van/RV and ordered the one WITHOUT bluetooth! Since I don’t want to have a app that monitors my battery, I want a local esphome solution.
After a lot of learning, and using ChatGPT as my personal modbus tutor I finally got it working. Below you’ll find the config, and I’m just posting for anyone else wanting to run ESPHome to monitor a Renogy battery.
Required hardware:
- ESP32 (esp8266 might work too, haven’t tested)
- max485 board (I used this one: https://www.amazon.nl/ARCELI-MAX485-module-RS-485-ontwikkelingsboard/dp/B0785B3BS8)
- Renogy smart battery with a RJ45 socket (not the bluetooth version)
Required tools:
- RJ45 pliers/cutters to create a connections
- Dupont cables
- Screwdriver
I might add a wiring diagram later using fritzing, but for now I’m done sitting behind my laptop haha.
With the help of the following sources:
ESPHome code:
esphome:
name: renogy-battery
friendly_name: Renogy Battery
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
web_server:
port: 80
local: true
# Enable Home Assistant API
api:
ota:
password: ""
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "renogy-battery Fallback Hotspot"
password: ""
captive_portal:
uart:
id: uart_bus
tx_pin: 16
rx_pin: 17
baud_rate: 9600
modbus:
flow_control_pin: 5 # This is the DE/RE pin on the MAX485
id: mod_bus
modbus_controller:
- id: renogy
## the Modbus device addr
address: 0xF7
modbus_id: mod_bus
setup_priority: -10
#update_interval: 5s
sensor:
- platform: modbus_controller
modbus_controller_id: renogy
id: cell_count
name: "Cell Count"
address: 0x1388
register_type: holding
value_type: U_WORD
unit_of_measurement: ""
- platform: modbus_controller
modbus_controller_id: renogy
id: voltage
name: "Voltage"
address: 0x13b3
register_type: holding
value_type: U_WORD
unit_of_measurement: "V"
accuracy_decimals: 1
filters:
- multiply: 0.10
- platform: modbus_controller
modbus_controller_id: renogy
id: cellvoltage_1
name: "Cell Voltage 1"
address: 0x1389
register_type: holding
value_type: U_WORD
unit_of_measurement: "V"
accuracy_decimals: 1
filters:
- multiply: 0.10
- platform: modbus_controller
modbus_controller_id: renogy
id: cellvoltage_2
name: "Cell Voltage 2"
address: 0x138a
register_type: holding
value_type: U_WORD
unit_of_measurement: "V"
accuracy_decimals: 1
filters:
- multiply: 0.10
- platform: modbus_controller
modbus_controller_id: renogy
id: cellvoltage_3
name: "Cell Voltage 3"
address: 0x138b
register_type: holding
value_type: U_WORD
unit_of_measurement: "V"
accuracy_decimals: 1
filters:
- multiply: 0.10
- platform: modbus_controller
modbus_controller_id: renogy
id: cellvoltage_4
name: "Cell Voltage 4"
address: 0x138c
register_type: holding
value_type: U_WORD
unit_of_measurement: "V"
accuracy_decimals: 1
filters:
- multiply: 0.10
- platform: modbus_controller
modbus_controller_id: renogy
id: celltemp_1
name: "Cell Temp 1"
address: 0x139a
register_type: holding
value_type: U_WORD
unit_of_measurement: "°C"
accuracy_decimals: 1
filters:
- multiply: 0.10
- platform: modbus_controller
modbus_controller_id: renogy
id: celltemp_2
name: "Cell Temp 2"
address: 0x139b
register_type: holding
value_type: U_WORD
unit_of_measurement: "°C"
accuracy_decimals: 1
filters:
- multiply: 0.10
- platform: modbus_controller
modbus_controller_id: renogy
id: celltemp_3
name: "Cell Temp 3"
address: 0x139c
register_type: holding
value_type: U_WORD
unit_of_measurement: "°C"
accuracy_decimals: 1
filters:
- multiply: 0.10
- platform: modbus_controller
modbus_controller_id: renogy
id: celltemp_4
name: "Cell Temp 4"
address: 0x139d
register_type: holding
value_type: U_WORD
unit_of_measurement: "°C"
accuracy_decimals: 1
filters:
- multiply: 0.10
- platform: modbus_controller
modbus_controller_id: renogy
id: current
name: "Current"
address: 0x13b2
register_type: holding
value_type: U_WORD
unit_of_measurement: "A"
accuracy_decimals: 1
- platform: modbus_controller
modbus_controller_id: renogy
id: remaining_charge
name: "Remaining Charge"
address: 0x13b4
register_type: holding
value_type: U_WORD
unit_of_measurement: "Ah"
- platform: modbus_controller
modbus_controller_id: renogy
id: firmware_version
name: "Firmware Version"
address: 0x140a
register_type: holding
value_type: U_WORD
unit_of_measurement: ""
button:
- platform: restart
name: "Renogy restart"