Skip to content
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

Missing Accumulator Handler in bacnet binding #94

Open
sicorrado opened this issue Dec 4, 2024 · 4 comments
Open

Missing Accumulator Handler in bacnet binding #94

sicorrado opened this issue Dec 4, 2024 · 4 comments
Assignees

Comments

@sicorrado
Copy link

Hi all
Running OpenHab 3.4.5 (docker image) / ConnectorIO 3.4.0 BACnet kar addons,
I've noticed that BACnet Accumulator objects cannot be handled due to the following error:

Exception occurred while calling thing handler factory 'org.connectorio.addons.binding.bacnet.internal.BACnetThingHandlerFactory

after a quick check in the code, the condition to test the ACCUMULATOR_THING_TYPE and AccumulatorHandler class are missed.
By reading the documentation, Accumulator objects seem to be available for Things type ( https://docs.connectorio.com/connectorio-addons/4.1.x/bindings/bacnet/descriptors/thing-types.html), this is why I was wondering if it is a missing implementation.

Before to open this issue, I was trying to add it by myself but struggling with recompilation (a simple 'mvn clean install' in binding.bacnet directory or 'mvn clean install -pl :org.connectorio.addons.binding.bacnet -am' does not take my modifications into account).
If you have any suggestion on it, I'd be very grateful!

Kind Regards
Silvia

@splatch splatch self-assigned this Dec 7, 2024
@splatch
Copy link
Contributor

splatch commented Dec 7, 2024

Hello @sicorrado, thank you for trying/using the binding!

I will have a look on the binding and see if accumulator support missing or handled through generic code. Would you like to read some specific property of accumulator or present value?

For the compilation part - it really depends how you update binding. At runtime you have to deploy a KAR file, so if you build binding alone, it does not update KAR file which you later on (probably) re-deploy. For that you need to do mvn clean install -pl :org.connectorio.addons.kar.bacnet -am. Then it will build binding and kar file which you can redeploy.
You can still build binding alone, but then you have to update binding module/jar/bundle within openHAB through update xyz file:/path/to/my/org.connectorio.addons.binding.bacnet-3.4.0-SNAPSHOT.jar

Hope that it helps you a bit with evaluation.

@sicorrado
Copy link
Author

Many thanks @splatch for your reply and explanations!
Yes, I'd like to read just present value property.

After having retrieved last changes on branch 3.4.x, the compilation failed with the following message :
$ mvn clean install -pl :org.connectorio.addons.kar.bacnet -am

[ERROR] Failed to execute goal on project org.connectorio.addons.binding: Could not resolve dependencies for project org.connectorio.addons:org.connectorio.addons.binding:bundle:3.4.0-SNAPSHOT: The following artifacts could not be resolved: org.openhab.core.bundles:org.openhab.core:jar:3.4.2 (absent), org.openhab.core.bundles:org.openhab.core.thing:jar:3.4.2 (absent), org.openhab.core.bundles:org.openhab.core.transform:jar:3.4.2 (absent): Could not find artifact org.openhab.core.bundles:org.openhab.core:jar:3.4.2 in co7io-public-releases (https://repository.connectorio.cloud/repository/co7io-public-releases) ->

Not a big maven expert, I've just noticed that it is trying to download these jars from "central" (which is taking a generic path repo.maven.etc...), but no clue how to properly fix it :/
Again, thanks a lot for your help!

image

@splatch
Copy link
Contributor

splatch commented Dec 16, 2024

Add -P openhab to your build, it should enable openHAB repositories to be polled for org.openhab.* artifacts.

@sicorrado
Copy link
Author

Thank you @splatch , with -P openhab option to my build and by setting the following env var : export JDK_JAVA_OPTIONS="--add-opens=java.base/java.lang=ALL-UNNAMED" , the compilation works perfectly!
I've just tried to add the missing code for Accumulator Objects (modified files : BACnetThingHandlerFactory.java, BACnetPropertyDiscoveryService.java, BACnetDeviceHandler.java, channel-config.xml), recompiled and redeployed kar file but still got an error at runtime on openhab :

(textual definition of thing)
Bridge co7io-bacnet:ipv4:bacNetworkT "BACnet Network T" [ localNetworkNumber=0, localDeviceId=1339, port=47807, refreshInterval=60000, broadcastAddress="x.x.x.x" ] {
Bridge ip-device clim1 "Main unit" [address="x.x.x.x", port=47808, instance=1001, refreshInterval=60000, network=0, discoverChannels=false, discoverObjects=false] {
Channels:
Type deviceWriteableNumber:electric_energy "Electric Energy" [instance=415043, readOnly=true, type="ACCUMULATOR", refreshInterval=60000, localNetworkNumber=0, broadcastAddress="x.x.x.x", propertyIdentifier="present-value"]
}
}

image

It seems like the channel type "ACCUMULATOR" is still not recognized, even though added in channel-config.xml (when I modified src/main/resources/OH-INF/config/ )
May I create a branch to push my code (if you think it is usefull ) ?
Thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants