Using modbus tcp to collect data from an ABB UNO-DM solar inverter

I have recently had solar panels installed with an ABB UNO-DM inverter an am having trouble getting the modbus sensors to appear in HA.
I have proven that I can read the modbus info by connecting to the inverter via ‘modpoll’ on a separate raspberry pi and seeing the values update, although they are in hex. I can see the values by typing the following into the command line.

modpoll -m tcp -t4:hex -r 40088 -c 1 -0 10.1.1.175

I have added the following to my configuration.yaml but cannot see any new sensors appearing in the ‘states’ page in HA.

modbus:
  type: tcp
  host: 10.1.1.175
  port: 502

sensor:
  - platform: modbus
    scan_interval: 10
    registers:
    - name: InverterPower
      slave: 1
      register: 40088
      register_type: holding
      unit_of_measurement: kW
      count: 1
      scale: 1
      offset: 0
      precision: 1
      data_type: int 

Thanks in advance for any help or advice.

Try turning on logging in your configuration.yaml:

logger:
  default: info
  logs:
    homeassistant.components.device_tracker: critical
    homeassistant.components.camera: critical

It seems that you have an error in your sensor definition, and when there is an error, the sensor does not appear. Logging helps you to figure out what is going on.
After adding it, you can see the logs clicking at Info icon under Developer tools.

Don’t know if it helps, but i had to decrease the register number to get values from my system.

Thanks for your reply.
It was showing up as an error as you said. The interesting thing is that I got it working not by changing any of the sensor settings but by upgrading from 0.83.2 to 0.83.3.
All working as expected now.
Thanks for your help.

I have also noticed that HA does not restart when i click the restart button.
It says a restart has been called, and then nothing happens.
Perhaps this is why the sensor only showed up after upgrading.
I will have to look into this further.

Hi there,

were you able at the end to collect data from your ABB UNO-DM inverter?

Yes. It took a bit to work out the registers.

@richcarnell Any chance you could share your configuration/setup?

I’m running a PowerOne Uno 3.6

Thanks in advance!

Hi janser01,
my config.yaml looks like this,

modbus:
  type: tcp
  host: 10.1.1.175
  port: 502

and my sensor.yaml …

  - platform: modbus
    scan_interval: 10
    registers:
    - name: Inverter_Power
      slave: 1
      register: 40084
      register_type: holding
      unit_of_measurement: W
      count: 1
      scale: 10
      offset: 0
      precision: 0
      data_type: int  
      
    - name: Inverter_String1_DC_Power
      slave: 1
      register: 41125
      register_type: holding
      unit_of_measurement: W
      count: 1
      scale: 10
      offset: 0
      precision: 0
      data_type: int 

    - name: Inverter_String2_DC_Power
      slave: 1
      register: 41145
      register_type: holding
      unit_of_measurement: W
      count: 1
      scale: 10
      offset: 0
      precision: 0
      data_type: int    
      
    - name: Inverter_Power_Total
      slave: 1
      register: 40194
      register_type: holding
      unit_of_measurement: Wh
      count: 1
      scale: 1
      offset: 0
      precision: 0
      data_type: uint
      
  - platform: template
    sensors:
      inverter_power_incl_0:
        friendly_name: 'Inverter Power including 0'
        value_template: "{{ states.sensor.inverter_power.state | replace('unavailable','0') }}"

The last one is a template sensor that won’t show unknown when the sun goes down, hope this works for you.

Rich

Hi Rich,
Do you know if there is a modbus register for: “Today Energy”?
Thanks in advance!

Hi @DendoD96,
I just use the utility meter,

@richcarnell - Thanks for your reply!

How did you setup Modbus on your Pi?

I’ve got an NUC running ubuntu that I could use.

Thanks once again!

Hi @janser01,
the only setup required is as above, add the modbus entry into your config.yaml and then the sensors in the sensors.yaml if you have one, otherwise, under sensors in you config.yaml.
Make sure you have enabled modbus in your inverter (check the IP and port), and if it’s like mine, you won’t be able do anything with it at night as it shuts down.
If you have the same inverter as me these registers should work.
Let me know if this still doesn’t work and I will try to find the software that I used to read the registers. I set this up a couple of years ago.

Thank you for your quick answer!

But I’m afraid it won’t work for me as my inverter Power-One Aurora PVI-3.6-OUTD only has a RS485 connection and no IP address…

Hi @janser01,
If your inverter doesn’t have wifi you might need something like this,
https://www.moxa.com/en/products/industrial-edge-connectivity/serial-device-servers/wireless-device-servers/nport-w2150a-w2250a-series

@richcarnell - Yes I’ve been loking at them in the past. But since I have an intel nuc with Ubuntu running next to my inverter and I have a RS485 -> USB cable I’m looking for a software solution. I’m putting now my hopes on the socat comand or ser2net https://sourceforge.net/projects/ser2net/

@janser01 - I’m not sure that I have used either of those. When setting mine up I used modpoll.
https://www.modbusdriver.com/modpoll.html
Perhaps you could use this as a stepping stone toward your solution?

Thanks! I’ll keep that one in mind if my current route fails.

I managed to get 123Solar logger (https://123solar.org) up and running and it’s giving me all the data including the fancy graphics. I also read a few days ago that it would be able to extract data from 123Solar to Home assistant. The benefit is that, if this all works, I’ll have all the detailed information in 123Solar and the high level data in Home Assistant.

The story continues…

And it’s working!

Once you have installed 123Solar the steps are very easy!

Just make a http json query call to your 123Solar installation and you’re done.

http://xxx.xxx.xxx.xxx:port/123solar/programs/programlive.php?invtnum=1

where 1 is the inverter numberin 123Solar

It comes back with the following values:

SDTE 1590336173000
I1V 226
I1A 1.2
I1P 264.7
I2V 228.8
I2A 1.1
I2P 247.6
I3V 0
I3A 0
I3P 0
I4V 0
I4A 0
I4P 0
G1V 226.5
G1A 2.2
G1P 482.7
G2V 0
G2A 0
G2P 0
G3V 0
G3A 0
G3P 0
FRQ 50.1
EFF 94.2
INVT 38.3
BOOT 37.4
SSR 0
KWHT 17505.435
PMAXOTD 2431
PMAXOTDTIME “13:38”
timestamp “24/05/2020 18:02:58”
riso 0
ileak 0
awdate “17:59”

I = strings
G = Grid side
The numbers are self explanatory.

Then simply make a REST call from Home Assistant:

sensor:
  - platform: rest
    resource: http://10.0.2.170:81/123solar/programs/programlive.php?invtnum=1
    name: Solar Power 
    value_template: '{{ value_json.G1P }}'

  - platform: rest
    resource: http://10.0.2.170:81/123solar/programs/programlive.php?invtnum=1
    name: Solar Voltage
    value_template: '{{ value_json.G1V }}'
 
  - platform: rest
    resource: http://10.0.2.170:81/123solar/programs/programlive.php?invtnum=1
    name: Solar Amp
    value_template: '{{ value_json.G1A }}'

  - platform: rest
    resource: http://10.0.2.170:81/123solar/programs/programlive.php?invtnum=1
    name: Solar Max Output
    value_template: '{{ value_json.PMAXOTD }}' 
    
  - platform: rest
    resource: http://10.0.2.170:81/123solar/programs/programlive.php?invtnum=1
    name: Solar Kwh Total
    value_template: '{{ value_json.KWHT }}' 
    
  - platform: rest
    resource: http://10.0.2.170:81/123solar/programs/programlive.php?invtnum=1
    name: Solar Power String 1
    value_template: '{{ value_json.I1P }}'

  - platform: rest
    resource: http://10.0.2.170:81/123solar/programs/programlive.php?invtnum=1
    name: Solar Voltage String 1
    value_template: '{{ value_json.I1V }}'
 
  - platform: rest
    resource: http://10.0.2.170:81/123solar/programs/programlive.php?invtnum=1
    name: Solar Amp String 1
    value_template: '{{ value_json.I1A }}'
    
  - platform: rest
    resource: http://10.0.2.170:81/123solar/programs/programlive.php?invtnum=1
    name: Solar Power String 2
    value_template: '{{ value_json.I2P }}'

  - platform: rest
    resource: http://10.0.2.170:81/123solar/programs/programlive.php?invtnum=1
    name: Solar Voltage String 2
    value_template: '{{ value_json.I2V }}'
 
  - platform: rest
    resource: http://10.0.2.170:81/123solar/programs/programlive.php?invtnum=1
    name: Solar Amp String 2
    value_template: '{{ value_json.I2A }}'
1 Like

@janser01,
Nice one!
Good to see that you got it working!