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

causes could be many: wrong ip, port, baud rate and other serial settings, etc. you have to exclude everything, one step at a time. first check if the serial gw is working properly (I can’t help with that, every gw is different), if you’re sure it’s working, then connect to port 502 of the gw with a terminal or telnet and check that something is coming out.

you also need to make sure the Modbus Slave address of the inverter is correct.

once you are sure about what’s working and what is not working I can help you, right now you still have work to do on your side.

GW works. Unfortunately, I have no response from the Inverter. I can’t see where I can set the data on the inverter. Somewhere I found 19200.8 bit, 1 stop, parity none. I set in settings-> address: 2 - is it a slave number?

Currently, I cannot track the data with the modbus scanner, so I am not connected

Address: 2 is the slave modbus address. So first of all you must be sure the inverter has that address. Then you must make sure that serial port config. is correct: check on the inverter manuals the speed, parity settings, etc.

Once something comes out of the GW, then we can discuss about the integration. :slight_smile:

Every time when I restart HA and my inverted is ‘sleeping’, I have to reload the SunSpec integration manually. After the reload the data of the inverter is visible.
Is there a reason why I have to reload SunSpec after a reboot of HA? This is only needed when the inverter at that moment was in sleep modes.

If your inverter is “sleeping”/powered off, when you reload it manually, how can you see data?

The problem is that when the inverter turns off during the evening, the integration keeps trying to poll the device, but after a while HA puts it in unavailable state because the device polled is not available anymore.

You can solve this problem like I do: since I know more or less the time the sun rises, so I know when the inverter turns back on, I simply created an automation that starts at a certain time (a little before the inverter turns on) and every 5m checks if one of the sensors of the integration is unavailable, if so, it “reloads” the integration (that’s what you do manually. If the sensor checked is still unavailable, it keeps trying every 5m, until the sensor is available (when the inverter turns on).

This is the code of the automation, adapt the timings (mine starts at 7am) and the entity name (the sensor.abb_* entity) to your case:

alias: Keep ABB integration running
description: Check if ABB integration is unavailable
trigger:
  - platform: time_pattern
    minutes: /5
    hours: "7"
condition:
  - condition: state
    entity_id: sensor.abb_vsn300_vendor_operating_state
    state: unavailable
    for:
      hours: 0
      minutes: 1
      seconds: 0
action:
  - service: homeassistant.reload_config_entry
    data: {}
    target:
      entity_id: sensor.abb_vsn300_vendor_operating_state
mode: single

Hi Alex,

Thanks for the tip.
What I meant was. When the inverter is offline is see this on my dashboard in HA. I can’t see the data.

As you can see the inverter is sleeping.
I just installed an update of Home Assistant 2022.9.7. After this installation HA reboots.
That means that I have to manual reload SunSpec tomorrow morning.

What I do not understand is that the inverter is going to sleep mode every day and the SunSpec app starts up. But when HA reboots when the intverter is in sleep mode, why is the SunSpec app not able to start up when the inverters start?

But I will test the automation you provided to solve this issue.: :slight_smile:

When the inverter is unavailable, the integration can’t retrieve data, and after a while HA puts the integration in unavailable mode.

In order to automatically reload the integration, use the code I provided to create an automation that reloads it at the right time, when you know the inverter will be back online to provide data.

Trust me, it works. I use it since more than 1y. :slight_smile:

I understand what you’re saying but 1 thing is still not clear to me.

When I do not reboot HA, why does SunSpec start without any issue every morning?

When I reboot HA in the evening when my inverter is in sleep mode, SunSpec does not start when my inverter is comes online in the morning.

How can a reboot makes the difference in behavior of SunSpec because in both situations the inverter was in Sleep mode and no data was retrieved.

Because when it starts up, it doesn’t find the inverter, and after X retries the integration is put in an unavailable state by HA.

That is not my experience: when my inverter turns off, after a while, the integration goes in unavailable state, that is why I made the automation to reload it every morning.

Hey Alex,

First of all I’m a total beginner with HA, but starting to get familiar with it.
I’m trying to get my PV Inverter with VSN300 wifi card operational within HA.

I tested and Telnet on 502 is allowed and functional, firmware etc is on the latest level and modbus is enabled in the web interface.

I’ve tried multiple settings and combinations of values, what seems to give the least errors is if I enter:

This then throws the following error:

Logger: homeassistant.components.sensor
Source: custom_components/abb_powerone_pvi_sunspec/__init__.py:413
Integration: Sensor ([documentation](https://www.home-assistant.io/integrations/sensor), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+sensor%22))
First occurred: 01:03:59 (1 occurrences)
Last logged: 01:03:59

Error while setting up abb_powerone_pvi_sunspec platform for sensor

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 281, in _async_setup_platform await asyncio.shield(task) File "/config/custom_components/abb_powerone_pvi_sunspec/sensor.py", line 21, in async_setup_entry hub.read_modbus_data_realtime() File "/config/custom_components/abb_powerone_pvi_sunspec/__init__.py", line 413, in read_modbus_data_realtime self.data["statusvendor"] = DEVICE_GLOBAL_STATUS[statusvendor] KeyError: 116

If i go with any other values as far as slave ID etc goes it always comes back to a comm_ error.

Haven’t seen anyone else with a similar issue so I figured maybe you have any clue.

Thanks in advance.

Hi Nas. You’ll never make it work that way. When you need to integrate something, you need to be sure of the configuration parameters.

So, you need to be sure about the IP of the inverter, the port, the inverter slave address and the register map base address.

What inverter model do you use? What are you using to interface the inverter, an ABB VS300 or a generic rs485 gateway?

Provide some info so I can guide you a little bit…:slight_smile:

Hey,

I’m 100% sure about the IP + Port, I used a tool to check if the Wifi logger card is responding on port 502 (checked with telnet).

I’m using a ABB VSN300 Wifi Logger card on a TRIO-7.5-OUTD inverter.
|FW Version|1.9.2|
|FW Build Number|r1364-5b9c418|

I am unsure about how to obtain the Slave Adress and the Register Map Base, how would I verify/obtain this information?

It’s in the first post and in the instructions on the repository:

For VSN300, the base address should be 0. Regarding the slave id, you should be able to check on the inverter if it has an LCD display. I don’t know if the slave id/unit id is also available on the VSN300 webserver. Did you check there also?

If you can confirm these values are correct, then the problem might be that the response to the statusvendor is not one of these below, and I need to add it, but I need to see the value first. Did you do a fw upgrade? If so, what is the date of the fw, if available?

Download qModMaster, so you can check if you can communicate with the inverter through the VSN300, then when it’s working, we’ll read some values: QModMaster - Browse Files at SourceForge.net

statusvendor codes:

DEVICE_GLOBAL_STATUS = {
    0: "Sending Parameters",
    1: "Wait Sun/Grid",
    2: "Checking Grid",
    3: "Measuring Riso",
    4: "DcDc Start",
    5: "Inverter Start",
    6: "Run",
    7: "Recovery",
    8: "Pause",
    9: "Ground Fault",
    10: "OTH Fault",
    11: "Address Setting",
    12: "Self Test",
    13: "Self Test Fail",
    14: "Sensor Test + Measure Riso",
    15: "Leak Fault",
    16: "Waiting for manual reset",
    17: "Internal Error E026",
    18: "Internal Error E027",
    19: "Internal Error E028",
    20: "Internal Error E029",
    21: "Internal Error E030",
    22: "Sending Wind Table",
    23: "Failed Sending table",
    24: "UTH Fault",
    25: "Remote OFF",
    26: "Interlock Fail",
    27: "Executing Autotest",
    30: "Waiting Sun",
    31: "Temperature Fault",
    32: "Fan Staucked",
    33: "Int. Com. Fault",
    34: "Slave Insertion",
    35: "DC Switch Open",
    36: "TRAS Switch Open",
    37: "MASTER Exclusion",
    38: "Auto Exclusion",
    98: "Erasing Internal EEprom",
    99: "Erasing External EEprom",
    100: "Counting EEprom",
    101: "Freeze",
    200: "Dsp Programming",
}

Hey Alex,

The firmware versions as listed in the web interface:
Logger Info

Board model WIFI LOGGER CARD
MAC Address 40:BD:32:64:7B:DB
Serial Number xxxxx-xxxxx-xxxxx
FW Version 1.9.2
FW Build Number r1364-5b9c418

Inverter Info

Inverter model TRIO-7.5-OUTD (output 400 VAC)
Serial number xxxx-xxx-xxx

Supervisor info

FW Version CAA8

DSP Booster info

DSP Inverter info

External Flash info

FW Version R214

Display Board info

FW Version D206

I did try some fiddling around with a modbus scanner to see if I could get some readings, and I got some readings with the following settings:

IP/Port: 192.168.178.141:502
Device SlaveID: 247

Perhaps you can interpret this information because I honestly don’t know what to look for:

So it seems there is some communication with the module, however with these settings however the HA still gives me an error.

Good, so you know that the inverter slave ID is correct.

Now, from the screenshot of the modbus tool you used, I see the addresses starting at 40000, not 0.

Try to set 40000 as base address when you configure the integration. So all parameters you used before, but 40000 instead of 0.

Also: show me the addresses from 40100, I need to check 40108 and 40109 specifically. I’m suspecting that your inverter doesn’t support vendorstate at address 40109.

Let me know…

I changed the offset so it shows values starting from 40100, I suppose this is what you meant?

do me a favor: I see that at address 40071 you have the value 103 that means “3-phase inverter”, but it should be at 40070. I suspect the tool you’re using has an option to use zero-based address offsets, can you check? Show me the options in case you don’t find it.

Are you on Discord? Maybe we can solve this more quickly in a chat…

Srednas#4439 on disc

v2.0.2 released. Fixes the issue reported by @Sred.

Enjoy. :slight_smile:

Hello
Could you help me? After a fresh install I get this error.
I have a VSN300 logger and can read it with qModMaster

2022-10-04 20:38:44.717 ERROR (MainThread) [custom_components.abb_powerone_pvi_sunspec] Reading data failed! Inverter is unreachable on ID=247
2022-10-04 20:38:44.726 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up abb_powerone_pvi_sunspec platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 281, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/abb_powerone_pvi_sunspec/sensor.py", line 31, in async_setup_entry
    if hub.data["invtype"] == INVERTER_TYPE[101]:
KeyError: 'invtype'

Could you help me where the error could be?