-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[sunspec] Add Modbus SunSpec Binding #3216
Comments
@triller-telekom you commentend in PR #2246 :
Can you please point me to another binding how this is actually done? I was trying to follow the advices of @kaikreuzer from this conversation: eclipse-archived/smarthome#5301 (comment) |
@mrbig The explanation from Kai is the proper way to do it. Basically the extension should use the same |
Not sure if something was changed after @triller-telekom's comment but it seems Sunspec binding seems to do just this? |
Thanks @ssalonen yes I believe I did the same already when @triller-telekom commented. Maybe he was looking at different branch? Anyways now I'm a bit on hold waiting for the modbus binding's approval. |
@mrbig If you start working on this excellent approach again (now that the modbus binding is approved) I'd be happy the to support you by testing the sunspec ids |
Dear @PartTimeDev If you're willing to compile openhab yourself you can find the sourcecode here: https://github.com/mrbig/openhab2-addons/tree/3216-binding-sunspec-modbus/addons/binding/org.openhab.binding.modbus.sunspec Or I can send you the precompilend jars as well. |
@mrbig Thanks for the quick reaction! One phase inverter values seem to be fine - at least for my solar edge device. There might be single phase inverters where the first block is not starting at address 69. Which brings me to the first issue regarding the three phase inverter. I need to set the start address for the block, as my three phaser is modeled like this:
There should be a setting for this. Also I can not set a Bridge as there is no "Bridge Selection" control. Same for split phase. |
Thanks, I've fixed the issue with the bridge not showing up. And you are right, it was a mistake to hardcode the begin address of the blocks into the binding. I'll change it to autodetect the available blocks, this could also be a nice way to implement autodiscovery. |
Hello @PartTimeDev |
Detection is working already. Pretty cool :)
But it leaves me hanging there for the 3 phase device described earlier: Modbus/Sunspec activity ends after that. (Eclipse hangs randomly while trying to debug - is driving me nuts)
Full log: https://gist.github.com/PartTimeDev/d116ada37fb00e7a60aa39ff61aab5cc Works great for the Single Phase SolarEdge already (Besides number formatting 😬 ): https://gist.github.com/PartTimeDev/20515f683f28ba65bccfdf6ffd69f689 |
Thanks for the report and the logs. Looks like your device does not have an end model (id 0xffff) at the end of the block list. The detector now tries to find that one, but instead it receives a modbus exception. btw: the current detector will use the first available block. Your device has 2 three phase meters (203). I'm considering how this should be selectable? Either one could enter the base address for the block but it's prone to errors, or there could be just an instance selector (eg 1, 2, 3) that will tell wichone to use if there are multiple of the same type. |
Hello @PartTimeDev , I've pushed a possible fix for your issue. I had to change a few thing in the modbus transport bundle as well, so make sure you recompile that as well. |
I would like to add auto discovery to this feature set. I basically have everything ready for that, I just have to get hold of any new modbus slave bridge that shows up in the system. And my problem is this: modbus bridges are handled by the modbus bundle (ModbusHandlerFactory) while my sunspec code resides in the sunspec bundle (SunSpecHandlerFactory). I don't know how the two could communicate with each other? Or is there a way get notification about newly created bridges? @triller-telekom @ssalonen do you have any hints for me? Thanks |
getting closer... Log excerpt truncated, after a views seconds after start. Regarding your former question, I'd go for the index to select out of multiple identical block types |
@mrbig I don't now directly but browsing the codebase found these resources: Perhaps you can hook into those to listen for new things? |
@mrbig Regarding your discovery problem: You should not listen to any events here, this is not reliable and also a The generic Binding (in your case this has to go into the generic modbus binding, i.e. please extend it) should have a And in the generic Modbus discovery service you collect all participants via OSGi: In your sunspec binding you can implement such a participant as an OSGi service like its done in the blukii binding for example: If you have any questions, feel free to ask. I hope these explanations are helpful. |
@PartTimeDev ok, I thing I've found the problem, the scale factor was incorrectly handled by my parser. I pushed some updates, hope you'll be able to check this out. |
@mrbig tested the latest changes. Looks better now. Seeing values the values -32768 and 32768, i guess the "not implemented" checks need to be changed? (See SMA page 13 or Sunspec page 14 ) Regarding all the 0s and 32768s I contacted the vendor for clarification if and which fields are field correctly. Please check the (full) event log. There are way to much zeros. Besides that, some values seem to be reasonable but hiden behind some scale factor: |
Hi @PartTimeDev I believe I could fix those issues by now. I refactored a lot of parts of the parsing so unsupported fields should be much better handled by now. I've also added auto discovery, and this should be the preferred way to add new items. If you update to the branch I've pushed today, then you'll be able to turn on discovery on modbus tcp slave via the gui or by the enableDiscovery=true parameter. Then your things can be added through discovery: they should show up at the add new thing screen and in the inbox. If you want to add a thing manually then you should use the address and the length attributes to set the start address and the length of the block you want to get handled. |
Hi @mrbig |
Hello @grizzlyfred , I've attached the current version. I consider it more on less ready, with the documentation updated things seem to work fine for me. You will have to install the modbus and the modbus io package as well. There are some changes in my version in the modbus package as well, so make sure you use the one in the tarball below: |
@grizzlyfred I've update the tar.gz because the previous had some errors referencing a non existing class.
Alternatively you can set a high reconnectAfterMillis value to keep the connection open:
|
Hi, I've installed today a solar edge inverter in my new house wich actually is stilla work in progress. |
Hi @flaviodexter , |
SunSpec is an open standard for solar inverters and other related devices to share data about their internal state. The standard is implemented by several vendors like ABB, Fronius, SMA, Schneider Electric, Solaredge, etc. The goal of this work is to add user friendly support of these devices to openHAB. The standard is built on the Modbus protocol, so this work is heavily based on the Modbus binding. Also the Bluetooth binding and several of it's solutions were taken as an example how to extend an already existing binding with a new bundle. Related issue: openhab#3216 This is a stripped down version of a SunSpec bundle aimed to ease reviewing. Original PW with all the features can be found here: https://github.com/openhab/openhab2-addons/pull/4220 This version contains only a limited support for single phase inverters, but no auto discovery or any other fancy features are included. Other changes from my original PR: - migrated to the new build system - using NonNull values wherever possible - modell classes were moved to a dto package and highly simplified - other minor code changes Signed-off-by: Nagy Attila Gabor <mrbig@sneaker.hu>
SunSpec is an open standard for solar inverters and other related devices to share data about their internal state. The standard is implemented by several vendors like ABB, Fronius, SMA, Schneider Electric, Solaredge, etc. The goal of this work is to add user friendly support of these devices to openHAB. The standard is built on the Modbus protocol, so this work is heavily based on the Modbus binding. Also the Bluetooth binding and several of it's solutions were taken as an example how to extend an already existing binding with a new bundle. Related issue: openhab#3216 This is a stripped down version of a SunSpec bundle aimed to ease reviewing. Original PW with all the features can be found here: https://github.com/openhab/openhab2-addons/pull/4220 This version contains only a limited support for single phase inverters, but no auto discovery or any other fancy features are included. Other changes from my original PR: - migrated to the new build system - using NonNull values wherever possible - modell classes were moved to a dto package and highly simplified - other minor code changes Signed-off-by: Nagy Attila Gabor <mrbig@sneaker.hu>
SunSpec is an open standard for solar inverters and other related devices to share data about their internal state. The standard is implemented by several vendors like ABB, Fronius, SMA, Schneider Electric, Solaredge, etc. The goal of this work is to add user friendly support of these devices to openHAB. The standard is built on the Modbus protocol, so this work is heavily based on the Modbus binding. Also the Bluetooth binding and several of it's solutions were taken as an example how to extend an already existing binding with a new bundle. Related issue: openhab#3216 This is a stripped down version of a SunSpec bundle aimed to ease reviewing. Original PW with all the features can be found here: https://github.com/openhab/openhab2-addons/pull/4220 This version contains only a limited support for single phase inverters, but no auto discovery or any other fancy features are included. Other changes from my original PR: - migrated to the new build system - using NonNull values wherever possible - modell classes were moved to a dto package and highly simplified - other minor code changes Signed-off-by: Nagy Attila Gabor <mrbig@sneaker.hu>
* [sunspec] Modbus: SunSpec bundle basic version SunSpec is an open standard for solar inverters and other related devices to share data about their internal state. The standard is implemented by several vendors like ABB, Fronius, SMA, Schneider Electric, Solaredge, etc. The goal of this work is to add user friendly support of these devices to openHAB. The standard is built on the Modbus protocol, so this work is heavily based on the Modbus binding. Also the Bluetooth binding and several of it's solutions were taken as an example how to extend an already existing binding with a new bundle. Related issue: #3216 This is a stripped down version of a SunSpec bundle aimed to ease reviewing. Original PW with all the features can be found here: https://github.com/openhab/openhab2-addons/pull/4220 This version contains only a limited support for single phase inverters, but no auto discovery or any other fancy features are included. Other changes from my original PR: - migrated to the new build system - using NonNull values wherever possible - modell classes were moved to a dto package and highly simplified - other minor code changes Signed-off-by: Nagy Attila Gabor <mrbig@sneaker.hu>
* [sunspec] Modbus: SunSpec bundle basic version SunSpec is an open standard for solar inverters and other related devices to share data about their internal state. The standard is implemented by several vendors like ABB, Fronius, SMA, Schneider Electric, Solaredge, etc. The goal of this work is to add user friendly support of these devices to openHAB. The standard is built on the Modbus protocol, so this work is heavily based on the Modbus binding. Also the Bluetooth binding and several of it's solutions were taken as an example how to extend an already existing binding with a new bundle. Related issue: openhab#3216 This is a stripped down version of a SunSpec bundle aimed to ease reviewing. Original PW with all the features can be found here: https://github.com/openhab/openhab2-addons/pull/4220 This version contains only a limited support for single phase inverters, but no auto discovery or any other fancy features are included. Other changes from my original PR: - migrated to the new build system - using NonNull values wherever possible - modell classes were moved to a dto package and highly simplified - other minor code changes Signed-off-by: Nagy Attila Gabor <mrbig@sneaker.hu> Signed-off-by: Eugen Freiter <freiter@gmx.de>
* [sunspec] Modbus: SunSpec bundle basic version SunSpec is an open standard for solar inverters and other related devices to share data about their internal state. The standard is implemented by several vendors like ABB, Fronius, SMA, Schneider Electric, Solaredge, etc. The goal of this work is to add user friendly support of these devices to openHAB. The standard is built on the Modbus protocol, so this work is heavily based on the Modbus binding. Also the Bluetooth binding and several of it's solutions were taken as an example how to extend an already existing binding with a new bundle. Related issue: openhab#3216 This is a stripped down version of a SunSpec bundle aimed to ease reviewing. Original PW with all the features can be found here: https://github.com/openhab/openhab2-addons/pull/4220 This version contains only a limited support for single phase inverters, but no auto discovery or any other fancy features are included. Other changes from my original PR: - migrated to the new build system - using NonNull values wherever possible - modell classes were moved to a dto package and highly simplified - other minor code changes Signed-off-by: Nagy Attila Gabor <mrbig@sneaker.hu>
* [sunspec] Modbus: SunSpec bundle basic version SunSpec is an open standard for solar inverters and other related devices to share data about their internal state. The standard is implemented by several vendors like ABB, Fronius, SMA, Schneider Electric, Solaredge, etc. The goal of this work is to add user friendly support of these devices to openHAB. The standard is built on the Modbus protocol, so this work is heavily based on the Modbus binding. Also the Bluetooth binding and several of it's solutions were taken as an example how to extend an already existing binding with a new bundle. Related issue: openhab#3216 This is a stripped down version of a SunSpec bundle aimed to ease reviewing. Original PW with all the features can be found here: https://github.com/openhab/openhab2-addons/pull/4220 This version contains only a limited support for single phase inverters, but no auto discovery or any other fancy features are included. Other changes from my original PR: - migrated to the new build system - using NonNull values wherever possible - modell classes were moved to a dto package and highly simplified - other minor code changes Signed-off-by: Nagy Attila Gabor <mrbig@sneaker.hu>
* [sunspec] Modbus: SunSpec bundle basic version SunSpec is an open standard for solar inverters and other related devices to share data about their internal state. The standard is implemented by several vendors like ABB, Fronius, SMA, Schneider Electric, Solaredge, etc. The goal of this work is to add user friendly support of these devices to openHAB. The standard is built on the Modbus protocol, so this work is heavily based on the Modbus binding. Also the Bluetooth binding and several of it's solutions were taken as an example how to extend an already existing binding with a new bundle. Related issue: openhab#3216 This is a stripped down version of a SunSpec bundle aimed to ease reviewing. Original PW with all the features can be found here: https://github.com/openhab/openhab2-addons/pull/4220 This version contains only a limited support for single phase inverters, but no auto discovery or any other fancy features are included. Other changes from my original PR: - migrated to the new build system - using NonNull values wherever possible - modell classes were moved to a dto package and highly simplified - other minor code changes Signed-off-by: Nagy Attila Gabor <mrbig@sneaker.hu>
* [sunspec] Modbus: SunSpec bundle basic version SunSpec is an open standard for solar inverters and other related devices to share data about their internal state. The standard is implemented by several vendors like ABB, Fronius, SMA, Schneider Electric, Solaredge, etc. The goal of this work is to add user friendly support of these devices to openHAB. The standard is built on the Modbus protocol, so this work is heavily based on the Modbus binding. Also the Bluetooth binding and several of it's solutions were taken as an example how to extend an already existing binding with a new bundle. Related issue: openhab#3216 This is a stripped down version of a SunSpec bundle aimed to ease reviewing. Original PW with all the features can be found here: https://github.com/openhab/openhab2-addons/pull/4220 This version contains only a limited support for single phase inverters, but no auto discovery or any other fancy features are included. Other changes from my original PR: - migrated to the new build system - using NonNull values wherever possible - modell classes were moved to a dto package and highly simplified - other minor code changes Signed-off-by: Nagy Attila Gabor <mrbig@sneaker.hu> Signed-off-by: CSchlipp <christian@schlipp.de>
I think this issue is solved by PRs merged above? |
You are right, I have absolutely forgot about this issue. This has already been merged, and big thanks everyone for the help! |
* [sunspec] Modbus: SunSpec bundle basic version SunSpec is an open standard for solar inverters and other related devices to share data about their internal state. The standard is implemented by several vendors like ABB, Fronius, SMA, Schneider Electric, Solaredge, etc. The goal of this work is to add user friendly support of these devices to openHAB. The standard is built on the Modbus protocol, so this work is heavily based on the Modbus binding. Also the Bluetooth binding and several of it's solutions were taken as an example how to extend an already existing binding with a new bundle. Related issue: openhab#3216 This is a stripped down version of a SunSpec bundle aimed to ease reviewing. Original PW with all the features can be found here: https://github.com/openhab/openhab2-addons/pull/4220 This version contains only a limited support for single phase inverters, but no auto discovery or any other fancy features are included. Other changes from my original PR: - migrated to the new build system - using NonNull values wherever possible - modell classes were moved to a dto package and highly simplified - other minor code changes Signed-off-by: Nagy Attila Gabor <mrbig@sneaker.hu>
* [sunspec] Modbus: SunSpec bundle basic version SunSpec is an open standard for solar inverters and other related devices to share data about their internal state. The standard is implemented by several vendors like ABB, Fronius, SMA, Schneider Electric, Solaredge, etc. The goal of this work is to add user friendly support of these devices to openHAB. The standard is built on the Modbus protocol, so this work is heavily based on the Modbus binding. Also the Bluetooth binding and several of it's solutions were taken as an example how to extend an already existing binding with a new bundle. Related issue: openhab#3216 This is a stripped down version of a SunSpec bundle aimed to ease reviewing. Original PW with all the features can be found here: https://github.com/openhab/openhab2-addons/pull/4220 This version contains only a limited support for single phase inverters, but no auto discovery or any other fancy features are included. Other changes from my original PR: - migrated to the new build system - using NonNull values wherever possible - modell classes were moved to a dto package and highly simplified - other minor code changes Signed-off-by: Nagy Attila Gabor <mrbig@sneaker.hu>
* [sunspec] Modbus: SunSpec bundle basic version SunSpec is an open standard for solar inverters and other related devices to share data about their internal state. The standard is implemented by several vendors like ABB, Fronius, SMA, Schneider Electric, Solaredge, etc. The goal of this work is to add user friendly support of these devices to openHAB. The standard is built on the Modbus protocol, so this work is heavily based on the Modbus binding. Also the Bluetooth binding and several of it's solutions were taken as an example how to extend an already existing binding with a new bundle. Related issue: openhab#3216 This is a stripped down version of a SunSpec bundle aimed to ease reviewing. Original PW with all the features can be found here: https://github.com/openhab/openhab2-addons/pull/4220 This version contains only a limited support for single phase inverters, but no auto discovery or any other fancy features are included. Other changes from my original PR: - migrated to the new build system - using NonNull values wherever possible - modell classes were moved to a dto package and highly simplified - other minor code changes Signed-off-by: Nagy Attila Gabor <mrbig@sneaker.hu>
* [sunspec] Modbus: SunSpec bundle basic version SunSpec is an open standard for solar inverters and other related devices to share data about their internal state. The standard is implemented by several vendors like ABB, Fronius, SMA, Schneider Electric, Solaredge, etc. The goal of this work is to add user friendly support of these devices to openHAB. The standard is built on the Modbus protocol, so this work is heavily based on the Modbus binding. Also the Bluetooth binding and several of it's solutions were taken as an example how to extend an already existing binding with a new bundle. Related issue: openhab#3216 This is a stripped down version of a SunSpec bundle aimed to ease reviewing. Original PW with all the features can be found here: https://github.com/openhab/openhab2-addons/pull/4220 This version contains only a limited support for single phase inverters, but no auto discovery or any other fancy features are included. Other changes from my original PR: - migrated to the new build system - using NonNull values wherever possible - modell classes were moved to a dto package and highly simplified - other minor code changes Signed-off-by: Nagy Attila Gabor <mrbig@sneaker.hu>
* [sunspec] Modbus: SunSpec bundle basic version SunSpec is an open standard for solar inverters and other related devices to share data about their internal state. The standard is implemented by several vendors like ABB, Fronius, SMA, Schneider Electric, Solaredge, etc. The goal of this work is to add user friendly support of these devices to openHAB. The standard is built on the Modbus protocol, so this work is heavily based on the Modbus binding. Also the Bluetooth binding and several of it's solutions were taken as an example how to extend an already existing binding with a new bundle. Related issue: openhab#3216 This is a stripped down version of a SunSpec bundle aimed to ease reviewing. Original PW with all the features can be found here: https://github.com/openhab/openhab2-addons/pull/4220 This version contains only a limited support for single phase inverters, but no auto discovery or any other fancy features are included. Other changes from my original PR: - migrated to the new build system - using NonNull values wherever possible - modell classes were moved to a dto package and highly simplified - other minor code changes Signed-off-by: Nagy Attila Gabor <mrbig@sneaker.hu> Signed-off-by: Daan Meijer <daan@studioseptember.nl>
* [sunspec] Modbus: SunSpec bundle basic version SunSpec is an open standard for solar inverters and other related devices to share data about their internal state. The standard is implemented by several vendors like ABB, Fronius, SMA, Schneider Electric, Solaredge, etc. The goal of this work is to add user friendly support of these devices to openHAB. The standard is built on the Modbus protocol, so this work is heavily based on the Modbus binding. Also the Bluetooth binding and several of it's solutions were taken as an example how to extend an already existing binding with a new bundle. Related issue: openhab#3216 This is a stripped down version of a SunSpec bundle aimed to ease reviewing. Original PW with all the features can be found here: https://github.com/openhab/openhab2-addons/pull/4220 This version contains only a limited support for single phase inverters, but no auto discovery or any other fancy features are included. Other changes from my original PR: - migrated to the new build system - using NonNull values wherever possible - modell classes were moved to a dto package and highly simplified - other minor code changes Signed-off-by: Nagy Attila Gabor <mrbig@sneaker.hu>
Hello, Then the next question: The last comment is two years old. Is the project still alive? |
Hello @AchimWilden yes, it's still alive, and it has been merged into the main openhab release. Main documentation can be found here: https://www.openhab.org/addons/bindings/modbus.sunspec/ |
Hi @mrbig, |
@AchimWilden you might be suffering from this: #8538 Manual installation is one workaround... That might be fixed with latest 2.5.x release but I am not sure. What version on openHAB do you have? EDIT: installation might be simpler https://community.openhab.org/t/modbus-binding-with-sunny-boy-sma-inverter/81847/142?u=ssalonen |
Hi, |
No problem! EDIT: installation might be simpler https://community.openhab.org/t/modbus-binding-with-sunny-boy-sma-inverter/81847/142?u=ssalonen First install modbus binding via paper ui. The other modbus based addons like modbus.e3dc or modbus.sunspec you need install manually using the below instructions. You can download the addons from https://www.openhab.org/download/ Under manual installation there is "Download openHAB 2.5.10 stable addons"
|
A first hard-fought success. The addon is installed. Now the documentation of the binding finally picks up but the next question comes up. I have now created a thing file based on the example in the documentation, with the following content
What is still unclear to me is, what is this: modbus: inverter-three-phase: bridge: I want to read out an SMA STP10000. Where can I get the starting address? Or is that always register 40069? Thanks for the help. Without them I would have given up in frustration :-) |
@AchimWilden you should proceed creating a new thread in the community forums. The question will get more attention there |
correct you are right. I do it directly |
@AchimWilden those are only labels. But please avoid setting up the inverter manually unless you really need this. The autodiscovery will try to find the starting address automatically wich can be a bit tricky if done by hand. If the device is found then it will be reported in undert the device properties, so if you really wish, you could later copy them into a file config. |
Dear openHAB developers!
This is a notification per contribution guidelines, that I started developing a new binding to support the so called "SunSpec" standard PV inverters and meters over the modbus protocol.
What is SunSpec?
"SunSpec publishes free, open interoperability specifications and information models that software developers, hardware manufacturers, and integrators use to achieve plug-and-play interoperability between Distributed Energy Resource (DER) components and smart grid applications. All SunSpec specifications are free to download and use. SunSpec also supports international standard communication protocols that adhere to open principles."
-- https://sunspec.org/about-sunspec-specifications/
What does that mean to openHAB?
SunSpec compatible devices could be connected to openHAB regardless who the manufacturer is. There are already several certified products from various manufacturers like ABB, Fronius, Schneider Electric, SMA, SolarEdge...
Design concepts
Original idea came from Thomas Kuehne's post https://community.openhab.org/t/reading-data-from-solaredge-inverters-via-modbus-tcp/26290/1 who set up monitoring with the modbus OH1 binding. But IMHO this method needs lots of tweaking mostly because there are some caveats in the SunSpec protocol. I'd like to make the sunspec binding more user friendly.
My concept is to have the inverters/meters as things, and all the data will be available as channels, OH2 style.
For the transport layer I use ssalonen's work in progress OH2 modbus binding (https://github.com/ssalonen/openhab2-addons/tree/modbus-openhab2-native-binding/addons/binding/org.openhab.binding.modbus ) which includes a very robust modbus transport I/O addon. So my binding uses the transport addon to handle all the modbus related stuff, and the handler mostly does parse and interpret the data and updates the states of the thing channels.
Work in progress code can be found here: https://github.com/mrbig/openhab2-addons/tree/3216-binding-sunspec-modbus/addons/binding/org.openhab.binding.modbus.sunspec
Since this will be my first OH binding, any feedbacks, ideas, comments are welcome!
The text was updated successfully, but these errors were encountered: