I am trying to configure ModBus to read some values from my SMA Sunny Boy inverter it is not working. when I look into the Logs I get this error. Apparently the modbus platform setup is not working. I am running HomeAssistant 2021.1.5 on a RPI 4B.
If I use a modbus simulator I can read the registers of the inverter. So I think the problem is with Home Assistant and not the inverter. Anyone have a hint on this?
It is working now. For the benefit of others what I had to do was to setup a name in the modbus area and then use that name as the hub for each sensor in the registers section.
See example below:
modbus:
name: SB7700TL
type: tcp
host: 192.168.XXX.XXX # IP Address for SMA Inverter
port: 502 # TCP Port from Sunny Explorer
sensor:
- platform: modbus
scan_interval: 10 # Time in seconds for getting values
registers:
- name: sb_daily_pwr
hub: SB7700TL
unit_of_measurement: kWh
slave: 3
register_type: holding
register: 30535
scale: 0.001
precision: 3
count: 2
data_type: uint
- platform: template
sensors:
modbus_sb_daily_pwr:
friendly_name: 'Day Yield'
value_template: >-
{{ states('sensor.sb_daily_pwr') }}
unit_of_measurement: "KWh"
icon_template: mdi:flash-circle