I have a Renogy Wander that outputs via their Bluetooth dongle. I don’t want to buy the dongle, so my thought is to use an ESP8266 NodeMCU connected via an RS232 to TTL converter module. I’m just having an issue with the ESPHome code. I can’t seem to get HA to talk to the ESP8266. Anyone ever tries this and get this to work?
Yaml? Logs? What is a renogy wander? Where is it’s serial protocol documented.
esphome:
name: pv-solar
platform: ESP8266
board: nodemcuv2
substitutions:
updates: 30s
logger:
# Serial logging is disabled by setting the logger baud rate to 0.
# Otherwise the logger will occupy the hardware UART, making it unavailable
# for receiving smart meter data on pin D7 (GPIO13).
baud_rate: 0
level: info
# Enable Home Assistant API
api:
ota:
password: !secret ota_pv_solar
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
manual_ip:
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: !secret ap_ssid_solar
password: !secret ap_password_solar
captive_portal:
uart:
id: mod_uart
tx_pin: 1
rx_pin: 3
baud_rate: 9600
rx_buffer_size: 1500
modbus:
send_wait_time: 20ms
uart_id: mod_uart
id: mod_bus
modbus_controller:
- id: renogy_wanderer
## the Modbus device addr
address: 0x0
modbus_id: mod_bus
sensor:
#Battery Capacity
- platform: modbus_controller
modbus_controller_id: renogy_wanderer
name: "Battery Capacity"
id: battery_capacity
register_type: read
address: 0x10C
unit_of_measurement: "V"
value_type: U_WORD
#Battery VOLTS
- platform: modbus_controller
modbus_controller_id: renogy_wanderer
name: "Battery Volts"
id: battery_volts
register_type: read
address: 0x101
unit_of_measurement: "V"
value_type: U_WORD
#Charging Amps
- platform: modbus_controller
modbus_controller_id: renogy_wanderer
name: "Charging Amps"
id: charg_amps
register_type: read
address: 0x102
unit_of_measurement: "A"
value_type: U_WORD
#Charging State
- platform: modbus_controller
modbus_controller_id: renogy_wanderer
name: "Charging State"
id: Charg_state
register_type: read
address: 0x120
unit_of_measurement: ""
value_type: U_WORD
#Load Watts
- platform: modbus_controller
modbus_controller_id: renogy_wanderer
name: "Load Watts"
id: load_watts
register_type: read
address: 0x106
unit_of_measurement: "W"
value_type: U_WORD
#Panel Volts
- platform: modbus_controller
modbus_controller_id: renogy_wanderer
name: "Panel Volts"
id: panel_volts
register_type: read
address: 0x107
unit_of_measurement: "V"
value_type: U_WORD
#Panel Amps
- platform: modbus_controller
modbus_controller_id: renogy_wanderer
name: "Panel Amps"
id: panel_amps
register_type: read
address: 0x108
unit_of_measurement: "A"
value_type: U_WORD
#Panel Watts
- platform: modbus_controller
modbus_controller_id: renogy_wanderer
name: "Panel Watts"
id: panel_watts
register_type: read
address: 0x109
unit_of_measurement: "W"
value_type: U_WORD
#Charging Volts
- platform: modbus_controller
modbus_controller_id: renogy_wanderer
name: "Charing Volts"
id: charg_volts
register_type: read
address: 0xE006
unit_of_measurement: "V"
value_type: U_WORD
This is the link to the GitHub that has provided the most information on the Renogy Wanderer.
https://github.com/mickwheelz/NodeRenogy
Here is the link to the solar controller: https://www.renogy.com/wanderer-li-30a-pwm-charge-controller/
You forgot your log.
I spent a lot of time fiddling with this a month or two ago and eventually got it to work. I have not posted my configs to GitHub yet, but looking at your config, I have two comments when comparing to what I got working that might help you:
- Despite the majority of people and documentation listing the address as 0x0, for my 10A Renogy Wanderer purchased via Amazon a few months ago, the address to use in esphome is actually 0xFF. Not sure if Renogy changed something and this is the actual address or if it’s a bug somewhere–I have not hooked it up to anything other than ESPHome yet to verify but that’s what worked for my model.
- Basically every register is of ‘holding’ type, not ‘read’ type. I listed out all of mine as read type at first too and they did not work properly. I am very new to modbus though so I was doing a lot of learning at the same time!
I am assuming you have also double-checked the wiring on your RS232 adapter–they can be easy to wire up wrong. I was convinced I had mine wrong until I tried 0xFF.
As an aside for others: these controllers are awesome, reasonably priced and give you a ton of data. The 10A wanderer lets you control the switched output via modbus too. BOOM! Instant, solid-state smart light switch in your solar-powered shed! Just about all the Renogy controllers use the same or very similar protocol as far as I can tell and they will even provide you with their official spec if you ask them on their forums (this PDF and other documentation are floating around in various GitHub repos).
Thank you, I’ll try out the new address.
I’m interested in doing this also, would be awesome to have a full write-up including wiring the cable up to the nodemcu.
Agreed. I have a 10A Wanderer with BT-1 working under a different setup but attempts so far with my new Renogy 48V 3500W with BT-2 have not worked. This unit uses a RS485 (instead of the RS232) but would be happy to just wire it direct to a Pi and transmit to HA.
I kind of gave up on using the NodeMCU due to my lack of the code needed. I did download SolarThing and installed it to a Raspberry Pi Zero W with it publishing data via MQTT. Just trying it tonight to see if it works.
I did see there is a HACS integration now for the Renogy Rover but there are zero instructions, so I’m not sure how works.
Did you try it?
I am trying now and not having much luck. I fried an esp8266 already because there is 15V coming out of one of the RS232 wires.
Daniel, would you mind sharing the details of how you got your 10A wanderer hooked up, configs, etc.? I want to embark on this as well with an ESP and you seem to have figured it out I assume there’s a small circuit to adapt to real rs-232, more config for the switched output, etc… would be awesome if you could share! Thanks!
I have not had any time to work on this at all (we recently moved), so this has not made it past the proof-of-concept stage for me yet, but I definitely got this all working once. I plan to get back to this project and document everything once I can get my workshop usable again, but that may take awhile.
For now, I made a quick write-up of what I can remember and threw together a repo with the configuration I was playing around with. It’s not complete or well-tested, but I hope it can at least get you started.
I’m heading down this path too. I’ve got some front porch numbers that I’ve wanted to power via solar. My plan is a small panel into a Wanderer and an ESP32 to monitor and control it. I’m very curious to know if the interface into the Wanderer supports turning the light circuit on/off.
Now I just have to dig through my parts bin and see if I have any old RJ12 connectors and cabling leftover from early 1990’s Apple ][ Digicard networking…
That and I’m debating how I’m going to switch the numbers on/off. They’re pretty low power, .04A@12vdc each. For giggles I’m going to see about animating the lighting sequence to make it easier for take-out deliver people to find the house; cycle through like a marquee. The numbers I’ve got are single color (warm white), and at 5" tall don’t really seem like they’d lend themselves to sequenced color per-number like WS2812B lights.
The interface does indeed let you switch the light output on/off. Don’t be afraid to share the finished project!
From what I understand you’d only see higher voltages on the power pins. When looking into the RJ12 socket on my Wanderer 10A the pins are pwr,pwr,gnd,gnd,rx,tx. I had to double-check as some posts I’ve read seemed to list the pins the other way around. RJ sockets are kind of notorious for being documented inconsistently. As in, do we list the pins in the plug on the cable? When facing up, or down? When likewise when looking into a socket, is it locking tab up or down?
Reviving a thread from last year, I know. But I am rolling with this project as well because I have two Wanderers in use and would love to monitor them. I used dgtlcopywrite’s github info and I have my ESP32 programmed with an RS232 to TTL converter and I keep getting the following errors. I am very inexperienced with modbus programming so any direction would be much appreciated…
esphome:
name: esphome-web-9ad564
friendly_name: testing123
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
baud_rate: 0
# Enable Home Assistant API
api:
encryption:
key: "its a secret"
ota:
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "ssid"
password: "password"
captive_portal:
uart:
id: mod_uart
tx_pin: GPIO1
rx_pin: GPIO3
baud_rate: 9600
rx_buffer_size: 1500
modbus:
send_wait_time: 20ms
uart_id: mod_uart
id: mod_bus
modbus_controller:
- id: renogy_wanderer
## the Modbus device addr
address: 0xFF
modbus_id: mod_bus
sensor:
#Battery Capacity
- platform: modbus_controller
modbus_controller_id: renogy_wanderer
name: "Battery Capacity"
id: battery_capacity
register_type: read
address: 0x10C
unit_of_measurement: "V"
value_type: U_WORD
#Battery VOLTS
- platform: modbus_controller
modbus_controller_id: renogy_wanderer
name: "Battery Volts"
id: battery_volts
register_type: read
address: 0x101
unit_of_measurement: "V"
value_type: U_WORD
#Charging Amps
- platform: modbus_controller
modbus_controller_id: renogy_wanderer
name: "Charging Amps"
id: charg_amps
register_type: read
address: 0x102
unit_of_measurement: "A"
value_type: U_WORD
#Charging State
- platform: modbus_controller
modbus_controller_id: renogy_wanderer
name: "Charging State"
id: Charg_state
register_type: read
address: 0x120
unit_of_measurement: ""
value_type: U_WORD
#Load Watts
- platform: modbus_controller
modbus_controller_id: renogy_wanderer
name: "Load Watts"
id: load_watts
register_type: read
address: 0x106
unit_of_measurement: "W"
value_type: U_WORD
#Panel Volts
- platform: modbus_controller
modbus_controller_id: renogy_wanderer
name: "Panel Volts"
id: panel_volts
register_type: read
address: 0x107
unit_of_measurement: "V"
value_type: U_WORD
#Panel Amps
- platform: modbus_controller
modbus_controller_id: renogy_wanderer
name: "Panel Amps"
id: panel_amps
register_type: read
address: 0x108
unit_of_measurement: "A"
value_type: U_WORD
#Panel Watts
- platform: modbus_controller
modbus_controller_id: renogy_wanderer
name: "Panel Watts"
id: panel_watts
register_type: read
address: 0x109
unit_of_measurement: "W"
value_type: U_WORD
#Charging Volts
- platform: modbus_controller
modbus_controller_id: renogy_wanderer
name: "Charing Volts"
id: charg_volts
register_type: read
address: 0xE006
unit_of_measurement: "V"
value_type: U_WORD
Programs just fine then I get these communication errors.
[21:24:37][D][modbus_controller:032]: Modbus command to device=0 register=0x101 countdown=0 no response received - removed from send queue
[21:24:37][D][modbus_controller:032]: Modbus command to device=0 register=0x106 countdown=0 no response received - removed from send queue
[21:24:38][D][modbus_controller:032]: Modbus command to device=0 register=0x10C countdown=0 no response received - removed from send queue
[21:24:38][D][modbus_controller:032]: Modbus command to device=0 register=0x120 countdown=0 no response received - removed from send queue
[21:24:38][D][modbus_controller:032]: Modbus command to device=0 register=0xE006 countdown=0 no response received - removed from send queue
[21:25:37][D][modbus_controller:032]: Modbus command to device=0 register=0x101 countdown=0 no response received - removed from send queue
[21:25:37][D][modbus_controller:032]: Modbus command to device=0 register=0x106 countdown=0 no response received - removed from send queue
[21:25:37][D][modbus_controller:032]: Modbus command to device=0 register=0x10C countdown=0 no response received - removed from send queue
[21:25:38][D][modbus_controller:032]: Modbus command to device=0 register=0x120 countdown=0 no response received - removed from send queue
[21:25:38][D][modbus_controller:032]: Modbus command to device=0 register=0xE006 countdown=0 no response received - removed from send queue
I ended up having a bad converter board. Once I swapped that out and verified my wiring, all started working properly. Can confirm dgtlcopywrite github info works.
This may or may not help anyone, but I got something to work with an Arduino Uno / Ethernet Shield and use MQTT to send the data from my solar shed to my house. Unfortunately, the Uno’s sketch uses a MODBUS library that doesn’t work with ESP32. I’m trying to get something to work with ESP32 for another solar project so it’s an ongoing project for me.
You can find details on my Amateur Radio blog at: https://www.wt4y.com/solar/renogy-charge-controller. There you will find details on the RS-232 converter, RS-232 cable, MODBUS address, Arduino sketch, Node Red flow, etc. The Arduino code is just cobbled together, but I stopped writing when I got it to work. Be gentle because I’m old and easily confused!
First time posting here. The yaml posted by jmyers.builds definitely helped me add my 40amp Rover to HA in my camper. Not sure if it’s Rover specific, but I had to look back over the code from dgtlcopywrite and ended up changing the register type from “read” to “holding” in order to get the values to populate correctly. Also added a 4 second update interval because the values seemed to freeze often and added the config for the charging state. Running this on an ESP32 that was already tracking my propane tanks levels using Mopeka standard sensors. Hopefully this helps someone.
uart:
id: mod_uart
tx_pin: GPIO1
rx_pin: GPIO3
baud_rate: 9600
rx_buffer_size: 1500
modbus:
send_wait_time: 250ms
uart_id: mod_uart
id: mod_bus
modbus_controller:
- id: renogy_wanderer
## the Modbus device addr
address: 0xFF
modbus_id: mod_bus
update_interval: 4s
sensor:
#Battery Capacity
- platform: modbus_controller
modbus_controller_id: renogy_wanderer
name: "Battery Capacity"
id: battery_capacity
register_type: holding
address: 0x10C
unit_of_measurement: "V"
value_type: U_WORD
#Battery VOLTS
- platform: modbus_controller
modbus_controller_id: renogy_wanderer
name: "Battery Volts"
id: battery_volts
register_type: holding
address: 0x101
unit_of_measurement: "V"
value_type: U_WORD
accuracy_decimals: 1
filters:
- multiply: 0.1
#Charging Amps
- platform: modbus_controller
modbus_controller_id: renogy_wanderer
name: "Charging Amps"
id: charg_amps
register_type: holding
address: 0x102
unit_of_measurement: "A"
value_type: U_WORD
accuracy_decimals: 2
filters:
- multiply: 0.01
#Charging State
- platform: modbus_controller
modbus_controller_id: renogy_wanderer
name: "Charging State"
id: Charg_state
register_type: holding
address: 0x120
bitmask: 0x00FF
unit_of_measurement: ""
value_type: U_WORD
accuracy_decimals: 0
#Load Watts
- platform: modbus_controller
modbus_controller_id: renogy_wanderer
name: "Load Watts"
id: load_watts
register_type: holding
address: 0x106
unit_of_measurement: "W"
value_type: U_WORD
accuracy_decimals: 2
filters:
- multiply: 0.01
#Panel Volts
- platform: modbus_controller
modbus_controller_id: renogy_wanderer
name: "Panel Volts"
id: panel_volts
register_type: holding
address: 0x107
unit_of_measurement: "V"
value_type: U_WORD
accuracy_decimals: 1
filters:
- multiply: 0.1
#Panel Amps
- platform: modbus_controller
modbus_controller_id: renogy_wanderer
name: "Panel Amps"
id: panel_amps
register_type: holding
address: 0x108
unit_of_measurement: "A"
value_type: U_WORD
accuracy_decimals: 2
filters:
- multiply: 0.01
#Panel Watts
- platform: modbus_controller
modbus_controller_id: renogy_wanderer
name: "Panel Watts"
id: panel_watts
register_type: holding
address: 0x109
unit_of_measurement: "W"
value_type: U_WORD
accuracy_decimals: 1
#Charging Volts
- platform: modbus_controller
modbus_controller_id: renogy_wanderer
name: "Charging Volts"
id: charg_volts
register_type: holding
address: 0xE006
unit_of_measurement: "V"
value_type: U_WORD
accuracy_decimals: 1
filters:
- multiply: 0.1
text_sensor:
- id: bat_charging_state
name: "Battery Charging State"
platform: template
icon: mdi:battery-charging
lambda: |-
auto current_state = (int)id(Charg_state).state;
if (current_state == 0) return {"Not Charging"};
if (current_state == 1) return {"Charging"};
if (current_state == 2) return {"Power Point Tracking"};
if (current_state == 3) return {"Equalizing"};
if (current_state == 4) return {"Boosting"};
if (current_state == 5) return {"Floating"};
if (current_state == 6) return {"Overpower"};
return {"Unknown"};
Very cool, I can’t wait to try this. I too am using mopeka propane sensor and water tank sensor in the RV and have those brought in to esphome. I have a bunch of renogy devices, but am using a bluetooth hub so am wondering if there is any way to integrate that in. Wish we had a bluetooth interface to bring in the Renogy stuff.