Closed worfrb closed 1 year ago
I switched the charge controller TX and RX to what should be the two PWR pins(i think) and I'm now getting data back from controller. 🤷 I selected the wire that had around 5 volts, along with the wire adjacent to it. If you look at the front of the controller, my pins go left to right PWR, PWR, GND, GND, RX, TX.
Seems to be working, I had some strange numbers in the beginning but I think I'm getting correct numbers now!
I found the basis for my config in a pastebin link. I also used some from this repository.
Thank you for the starting blocks provided by this repository, without it I would never have started and completed this project.
My config:
esphome:
name: solarcontroller
friendly_name: solarcontroller
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
level: VERBOSE
hardware_uart: UART1
# Enable Home Assistant API
api:
encryption:
key: ""
ota:
password: ""
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
use_address: 192.168.1.167
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Solarcontroller Fallback Hotspot"
password: ""
captive_portal:
uart:
id: mod_uart
tx_pin: 1
rx_pin: 3
baud_rate: 9600
rx_buffer_size: 1500
modbus:
send_wait_time: 300ms
uart_id: mod_uart
id: mod_bus
modbus_controller:
- id: renogy_wanderer
## the Modbus device addr (Renogy 10A Wanderer)
address: 0xFF
modbus_id: mod_bus
update_interval: 30s
sensor:
#Battery Capacity
- platform: modbus_controller
modbus_controller_id: renogy_wanderer
name: "Battery Capacity"
id: battery_capacity
register_type: holding
address: 0x0100
unit_of_measurement: "%"
value_type: U_WORD
icon: "mdi:battery-charging-80"
#Battery Voltage
- platform: modbus_controller
modbus_controller_id: renogy_wanderer
name: "Battery Volts"
id: battery_volts
register_type: holding
address: 0x0101
unit_of_measurement: "V"
value_type: U_WORD
accuracy_decimals: 1
icon: "mdi:battery-charging-80"
filters:
- multiply: 0.1
#Charging Current
- platform: modbus_controller
modbus_controller_id: renogy_wanderer
name: "Charging Amps"
id: charg_amps
register_type: holding
address: 0x0102
unit_of_measurement: "A"
value_type: U_WORD
accuracy_decimals: 2
icon: "mdi:battery-charging-80"
filters:
- multiply: 0.01
################################################################################
#Controller temperature
# - platform: modbus_controller
# modbus_controller_id: renogy_wanderer
# name: "Controller temperature"
# id: controller_temp
# register_type: holding
# address: 0x0103
# unit_of_measurement: "C"
# 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: 0x0120
unit_of_measurement: ""
value_type: U_WORD
#Solar Panel Volts
- platform: modbus_controller
modbus_controller_id: renogy_wanderer
name: "Solar Panel Volts"
id: panel_volts
register_type: holding
address: 0x0107
unit_of_measurement: "V"
value_type: U_WORD
accuracy_decimals: 1
icon: "mdi:solar-panel"
filters:
- multiply: 0.1
#Solar Panel Amps
- platform: modbus_controller
modbus_controller_id: renogy_wanderer
name: "Solar Panel Amps"
id: panel_amps
register_type: holding
address: 0x0108
unit_of_measurement: "A"
value_type: U_WORD
accuracy_decimals: 2
icon: "mdi:solar-panel"
filters:
- multiply: 0.01
#Solar Panel Watts
- platform: modbus_controller
modbus_controller_id: renogy_wanderer
name: "Solar Panel Watts"
id: panel_watts
register_type: holding
address: 0x0109
unit_of_measurement: "W"
value_type: U_WORD
icon: "mdi:solar-panel"
accuracy_decimals: 1
- id: charging_watt_hours_today
name: Charged Power
platform: modbus_controller
modbus_controller_id: renogy_wanderer
address: 0x0113
unit_of_measurement: WH
register_type: holding
value_type: U_WORD
accuracy_decimals: 1
skip_updates: 1200
#filters:
# - multiply: 10
#- id: days_operational
# name: "Days Operational"
# entity_category: diagnostic
# platform: modbus_controller
# modbus_controller_id: renogy_wanderer
# address: 0x0115
# unit_of_measurement: d
# register_type: holding
# value_type: U_WORD
# accuracy_decimals: 0
################################################################################
Here is a short snip of log in case anyone wants a sample of what it could look like. I've removed the wifi connection and other standard setup log output.
[09:23:13][C][modbus:143]: Modbus:
[09:23:13][C][modbus:145]: Send Wait Time: 300 ms
[09:23:13][C][modbus:146]: CRC Disabled: NO
[09:23:13][C][modbus_controller:275]: ModbusController:
[09:23:13][C][modbus_controller:276]: Address: 0xFF
[09:23:13][C][modbus_controller:278]: sensormap
[09:23:13][C][modbus_controller:282]: Sensor type=3 start=0x100 offset=0x0 count=1 size=2
[09:23:13][C][modbus_controller:282]: Sensor type=3 start=0x100 offset=0x2 count=1 size=2
[09:23:13][C][modbus_controller:282]: Sensor type=3 start=0x100 offset=0x4 count=1 size=2
[09:23:13][C][modbus_controller:282]: Sensor type=3 start=0x107 offset=0x0 count=1 size=2
[09:23:13][C][modbus_controller:282]: Sensor type=3 start=0x107 offset=0x2 count=1 size=2
[09:23:13][C][modbus_controller:287]: Range type=3 start=0x100 count=3 skip_updates=0
[09:23:13][C][modbus_controller:287]: Range type=3 start=0x107 count=3 skip_updates=0
[09:23:13][C][modbus_controller:287]: Range type=3 start=0x120 count=1 skip_updates=0
[09:23:13][C][modbus_controller.sensor:010]: modbus_controller.sensor State Class: ''
[09:23:13][C][modbus_controller.sensor:010]: modbus_controller.sensor Unit of Measurement: 'A'
[09:23:13][C][modbus_controller.sensor:010]: modbus_controller.sensor Accuracy Decimals: 2
[09:23:13][C][modbus_controller.sensor:010]: modbus_controller.sensorModbus Controller Sensor 'Charging State'
[09:23:13][C][modbus_controller.sensor:010]: modbus_controller.sensorModbus Controller Sensor 'Solar Panel Volts'
[09:23:13][C][modbus_controller.sensor:010]: modbus_controller.sensor State Class: ''
[09:23:13][C][modbus_controller.sensor:010]: modbus_controller.sensor Accuracy Decimals: 1
[09:23:13][C][modbus_controller.sensor:010]: modbus_controller.sensor Icon: 'mdi:solar-panel'
[09:23:13][C][modbus_controller.sensor:010]: modbus_controller.sensorModbus Controller Sensor 'Solar Panel Amps'
[09:23:13][C][modbus_controller.sensor:010]: modbus_controller.sensor State Class: ''
[09:23:13][C][modbus_controller.sensor:010]: modbus_controller.sensor Unit of Measurement: 'A'
[09:23:13][C][modbus_controller.sensor:010]: modbus_controller.sensorModbus Controller Sensor 'Solar Panel Watts'
[09:23:13][C][modbus_controller.sensor:010]: modbus_controller.sensor State Class: ''
[09:23:13][C][mdns:108]: mDNS:
[09:23:13][C][mdns:109]: Hostname: solarcontroller
[09:23:13][V][mdns:114]: TXT: version = 2023.5.5
[09:23:13][V][mdns:114]: TXT: mac = c049ef6be2e8
[09:23:13][C][ota:093]: Over-The-Air Updates:
[09:23:28][V][modbus_controller:158]: Updating modbus component
[09:23:28][V][modbus_controller:125]: Range : 100 Size: 3 (3) skip: 0
[09:23:28][V][modbus_controller:125]: Range : 107 Size: 3 (3) skip: 0
[09:23:28][V][modbus_controller:125]: Range : 113 Size: 1 (3) skip: 1028
[09:23:28][V][modbus_controller:125]: Range : 120 Size: 1 (3) skip: 0
[09:23:28][V][modbus_controller:036]: Sending next modbus command to device 255 register 0x100 count 3
[09:23:28][V][modbus:199]: Modbus write: FF.03.01.00.00.03.11.E9 (8)
[09:23:28][V][modbus_controller:486]: Command sent 3 0x100 3
[09:23:28][V][modbus:042]: Modbus received Byte 255 (0Xff)
[09:23:28][V][modbus:042]: Modbus received Byte 3 (0X3)
[09:23:28][V][modbus:042]: Modbus received Byte 6 (0X6)
[09:23:28][V][modbus:042]: Modbus received Byte 0 (0X0)
[09:23:28][V][modbus:042]: Modbus received Byte 100 (0X64)
[09:23:28][V][modbus:042]: Modbus received Byte 0 (0X0)
[09:23:28][V][modbus:042]: Modbus received Byte 135 (0X87)
[09:23:28][V][modbus:042]: Modbus received Byte 1 (0X1)
[09:23:28][V][modbus:042]: Modbus received Byte 234 (0Xea)
[09:23:28][V][modbus:042]: Modbus received Byte 40 (0X28)
[09:23:28][V][modbus:042]: Modbus received Byte 239 (0Xef)
[09:23:28][V][modbus_controller:055]: Modbus response queued
[09:23:28][V][component:204]: Component modbus took a long time for an operation (0.06 s).
[09:23:28][V][component:205]: Components should block for at most 20-30ms.
[09:23:28][V][modbus_controller:063]: Process modbus response for address 0x100 size: 6
[09:23:28][V][modbus_controller:098]: data for register address : 0x100 :
[09:23:28][D][modbus_controller.sensor:025]: Sensor new state: 100.00
[09:23:28][V][sensor:043]: 'Battery Capacity': Received new state 100.000000
[09:23:28][D][sensor:094]: 'Battery Capacity': Sending state 100.00000 % with 0 decimals of accuracy
[09:23:28][D][modbus_controller.sensor:025]: Sensor new state: 135.00
[09:23:28][V][sensor:043]: 'Battery Volts': Received new state 135.000000
[09:23:28][D][sensor:094]: 'Battery Volts': Sending state 13.50000 V with 1 decimals of accuracy
[09:23:28][D][modbus_controller.sensor:025]: Sensor new state: 490.00
[09:23:28][V][sensor:043]: 'Charging Amps': Received new state 490.000000
[09:23:28][D][sensor:094]: 'Charging Amps': Sending state 4.90000 A with 2 decimals of accuracy
[09:23:28][V][component:204]: Component modbus_controller took a long time for an operation (0.08 s).
[09:23:28][V][component:205]: Components should block for at most 20-30ms.
[09:23:28][V][modbus_controller:036]: Sending next modbus command to device 255 register 0x107 count 3
[09:23:28][V][modbus:199]: Modbus write: FF.03.01.07.00.03.A0.28 (8)
[09:23:28][V][modbus_controller:486]: Command sent 3 0x107 3
[09:23:28][V][modbus:042]: Modbus received Byte 255 (0Xff)
[09:23:28][V][modbus:042]: Modbus received Byte 3 (0X3)
[09:23:28][V][modbus:042]: Modbus received Byte 6 (0X6)
[09:23:28][V][modbus:042]: Modbus received Byte 0 (0X0)
[09:23:28][V][modbus:042]: Modbus received Byte 135 (0X87)
[09:23:28][V][modbus:042]: Modbus received Byte 1 (0X1)
[09:23:28][V][modbus:042]: Modbus received Byte 234 (0Xea)
[09:23:28][V][modbus:042]: Modbus received Byte 0 (0X0)
[09:23:28][V][modbus:042]: Modbus received Byte 66 (0X42)
[09:23:28][V][modbus:042]: Modbus received Byte 125 (0X7d)
[09:23:28][V][modbus:042]: Modbus received Byte 54 (0X36)
[09:23:28][V][modbus_controller:055]: Modbus response queued
[09:23:28][V][component:204]: Component modbus took a long time for an operation (0.05 s).
[09:23:28][V][component:205]: Components should block for at most 20-30ms.
[09:23:28][V][modbus_controller:063]: Process modbus response for address 0x107 size: 6
[09:23:28][V][modbus_controller:098]: data for register address : 0x107 :
[09:23:28][D][modbus_controller.sensor:025]: Sensor new state: 135.00
[09:23:28][V][sensor:043]: 'Solar Panel Volts': Received new state 135.000000
[09:23:28][D][sensor:094]: 'Solar Panel Volts': Sending state 13.50000 V with 1 decimals of accuracy
[09:23:28][D][modbus_controller.sensor:025]: Sensor new state: 490.00
[09:23:28][V][sensor:043]: 'Solar Panel Amps': Received new state 490.000000
[09:23:28][D][sensor:094]: 'Solar Panel Amps': Sending state 4.90000 A with 2 decimals of accuracy
[09:23:28][D][modbus_controller.sensor:025]: Sensor new state: 66.00
[09:23:28][V][sensor:043]: 'Solar Panel Watts': Received new state 66.000000
[09:23:28][D][sensor:094]: 'Solar Panel Watts': Sending state 66.00000 W with 1 decimals of accuracy
[09:23:28][V][component:204]: Component modbus_controller took a long time for an operation (0.09 s).
[09:23:28][V][component:205]: Components should block for at most 20-30ms.
[09:23:28][V][modbus_controller:036]: Sending next modbus command to device 255 register 0x120 count 1
[09:23:28][V][modbus:199]: Modbus write: FF.03.01.20.00.01.91.E2 (8)
[09:23:28][V][modbus_controller:486]: Command sent 3 0x120 1
[09:23:28][V][modbus:042]: Modbus received Byte 255 (0Xff)
[09:23:28][V][modbus:042]: Modbus received Byte 3 (0X3)
[09:23:28][V][modbus:042]: Modbus received Byte 2 (0X2)
[09:23:28][V][modbus:042]: Modbus received Byte 0 (0X0)
[09:23:28][V][modbus:042]: Modbus received Byte 1 (0X1)
[09:23:28][V][modbus:042]: Modbus received Byte 80 (0X50)
[09:23:28][V][modbus:042]: Modbus received Byte 80 (0X50)
[09:23:28][V][modbus_controller:055]: Modbus response queued
[09:23:28][V][modbus_controller:063]: Process modbus response for address 0x120 size: 2
[09:23:28][V][modbus_controller:098]: data for register address : 0x120 :
[09:23:28][D][modbus_controller.sensor:025]: Sensor new state: 1.00
[09:23:28][V][sensor:043]: 'Charging State': Received new state 1.000000
[09:23:28][D][sensor:094]: 'Charging State': Sending state 1.00000 with 0 decimals of accuracy
[09:23:58][V][modbus_controller:158]: Updating modbus component
[09:23:58][V][modbus_controller:125]: Range : 100 Size: 3 (3) skip: 0
[09:23:58][V][modbus_controller:125]: Range : 107 Size: 3 (3) skip: 0
[09:23:58][V][modbus_controller:125]: Range : 113 Size: 1 (3) skip: 1027
[09:23:58][V][modbus_controller:125]: Range : 120 Size: 1 (3) skip: 0
[09:23:58][V][modbus_controller:036]: Sending next modbus command to device 255 register 0x100 count 3
[09:23:58][V][modbus:199]: Modbus write: FF.03.01.00.00.03.11.E9 (8)
[09:23:58][V][modbus_controller:486]: Command sent 3 0x100 3
[09:23:58][V][modbus:042]: Modbus received Byte 255 (0Xff)
[09:23:58][V][modbus:042]: Modbus received Byte 3 (0X3)
[09:23:58][V][modbus:042]: Modbus received Byte 6 (0X6)
[09:23:58][V][modbus:042]: Modbus received Byte 0 (0X0)
[09:23:58][V][modbus:042]: Modbus received Byte 100 (0X64)
[09:23:58][V][modbus:042]: Modbus received Byte 0 (0X0)
[09:23:58][V][modbus:042]: Modbus received Byte 135 (0X87)
[09:23:58][V][modbus:042]: Modbus received Byte 1 (0X1)
[09:23:58][V][modbus:042]: Modbus received Byte 234 (0Xea)
[09:23:58][V][modbus:042]: Modbus received Byte 40 (0X28)
[09:23:58][V][modbus:042]: Modbus received Byte 239 (0Xef)
[09:23:58][V][modbus_controller:055]: Modbus response queued
[09:23:58][V][component:204]: Component modbus took a long time for an operation (0.05 s).
[09:23:58][V][component:205]: Components should block for at most 20-30ms.
[09:23:58][V][modbus_controller:063]: Process modbus response for address 0x100 size: 6
[09:23:58][V][modbus_controller:098]: data for register address : 0x100 :
[09:23:58][D][modbus_controller.sensor:025]: Sensor new state: 100.00
[09:23:58][V][sensor:043]: 'Battery Capacity': Received new state 100.000000
[09:23:58][D][sensor:094]: 'Battery Capacity': Sending state 100.00000 % with 0 decimals of accuracy
[09:23:58][D][modbus_controller.sensor:025]: Sensor new state: 135.00
[09:23:58][V][sensor:043]: 'Battery Volts': Received new state 135.000000
[09:23:58][D][sensor:094]: 'Battery Volts': Sending state 13.50000 V with 1 decimals of accuracy
[09:23:58][D][modbus_controller.sensor:025]: Sensor new state: 490.00
[09:23:58][V][sensor:043]: 'Charging Amps': Received new state 490.000000
[09:23:58][D][sensor:094]: 'Charging Amps': Sending state 4.90000 A with 2 decimals of accuracy
[09:23:58][V][component:205]: Components should block for at most 20-30ms.
[09:23:58][V][modbus_controller:036]: Sending next modbus command to device 255 register 0x107 count 3
[09:23:58][V][modbus:199]: Modbus write: FF.03.01.07.00.03.A0.28 (8)
[09:23:58][V][modbus_controller:486]: Command sent 3 0x107 3
[09:23:58][V][modbus:042]: Modbus received Byte 255 (0Xff)
[09:23:58][V][modbus:042]: Modbus received Byte 3 (0X3)
[09:23:58][V][modbus:042]: Modbus received Byte 6 (0X6)
[09:23:58][V][modbus:042]: Modbus received Byte 0 (0X0)
[09:23:58][V][modbus:042]: Modbus received Byte 135 (0X87)
[09:23:58][V][modbus:042]: Modbus received Byte 1 (0X1)
[09:23:58][V][modbus:042]: Modbus received Byte 234 (0Xea)
[09:23:58][V][modbus:042]: Modbus received Byte 0 (0X0)
[09:23:58][V][modbus:042]: Modbus received Byte 66 (0X42)
[09:23:58][V][modbus:042]: Modbus received Byte 125 (0X7d)
[09:23:58][V][modbus:042]: Modbus received Byte 54 (0X36)
[09:23:58][V][modbus_controller:055]: Modbus response queued
[09:23:58][V][component:204]: Component modbus took a long time for an operation (0.06 s).
[09:23:58][V][component:205]: Components should block for at most 20-30ms.
[09:23:58][V][modbus_controller:063]: Process modbus response for address 0x107 size: 6
[09:23:58][V][modbus_controller:098]: data for register address : 0x107 :
[09:23:58][D][modbus_controller.sensor:025]: Sensor new state: 135.00
[09:23:58][V][sensor:043]: 'Solar Panel Volts': Received new state 135.000000
[09:23:58][D][sensor:094]: 'Solar Panel Volts': Sending state 13.50000 V with 1 decimals of accuracy
[09:23:58][D][modbus_controller.sensor:025]: Sensor new state: 490.00
[09:23:58][V][sensor:043]: 'Solar Panel Amps': Received new state 490.000000
[09:23:58][D][sensor:094]: 'Solar Panel Amps': Sending state 4.90000 A with 2 decimals of accuracy
[09:23:58][D][modbus_controller.sensor:025]: Sensor new state: 66.00
[09:23:58][V][sensor:043]: 'Solar Panel Watts': Received new state 66.000000
[09:23:58][D][sensor:094]: 'Solar Panel Watts': Sending state 66.00000 W with 1 decimals of accuracy
[09:23:58][V][component:204]: Component modbus_controller took a long time for an operation (0.08 s).
[09:23:58][V][component:205]: Components should block for at most 20-30ms.
[09:23:58][V][modbus_controller:036]: Sending next modbus command to device 255 register 0x120 count 1
[09:23:58][V][modbus:199]: Modbus write: FF.03.01.20.00.01.91.E2 (8)
[09:23:58][V][modbus_controller:486]: Command sent 3 0x120 1
[09:23:58][V][modbus:042]: Modbus received Byte 255 (0Xff)
[09:23:58][V][modbus:042]: Modbus received Byte 3 (0X3)
[09:23:58][V][modbus:042]: Modbus received Byte 2 (0X2)
[09:23:58][V][modbus:042]: Modbus received Byte 0 (0X0)
[09:23:58][V][modbus:042]: Modbus received Byte 1 (0X1)
[09:23:58][V][modbus:042]: Modbus received Byte 80 (0X50)
[09:23:58][V][modbus:042]: Modbus received Byte 80 (0X50)
[09:23:58][V][modbus_controller:055]: Modbus response queued
[09:23:58][V][modbus_controller:063]: Process modbus response for address 0x120 size: 2
[09:23:58][V][modbus_controller:098]: data for register address : 0x120 :
[09:23:58][D][modbus_controller.sensor:025]: Sensor new state: 1.00
[09:23:58][V][sensor:043]: 'Charging State': Received new state 1.000000
[09:23:58][D][sensor:094]: 'Charging State': Sending state 1.00000 with 0 decimals of accuracy
I have this running with a Renogy Wanderer 10 amp solar charge controller in addition to the 30 amp model. No mods from above for the 10 amp charge controller
I'm trying to recreate this to connect to Home Assistant, I know nothing about modbus.
I have this Max3232 breakout board https://www.amazon.com/dp/B09BCKWL8V and ESP32
I have swapped TX and RX on both the max3232 and esp32 i have tried a different max3232
Does the log or yaml give a clue as to what I'm screwing up? Is it even connecting?
Thank you
i left the sensors out
verbose log: