I recently implemented a binding to retrieve data from my BSB-LAN device via the JSON API provided by the device.
Initially I just wanted to get in touch with binding development in openHAB and have a simple and flexible way of retrieving data.
That’s why I started coding with the result of a new binding that can be used to communicate with the BSB-LAN device. The binding is now running for several days in my system in a first version. As I didn’t notice major issues I decided to share the outcome.
So If someone stumbles across this post and wants to give the binding a try I would appreciate your feedback. Due to my limited spare time I will not be able to respond at present.
The current version is based on a 2.5.0 snapshot and available here. Copying the jar to the “addons” directory should be all that has to be done - of course apart from configuring the binding
Finally I had some more time to test in detail: reading and setting parameters for my heating system from Brötje works without any problems.
Great Job!
Are there any plans to add this binding to the official repo?
Nice to hear and many thanks for your feedback and testing.
Haven’t yet thought of contributing it back to the official repository. In case of doing so it might be worth contacting the owner of the BSB repo regarding his plans of the JSON API, just to be sure there are no breaking changes planned in the near future which would require reworking the communication with the device when using newer firmware versions.
I try to use your binding.
Unfortunately, I don’t get the binding to work.
I loaded the .jar into the “addons” folder and configured the things, items and sitemap like your specification here. But I don’t get an issue. The items have no values.
Maybe there is some additional Config? Or an required add-on?
If I make a http query with the browser i receive the data (also the parameter 8982).
Any help and tips are very welcome.
Thank you for your work
as far as I know there shouldn’t be anything else to do - at least I hadn’t to do other Things
Some things you might want to check:
Could it be the same issue as here
Have you done the configuration via files or via paper ui?
I am currently running on a 2.5 snapshot (2.5.0~S1630-1)
Which version do you use?
What status do the bridge and parameter things show in paper-ui?
You should be able to see it via URLs similar to http://[ip]/paperui/index.html#/configuration/things/view/bsblan:bridge:heating http://[ip]/paperui/index.html#/configuration/things/view/bsblan:parameter:heating:p8730
Here is how it looks in my system:
You could also check the openhab logfile. Maybe you can see something there. Possibly you have to increase the log level like documented here
I have done the configuration via files.
My openHAB version is: 2.4.0 Stable
And now here was the problem: In PaperUI i saw no BSB-LAN Bridge Thing.
In the log-file i saw (after a restart):
2019-10-09 22:31:58.012 [WARN ] [org.apache.felix.fileinstall ] - Error while starting bundle: file:/share/MD0_DATA/.qpkg/OpenHab/addons/org.openhab.binding.bsblan-2.5.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.bsblan [215]
Unresolved requirement: Import-Package: com.google.gson; version="[2.8.0,3.0.0)"
After downloading the gson.jar to the addons Folder nothing happens.
So i installed the dependency manually on the karaf console:
nice binding. I also own a adapter and now try to using it with your binding. I can read almost everything i want , but if try to set a value then my log output the following.
2020-03-05 07:42:13.787 [ome.event.ItemCommandEvent] - Item 'BsbParameter710NumberValue' received command 22
2020-03-05 07:42:13.821 [nt.ItemStatePredictedEvent] - BsbParameter710NumberValue predicted to become 22
2020-03-05 07:42:13.841 [vent.ItemStateChangedEvent] - BsbParameter710NumberValue changed from 21.0 to 22
2020-03-05 07:42:13.890 [INFO ] [.bsblan.internal.api.BsbLanApiCaller] - Failed to set parameter 710 to '22': status = READ_ONLY
2020-03-05 07:42:13.896 [WARN ] [ernal.handler.BsbLanParameterHandler] - Failed to set parameter 710 to '22' for channel 'number-value'
2020-03-05 07:42:17.323 [vent.ItemStateChangedEvent] - BsbParameter710NumberValue changed from 22 to 21.0
And now the big question, why is it read only? Did i miss something ?
Item and Thins and sitemap are copy paste from the Example on github.
Hello Peter
it’s me again. First of all thank you for your binding.
I noticed a small problem: In order to be able to analyze my heating, I logged some key data in a database.
For example, I wanted to Log the status of the solar system on every change so that I can see when it is loading or not. Now I noticed that “phantom data” are delivered quite often via your binding.
I assume that this is a problem of binding, because after I found out, I reactivated the “old items” (queried with http) and logged them. And these entries are correct.
I also found that this phantom data “only” arises from Channels of type Description.
For Channels of Type Number-Value, it fits me.
Can you confirm that or is it a local problem?
However, I still use your 2.5.0-Snapshot.
Here is an excerpt of the corresponding items and the associated database entries:
the binding itself does not handle the cannels differently. Maybe openhab itself is handling StringType updates differently than updates of DecimalTypes (e.g. because of a different value comparison – sadly I don’t know the logic in behind). I will have to analyze this more deeply.
Just a question: I assume you are using a persistence add-on to write the values to the database. Which strategy are you using? everyChange or everyUpdate?
I have just tried to reproduce the issue but everything worked as expected - no duplicate entries were created in the database.
The only issue I had, was that creating the table for the string item failed with java.sql.SQLException: Column length too big for column 'value' (max = 21844); use BLOB or TEXT instead Query: CREATE TABLE IF NOT EXISTS item0001 (time TIMESTAMP(3) NOT NULL, value VARCHAR(65500), PRIMARY KEY(time)) Parameters: []
After creating the table manually with a value column as TEXT everything worked smoothly.
I tried it on an openhab 2.5.1 with
bsblan.items
Number BsbParameter710NumberValue { channel="bsblan:parameter:heating:p710:number-value" }
String BsbParameter8000Description { channel="bsblan:parameter:heating:p8000:description" }
Hello Peter,
sorry about the late reply.
My openhab runs on a QNAP. Unfortunately, with this setup I always come across problems that are not easy to solve or very strange behavior that I don’t really see through.
Now, to make a long story short:
After Deinstalling openHAB and all bindings, clear the Cache and Reinstalling it seems that it works as expected.
Sorry to bother you with this and thank you for your help and work