Custom Component: ABB/Power-One/FIMER PV Inverters - SunSpec Modbus TCP

As you can see, there is a problem communicating with the VSN300/inverter. Reads are failing. Are you using other integrations/apps accessing the VSN300 maybe? You need to use only one.

Usually means that from what we observed here in this thread, many have Slave ID 247 others have 2. It depends on the configuration of the inverter that the installer made.

Im using no other app or integration comunicating with the tcp port.
Itā€™s Strange that it always works when I reload the Integration but only once.

I also tested it an an HA virtual machine. Same error.

The integration does its first read correctly, and on the second it fails to communicate with the VSN300. Itā€™s clear from the logs. Is the wifi connection of the VSN300 stable? I donā€™t know how to help if the modbus component canā€™t connect to the VSN300, itā€™s a blocking issue that you have to debug locally. The integration has been tested for a long time and it doesnā€™t have major issues like this.

And donā€™t go lower than 30s for the polling period, keep in mind that the VSN300 polls the inverter in 60s cycles, so you wonā€™t improve anything going lower.

@monkeypr00f Federico, I introduced basic authentication for the VSN700 in my vsn monitor python program. Can you please test it for me and report the output? I suspect the JSON response structure is different among VSN300 & VSN700, but I need to have the full output to compare the two structures.

Please download the files and configure the .cfg by specifying the hostname, the vsn model, and user/pw before running it. The model in the cfg is needed so the program uses basic auth for it, if VSN300 is configured X-Digest auth scheme is used.

If this works for the VSN700, I just need to parse the JSON structure and I can modify the custom component to drop modbus and use REST/JSON to get data from the inverter. I hope the structures of the two are not so different.

Repo is here: GitHub - alexdelprete/vsnx00-monitor: Gets data from ABB VSN300 logger

HI Alex, iā€™ve recently added ABB integration and is awesom. Thanks a lot for your great job!

Iā€™ve just created the binary sensor and the automation but in your example you say ā€œfor ther reloard (needed after re-enabling it) you need to choose one of the sensors of the integrationā€ but the yaml code show a device

          - service: homeassistant.reload_config_entry
            data: {}
            target:
              device_id: ab0bea32218dfd580d560e46fc85c722

I tryed with both but the automation doesnā€™t reload ABB integration and i donā€™t know why because it look like running perfectly.

Works fine here. You can reload the device_id or entity_id.

This is with the device:

service: homeassistant.reload_config_entry
data: {}
target:
  device_id: ab0bea32218dfd580d560e46fc85c722

But it works also like this:

service: homeassistant.reload_config_entry
data: {}
target:
  entity_id: sensor.abb_vsn300_ac_current

Are you using the ping sensor and the spook integration to disable and enable?

Yes, binary sensor is working.

The automation doesnā€™t reload the integration but if I manually run each action everything is running good.

Itā€™s look like a ā€œtimeā€ question and i try to add a ā€œtime to waitā€ between enable_config and reload_config

Iā€™ve an ABB inverter UNO-DM-1.2-TL-PLUS

I donā€™t have any delays between enable and reload. Did you debug the automation with the Trace function? you can check step by step what it did.

This is complete code of my automation, and it works perfectly for me:

alias: State of ABB Custom Component
description: >-
  Ensure ABB Component is running in the morning and disable it at sunset to
  avoid filling log with errors
trigger:
  - platform: state
    id: trigger_abb_vsn300_connected
    entity_id:
      - binary_sensor.abb_vsn300_status
    from: "off"
    to: "on"
    for:
      hours: 0
      minutes: 0
      seconds: 20
  - platform: state
    id: trigger_abb_vsn300_disconnected
    entity_id:
      - binary_sensor.abb_vsn300_status
    from: "on"
    to: "off"
    for:
      hours: 0
      minutes: 0
      seconds: 20
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id: trigger_abb_vsn300_connected
        sequence:
          - service: homeassistant.enable_config_entry
            data:
              config_entry_id: d9fed023c0adc821d997b03bf7a70c95
          - service: homeassistant.reload_config_entry
            data: {}
            target:
              device_id: ab0bea32218dfd580d560e46fc85c722
      - conditions:
          - condition: trigger
            id: trigger_abb_vsn300_disconnected
        sequence:
          - service: homeassistant.disable_config_entry
            data:
              config_entry_id: d9fed023c0adc821d997b03bf7a70c95
mode: single

Found the issue.

My inverter take more or less 20 minutes to wake up and do test, measures and other steps.

Binary sensor connection has began this morning at 06:12 and the operating state switched to ā€œRunā€ at 06:32 (today is definetely cloudy)

I changed the the first trigger (from disconnected to connected) increasing the waiting time

I have an ABB UNO DM 1.2 TL PLUS inverter

- platform: state
    id: ABB UNO-DM-1.2-TL-PLUS_connected
    entity_id:
      - binary_sensor.abb_uno_dm_1_2_tl_plus_status
    from: "off"
    to: "on"
    for:
      hours: 0
      minutes: 2
      seconds: 0

@alexdelprete

Iā€™m sorry to ask that question here but I think you have nice personal contact at Fimer and that might help sort my problem out. Iā€™ve read all readmes and all this huge chain. I see that my ABB TRIO-8.5-TL-OUTD-S with Ethernet expansion board 3N280000000A which I asked to install instead of VSN300 (facepalm but no Wifi there 4 years back) canā€™t use your component. I see on inverter web page that Modbus with port 502 is there but I canā€™t properly connect to it using tools mentioned above. One random time connection worked but I couldnā€™t read anything useful and playing with various parameters ruined that success.

Maybe you know whether there is anything useful coming from Proprietary Modbus? Maybe you could share your contacts with me?

Many thanks for your great work.

If you have Modbus TCP available on the IP address of the ethernet card, the component should work, since Iā€™m using direct register maps that your card should address correctly.

In order for it to work, you need to find the inverter iD (Slave ID), the IP, and then you need to play with the starting address, should be 40000, but for VSN300/VSN700 itā€™s 0.

So make sure to get those parameters first. Then use qModMaster with those parameters to read some data and see if itā€™s working.

Thanks for your kind words and let me knowā€¦

1 Like

@alexdelprete

Iā€™ve managed to connect :slight_smile:. EDIT: it seems it reads something :smiley:

Does it mean your component going to work? :slight_smile:

The main problem now that my HA canā€™t connect to it

ERROR (MainThread) [pymodbus.logging] Connection to (192.168.x.x, 502) failed: timed out

Iā€™m running HAOS as VM in my TrueNAS Core. Everything in the same local network. And I disconnect from QModMaster to remove that connection concurrency.

Yes, but letā€™s check how you configured the component first: what did you use as Base Adress, 40000 like in the following screenshot or zero? Make sure you can ping the IP address from the VM.

config

In qModMaster, go to settings, you should see this:

image

Thatā€™s the base address. You need to use the same value in the component configuration.

@Brunas in qModMaster read from register 0 (start address 0) for 124 registers (number of registers), like in this screenshot:

If you have the value 103 at address 70 (check the red rectangle I highlighted), then the component should work.

Iā€™ve set 2 as slave ID and 0 as base address since I was thinking itā€™s the same as start address in QModMaster. I can nmap to that IP and port from HA Advanced SSH terminal without issues.

But that is not important now after Iā€™ve done what you wrote. Base addr to 0 and getting 124 from start address 0. Itā€™s not working :frowning:

Strangely I canā€™t set that base address to 40000. App doesnā€™t allow. When i do that in INI file, base address shows 1 and start address becomes 40000. In general I canā€™t retrieve any holding registers 0x03.

EDIT. With base address set to 0 working read input registers 0x04 returns 367 values. Other functions return nothing only error about illegal data address. Maybe that data is somewhere later but probably only Fimer could tell for sure :slight_smile:

Too many strange things happening. :slight_smile:

QModMaster: you MUST be able to configure the Base Address in the settings. What version of qModMaster are you using? If that setting is wrong, you canā€™t read anything. So you need to be sure that setting is correct.

image

Could you also show me the settings window please? Also, run QModMaster as admin.

One other thing: you can ask FIMER for the excel file of the register map. I have that for some inverters, but not for your model. In that file we should also see the Base Address, that should be 40000, Iā€™m quite sure.

Thanks for your reply.
QModMaster version is the same as in your screenshot and I run everything from my command line console which always is running in Admin mode. In those settings I canā€™t event write any other number except 0 or 1 in that base address field. Iā€™m sure my keyboard works OK since I can write any number in response timeout field above.
Will try playing with source of that tool and fix something myself or open Linux VM and compile that there.
Regarding Fimer do you have their normal email address or should I spend some time and fill that stupid form with all details irrelevant to the matter? Iā€™m sure I will struggle with local installer company or that would take too much time and effort.

Downloaded code and looked into it. Itā€™s clearly not possible to enter more than 1 to that base address field:

EDIT: Also, from code base address is not used directly in modbus operations. Start address is the main thing.

Anyway Iā€™ve tried that already without luck. Will contact Fimerā€¦

You are right, that setting is only for zero-based addressing, so the only values are 0 or 1. Sorry about that.

So, put 40000 in the Start Address and in Number of Registers put 100, then start the read cycle. The only thing we have to find, is from what address your register map starts. Usually for Power-One/ABB/FIMER inverters itā€™s 40000.

image