Sunspec Kostal Integration Test (issues, experience, data interpretation...)

Hello Nymea Community,

thank you for the fast support regarding the new SunSpec protocoll.
As I have a working system with an Kostal Plenticore Solar Inverter and Kostal SME (Central smart energy meter to measure the overall house consumption and feed in to the grid)
I tested the new nymea-sunspec-plugin. The SME is connected to the Inverter, so the Inverter has also the values from the SME in the webserver overview.

I wanted to share my experience, and I checked the values between the nymea App and the Kostal Plenticore Webserver values.

  1. ā€œGesamter Energieverbrauchā€ must be ā€œGesamte erzeugte Energieā€?
    The Value of 914 kWh is not the consumption of the solar inverter.
    Its instead the generated solar power.

  2. What are the orange and green gauge in the picture where the overall kwh Energy is displayed?

  3. Home Energie Consumption and Grid feed in from SME is missing in the nymea overview.

  4. In the menu two Inverters are listed, but only one inverter is mounted and connected. The first gives right values. The ā€œsecond inverterā€ gives strange values which makes no sense.

Thank you in advance for your support.

Here is the screenhot of the non existing second solar inverter with the strange valuesā€¦

And here is the overview - one solar inverter is existing, but two are listed, one working the other with strange values.

Hey @EGuru

thanks for the feedback. Sounds like there might be some bugs in the plugin. Weā€™ll look into this and come back to you.

Hello @EGuru,

Iā€™m currently doing a whole wokrover on the sunspec part, and I found the issue why you have this ghost inverter hanging around in your system. Iā€™ll ping you here once the fix should be online, probably within the next few days! Thanks for reporting the issue.

FYI: the issue is, the some sunspec devices provide the information on register 40000 and mirrored on 50000, and nymea performs always a scan on all possible register sections while discovering sunspec devices, and the mirrored situation was not handled so far, but soon :slight_smile:

Hello Simon,

thanks for your update :slight_smile:

Ok, lets keep in touch and I will retest the new release soon

1 Like

Hi @EGuru ,

finally we have now something to test and the overall experience should be much better now :slight_smile:

So I did a huge rework of the entire SunSpec infrastructure, library and plugin, and we support now theoretically any module which is SunSpec compliant. Maybe not initially detected as well known nymea thing, but adding new things based on any SunSpec model is very easy now, and the plugin provides all information we need to know to implement and add unsupported models.

The new plugin makes use of the new network detector mechanism which has been released with the last 0.28.0 version of nymea. Since you seem to have a Kostal inverter, it would be great if you could share a screenshot from the detected network devices when you add the SunSpec connection, and which one you pick (or only that).

Once I know how Kostal Inverters present them self in the network (Mac address registration or hostname), I can add the Kostal vendor during setup and show only the Kostal devices in the discovery, which should create a better user experience.

It would be very helpfull for me if you could test the new plugin and provide me the information how the Kostal presents it self in the network and if your initial issue has been fixed. There should show up only one inverter now.

You can test those things by switching to the current experiemntal repository on your system.

  1. Add the experimental repository (example for the Raspberry Pi, if you have an other platform please let me know)

    nano /etc/apt/sources.list.d/nymea.list
    
     ## nymea repo
     deb http://repository.nymea.io/ buster rpi non-free
     deb http://ci-repo.nymea.io/experimental-silo/ buster rpi non-free
    
  2. Update your system

     sudo apt update
     sudo apt upgrade
    
  3. Restart your nymea daemon: sudo systemctl restart nymead

  4. Remove the current SunSpec connection thing with the app

  5. Re-add the SunSpec connection (make a screenshot from the detected network device you gonna pick for connecting) and your inverter should show up in nymea

Happy testing and thanks for giving feedback :slight_smile:

Hi @simon.stuerz ,

thanks a lot for your work and effort.
Unfortunatelly after the update, the nymead service is not restarting.

I tried to reboot the raspberry pi, but the service is not starting.

A restart of the service is running only a few seconds, then the service crashes.

Do you have an idea?

Current OS installed is Raspbian 10 buster

Thanks in advance

Seems youā€™re still running nymea 0.26. Upgrade the system, then it should work.

Thank you @mzanetti - your hint was right!

The following command was missing, and nymea was updated and is now running.

sudo apt-get install nymea nymea-plugins

@simon.stuerz
Iā€™am struggling a bit with the Setupā€¦it finds the device with IP Adress and Name ā€œTexas Instrumentsā€.
When I choose it and set the correct Port 1502 and ID 71 the following log file is generated, the last step failedā€¦

W | Platform: Platform plugin does not implement deviceSerialNumber and DEVICE_SERIAL is not set. Cannot determine device serial number.

I | SunSpec: Discovery finished. Found 16 devices
I | SunSpec: NetworkDeviceInfo(ā€œ192.168.2.108ā€, ā€œ68:47:49:ef:81:f6ā€ (ā€œTexas Instrumentsā€) , ā€œeth0ā€)

I | SunSpec: Setup thing ā€œ192.168.2.108ā€

I | SunSpec: Creating connection for ā€œ192.168.2.108:1502](192.168.2.108:1502)ā€

I | SunSpec: Connecting SunSpecConnection(192.168.2.108:1502](192.168.2.108:1502), Slave ID: 71) ā€¦

I | SunSpec: SunSpecConnection(192.168.2.108:1502](192.168.2.108:1502), Slave ID: 71) connected

I | SunSpec: Starting SunSpec discovery on SunSpecConnection(192.168.2.108:1502](192.168.2.108:1502), Slave ID: 71)

I | SunSpec: ā†’ Scan for ā€˜SunSā€™ on SunSpecConnection(192.168.2.108:1502](192.168.2.108:1502), Slave ID: 71) 40000

I | SunSpec: Found ā€˜SunSā€™ identifier register 40000 on SunSpecConnection(192.168.2.108:1502](192.168.2.108:1502), Slave ID: 71)

I | SunSpec: Start scanning for SunSpec models on SunSpecConnection(192.168.2.108:1502](192.168.2.108:1502), Slave ID: 71) using SunSpec base register 40000

I | SunSpec: Reading SunSpec models header SunSpecConnection(192.168.2.108:1502](192.168.2.108:1502), Slave ID: 71) using SunSpec base register 40000 offset: 2

I | SunSpec: Discovered SunSpec model on SunSpecConnection(192.168.2.108:1502](192.168.2.108:1502), Slave ID: 71) 1 with length 66

I | SunSpec: Reading SunSpec models header SunSpecConnection(192.168.2.108:1502](192.168.2.108:1502), Slave ID: 71) using SunSpec base register 40000 offset: 70

I | SunSpec: Discovered SunSpec model on SunSpecConnection(192.168.2.108:1502](192.168.2.108:1502), Slave ID: 71) 103 with length 50

I | SunSpec: Reading SunSpec models header SunSpecConnection(192.168.2.108:1502](192.168.2.108:1502), Slave ID: 71) using SunSpec base register 40000 offset: 122

I | SunSpec: Discovered SunSpec model on SunSpecConnection(192.168.2.108:1502](192.168.2.108:1502), Slave ID: 71) 113 with length 60

I | SunSpec: Reading SunSpec models header SunSpecConnection(192.168.2.108:1502](192.168.2.108:1502), Slave ID: 71) using SunSpec base register 40000 offset: 184

I | SunSpec: Discovered SunSpec model on SunSpecConnection(192.168.2.108:1502](192.168.2.108:1502), Slave ID: 71) 120 with length 26

I | SunSpec: Reading SunSpec models header SunSpecConnection(192.168.2.108:1502](192.168.2.108:1502), Slave ID: 71) using SunSpec base register 40000 offset: 212

I | SunSpec: Discovered SunSpec model on SunSpecConnection(192.168.2.108:1502](192.168.2.108:1502), Slave ID: 71) 123 with length 24

I | SunSpec: Reading SunSpec models header SunSpecConnection(192.168.2.108:1502](192.168.2.108:1502), Slave ID: 71) using SunSpec base register 40000 offset: 238

I | SunSpec: Discovered SunSpec model on SunSpecConnection(192.168.2.108:1502](192.168.2.108:1502), Slave ID: 71) 160 with length 68

I | SunSpec: Reading SunSpec models header SunSpecConnection(192.168.2.108:1502](192.168.2.108:1502), Slave ID: 71) using SunSpec base register 40000 offset: 308

I | SunSpec: Discovered SunSpec model on SunSpecConnection(192.168.2.108:1502](192.168.2.108:1502), Slave ID: 71) 802 with length 62

I | SunSpec: Reading SunSpec models header SunSpecConnection(192.168.2.108:1502](192.168.2.108:1502), Slave ID: 71) using SunSpec base register 40000 offset: 372

W | SunSpec: Error occured while reading model header from SunSpecConnection(192.168.2.108:1502](192.168.2.108:1502), Slave ID: 71) using offset 372 ā€œā€

W | SunSpec: Discovery finished with errors during setup of SunSpecConnection(192.168.2.108:1502](192.168.2.108:1502), Slave ID: 71)

W | ThingManager: Thing setup failed. Not adding thing to system.

Thanks @EGuru for testing this!

Looks like Kostal uses an ethernet module from Texas Instruments and does not provide more information which would help identifying this as a Kostal SunSpec thing (no hostname, no own MAC address space). This leaves us only with showing the entire discovery result during a Kostal setup. The custom Vendor / Thingclass will follow soon.

Regarding the SunSpec setup: there is going on something wired: it detects the SunSpec space, and start discovering the register space according to the SunSpec specs, finds the Common model (1), 3 phase Inverter (103), three phase inverter float (113), Name plate (120), Controls (123), Mppt (160), the battery (802) and then the register space seems to be finished without having the ā€œEnd of modelsā€ specified.

Unfortunately there is also no specific modbus error telling us why he fails to read the next model or the ā€œEnd of modelsā€ part. A retry did not help? Maybe just that one request did not went fine?

Iā€™ll provide you soon an update which will finish the setup if any models have been found during setup event if it failes at some point. Normally vendors decide to put float and non float models (like the inverter here) in different address spaces, so they donā€™t show up twice like here. Some filtering for duplicated models is required too.

This really helps a lot! Thanks! Will write here once the experimental update is ready.

Hi @EGuru.

I updated the the plugin and I hope now it works properly.
There is a new KOSTAL vendor you can use to add your connection. You can remove the generic SunSpec connection and use the Kostal SunSpec connection. You should have the correct default values for port and slave ID for Kostal and it has addition Kostal specific stuff.

You can update using sudo apt update && sudo apt upgrade, restart nymead and add the new Kostal SunSpec connection.

Thanks!

Hi @simon.stuerz ,

thank you for your update - now its working :smiley:
The setup of the default values is also good and positive for user Experience.
Now it would be cool if the Kostal Inverter would have a specific host name in the search areaā€¦

Iā€™m trying to find out, why the Datapoint ā€œenergy amountā€ is not correct:

Nymea App:
3547332.61 kWh (energy amount) ā†’ In the Modus description the unit is Wh

Kostal Web-App:
3.724,1 kWh (Total Lifetime solar energy production)

In the next step, it would be interesting to integrate the Kostal Smart Energy Meter (SME) to monitor the household consumption and the grid feed in. In my Setup the Kostal Inverter gets the data from the SME (Connected as powermeter sensor) and displays in the Kostal Web App - as I see in the Modbus documentation, there are a lot of further datapoints discover :nerd_face:

Glad itā€™s working now, and Iā€™m happy you are testing this, since I have not access to this hardware.

From what I saw in the documentation, Kostal offers normal Modbus TCP with much more information and options, and SunSpec in parallel, but not so detailed as with the Modbus registers.
Theoretically the SunSpec connection would also support any kind of Meter, but itā€™s does not seem to show up in the SunSpec section.

I think it would be much better to offer Kostal as Modbus, not SunSpec plugin.

Regarding the Energy value, Iā€™m gonna check the Spec again, maybe I forgot to convert the value, it should definitely be kWh, the specification offers Wh. The difference tough is strange, Iā€™m sure the webapp is using the Mobdus interface, not the SunSpec interface, maybe including some more information which would explain the different values.

Iā€™ll try to bring those information into a new plugin, leaving the generic SunSpec approach and offer a dedicated plugin :slight_smile: Will ping you again once an update for testing is available!

I just checked the value conversion:

I do convert the value from Wh to kWh exactly as itā€™s written in the specs, the same code also works with other inverters. I think going with Modbus TCP interface will resolve those issues.

Do you have also a Battery connected?

Hi Simon,

there is no battery connected yet to the Kostal Hybrid Inverter, but it would be possible to connect compatible BYD and BMZ Batteries. This would be my next step to improve my energy management at home.

In fact, to run the test with Nymea - I had to change the inverter protocol from Modbus to Sunspec.
Maybe your idea could be the solution, because with Modbus I get the correct values.

Hi @EGuru ,
it took me some time, but now the Kostal native modbus (non SunSpec) should be fully supported in the current experimental and is moving to stable with the next release.

The discovery is now precise, meaning, it will connect to the device and read the model and stuff during discovery being sure we found the Kostal Inverter and we can connect to it. Also automatic IP changs in the network of the inverter should be handled automatically now.

Please let me know if it works for you now and if you have any suggestions for improvement :slight_smile: