Tnx to @vctender that did 95% of the base work I could extend the SenecHome Binding with some more data points. As I was too late for an update of the 2.5.x Binding I would like to post the jar here. I am using this Jar in my productive setup since over a week.
Tnx to @KobiP an @vctender for the Senec-Binding.
Iâm using this binding a long time in OH 2.x.
After upgrade to OH 3.0 RC1, i have noticed that the Channel âbatteryStateâ has changed type of item from âStringâ to âNumberâ.
In the UI of OH 3 shows always the item status âNULLâ
When i change the type from number to string, the value of batteryState is in the intem overview of the UI correct, but the openhab.log show:
â[WARN ] [e.internal.SseItemStatesEventBuilder] - Exception while formatting value âCHARGEâ of item SenecHome_Batterieladung with format â%.0f %%â: f != java.lang.Stringâ
and the status of item is âErrâ.
How can i solve this problem?
Hey @VPrimus,
I canât give you a quick solution. But I will try to look into this between christmas and new year. Canât promise, but I will try my best!
During development I only used 2.5 to test, and then compiled also for 3.0. Maybe this was not the best wayâŠ
Hey,
could you please check the JAR in this Pull Request?
You can find there also the reason behind the hickup. I still donât understand where it comes from, but that doesnât matter now. I just hope it got fixed. As I still donât run on OH3, I canât properly test it.
another update! I have rewritten parts of the binding for better readability and reduced duplicated lines of code. You can find another jar here:
Warning: I renamed the âbatteryState / batteryStateValueâ to âsystemState / systemStateValueâ, as that is what it is. The state of the whole Senec Home System (including the inverter), not only of the battery. You will need to adapt your items accordingly!
I also took the chance to setup a OH3 test instance. The batteryState is working now as it should:
in the Documentation are three temperatures mentioned.
â Has someone an Idea why I cannot see any of them at my binding?
â Can someone of you see these Items?
Hey, a bit strange as I would assume that it should update automatically. But for me it did not update from 3.1 to 3.2. What I did was removing and installing the Binding, then I had the latest version.
Would anyone know how to force battery charge/discharge on a Senec Home system ?
Iâd also be glad if someone can provide me with the vendor documentation for the available values. Senec isnât quite a shiny example in providing technical documentation.
Or is it all based on reverse engineering ?
Senec is really the was to Go if you donât want to Touch anything. Or if you like to tinker. No API, no Docu, nothing.
I did the first steps by finding first clues by someone else, then extending it by reverse engineering. Some usefull links, just exchange the IP Adress with yours:
To force Charge the Battery you can enter the Service Menu in the Local Web Page, reachable via the IP. Then you can Release the force Charge state again. Thats all you can do afaik. I am not at Home, so I canât give more Details.
Thanks for your feedback
Unfortunately I donât even own a Senec box to tinker with
Would you be willing to reverse engineer out how battery forced charging works and eventually add this capability to the binding ?
Yes Senec is the âto goâ for PV owner that have no idea or interest in how the system works, then again for pros like us Senecâs intentional lack of documentation and willingness to grant access to the system is a big nuisance.
Thatâs password protected. Many to own a PV donât even know this account data (only their electrician/solar system provider does⊠yeah, good olâ Germany âŠ) so I as a 3rd party do not have access here, cannot even see it.
Can you evaluate whatâs the proper HTTP request to accomplish battery charging ?
Would you need to set a target SoC or can you specify a power value to charge/discharge with ?
Moin,
my SENEC still has NPU Image 2106. The binding works there as usual. Could you please enable the DEBUG logging for SENEC and post the messages? Maybe this helps me a bit to evaluate actions.
Could you also post some details about how your local senec web opens? http or https? The page when you open the IP shown in the SENEC Display? And do you need to accept a not trusted certificate in case it is https?
Hi there, SENEC switched to HTTPS
=> local SENEC WEB Interface not available via HTTP anymore. Neither /logs /display etc.
Binding is switched to âDEBUGâ and reactivated the Thing.
20:16:10.281 [INFO ] [est.core.internal.thing.ThingResource] - Received HTTP PUT request for update configuration at 'things/senechome:senechome:ba729009/config' for an uninitialized thing 'senechome:senechome:ba729009'.
20:16:11.700 [WARN ] [g.senechome.internal.SenecHomeHandler] - Error refreshing source 'senechome:senechome:ba729009'
java.util.concurrent.ExecutionException: java.net.UnknownHostException: http: Name or service not known
at org.eclipse.jetty.client.util.FutureResponseListener.getResult(FutureResponseListener.java:118) ~[?:?]
at org.eclipse.jetty.client.util.FutureResponseListener.get(FutureResponseListener.java:101) ~[?:?]
at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:732) ~[?:?]
at org.openhab.binding.senechome.internal.SenecHomeApi.getStatistics(SenecHomeApi.java:82) ~[?:?]
at org.openhab.binding.senechome.internal.SenecHomeHandler.refreshState(SenecHomeHandler.java:139) ~[?:?]
at org.openhab.core.cache.ExpiringCache.refreshValue(ExpiringCache.java:101) ~[?:?]
at org.openhab.core.cache.ExpiringCache.getValue(ExpiringCache.java:72) ~[?:?]
at org.openhab.binding.senechome.internal.SenecHomeHandler.refresh(SenecHomeHandler.java:133) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.net.UnknownHostException: http: Name or service not known
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) ~[?:?]
at java.net.InetAddress$PlatformNameService.lookupAllHostAddr(InetAddress.java:934) ~[?:?]
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1543) ~[?:?]
at java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:852) ~[?:?]
at java.net.InetAddress.getAllByName0(InetAddress.java:1533) ~[?:?]
at java.net.InetAddress.getAllByName(InetAddress.java:1385) ~[?:?]
at java.net.InetAddress.getAllByName(InetAddress.java:1306) ~[?:?]
at org.eclipse.jetty.util.SocketAddressResolver$Async.lambda$resolve$1(SocketAddressResolver.java:170) ~[?:?]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) ~[?:?]
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) ~[?:?]
... 1 more
20:16:19.720 [WARN ] [g.senechome.internal.SenecHomeHandler] - Error refreshing source 'senechome:senechome:ba729009'
java.util.concurrent.ExecutionException: java.net.UnknownHostException: http
at org.eclipse.jetty.client.util.FutureResponseListener.getResult(FutureResponseListener.java:118) ~[?:?]
at org.eclipse.jetty.client.util.FutureResponseListener.get(FutureResponseListener.java:101) ~[?:?]
at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:732) ~[?:?]
at org.openhab.binding.senechome.internal.SenecHomeApi.getStatistics(SenecHomeApi.java:82) ~[?:?]
at org.openhab.binding.senechome.internal.SenecHomeHandler.refreshState(SenecHomeHandler.java:139) ~[?:?]
at org.openhab.core.cache.ExpiringCache.refreshValue(ExpiringCache.java:101) ~[?:?]
at org.openhab.core.cache.ExpiringCache.getValue(ExpiringCache.java:72) ~[?:?]
at org.openhab.binding.senechome.internal.SenecHomeHandler.refresh(SenecHomeHandler.java:133) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.net.UnknownHostException: http
at java.net.InetAddress$CachedAddresses.get(InetAddress.java:801) ~[?:?]
at java.net.InetAddress.getAllByName0(InetAddress.java:1533) ~[?:?]
at java.net.InetAddress.getAllByName(InetAddress.java:1385) ~[?:?]
at java.net.InetAddress.getAllByName(InetAddress.java:1306) ~[?:?]
at org.eclipse.jetty.util.SocketAddressResolver$Async.lambda$resolve$1(SocketAddressResolver.java:170) ~[?:?]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) ~[?:?]
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) ~[?:?]
... 1 more
20:16:27.741 [WARN ] [g.senechome.internal.SenecHomeHandler] - Error refreshing source 'senechome:senechome:ba729009'
java.util.concurrent.ExecutionException: java.net.UnknownHostException: http: Name or service not known
at org.eclipse.jetty.client.util.FutureResponseListener.getResult(FutureResponseListener.java:118) ~[?:?]
at org.eclipse.jetty.client.util.FutureResponseListener.get(FutureResponseListener.java:101) ~[?:?]
at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:732) ~[?:?]
at org.openhab.binding.senechome.internal.SenecHomeApi.getStatistics(SenecHomeApi.java:82) ~[?:?]
at org.openhab.binding.senechome.internal.SenecHomeHandler.refreshState(SenecHomeHandler.java:139) ~[?:?]
at org.openhab.core.cache.ExpiringCache.refreshValue(ExpiringCache.java:101) ~[?:?]
at org.openhab.core.cache.ExpiringCache.getValue(ExpiringCache.java:72) ~[?:?]
at org.openhab.binding.senechome.internal.SenecHomeHandler.refresh(SenecHomeHandler.java:133) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.net.UnknownHostException: http: Name or service not known
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) ~[?:?]
at java.net.InetAddress$PlatformNameService.lookupAllHostAddr(InetAddress.java:934) ~[?:?]
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1543) ~[?:?]
at java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:852) ~[?:?]
at java.net.InetAddress.getAllByName0(InetAddress.java:1533) ~[?:?]
at java.net.InetAddress.getAllByName(InetAddress.java:1385) ~[?:?]
at java.net.InetAddress.getAllByName(InetAddress.java:1306) ~[?:?]
at org.eclipse.jetty.util.SocketAddressResolver$Async.lambda$resolve$1(SocketAddressResolver.java:170) ~[?:?]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) ~[?:?]
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) ~[?:?]
... 1 more
20:16:35.760 [WARN ] [g.senechome.internal.SenecHomeHandler] - Error refreshing source 'senechome:senechome:ba729009'
java.util.concurrent.ExecutionException: java.net.UnknownHostException: http
at org.eclipse.jetty.client.util.FutureResponseListener.getResult(FutureResponseListener.java:118) ~[?:?]
at org.eclipse.jetty.client.util.FutureResponseListener.get(FutureResponseListener.java:101) ~[?:?]
at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:732) ~[?:?]
at org.openhab.binding.senechome.internal.SenecHomeApi.getStatistics(SenecHomeApi.java:82) ~[?:?]
at org.openhab.binding.senechome.internal.SenecHomeHandler.refreshState(SenecHomeHandler.java:139) ~[?:?]
at org.openhab.core.cache.ExpiringCache.refreshValue(ExpiringCache.java:101) ~[?:?]
at org.openhab.core.cache.ExpiringCache.getValue(ExpiringCache.java:72) ~[?:?]
at org.openhab.binding.senechome.internal.SenecHomeHandler.refresh(SenecHomeHandler.java:133) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.net.UnknownHostException: http
at java.net.InetAddress$CachedAddresses.get(InetAddress.java:801) ~[?:?]
at java.net.InetAddress.getAllByName0(InetAddress.java:1533) ~[?:?]
at java.net.InetAddress.getAllByName(InetAddress.java:1385) ~[?:?]
at java.net.InetAddress.getAllByName(InetAddress.java:1306) ~[?:?]
at org.eclipse.jetty.util.SocketAddressResolver$Async.lambda$resolve$1(SocketAddressResolver.java:170) ~[?:?]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) ~[?:?]
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) ~[?:?]
... 1 more
20:16:43.773 [WARN ] [g.senechome.internal.SenecHomeHandler] - Error refreshing source 'senechome:senechome:ba729009'
java.util.concurrent.ExecutionException: java.net.UnknownHostException: http: Name or service not known
at org.eclipse.jetty.client.util.FutureResponseListener.getResult(FutureResponseListener.java:118) ~[?:?]
at org.eclipse.jetty.client.util.FutureResponseListener.get(FutureResponseListener.java:101) ~[?:?]
at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:732) ~[?:?]
at org.openhab.binding.senechome.internal.SenecHomeApi.getStatistics(SenecHomeApi.java:82) ~[?:?]
at org.openhab.binding.senechome.internal.SenecHomeHandler.refreshState(SenecHomeHandler.java:139) ~[?:?]
at org.openhab.core.cache.ExpiringCache.refreshValue(ExpiringCache.java:101) ~[?:?]
at org.openhab.core.cache.ExpiringCache.getValue(ExpiringCache.java:72) ~[?:?]
at org.openhab.binding.senechome.internal.SenecHomeHandler.refresh(SenecHomeHandler.java:133) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.net.UnknownHostException: http: Name or service not known
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) ~[?:?]
at java.net.InetAddress$PlatformNameService.lookupAllHostAddr(InetAddress.java:934) ~[?:?]
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1543) ~[?:?]
at java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:852) ~[?:?]
at java.net.InetAddress.getAllByName0(InetAddress.java:1533) ~[?:?]
at java.net.InetAddress.getAllByName(InetAddress.java:1385) ~[?:?]
at java.net.InetAddress.getAllByName(InetAddress.java:1306) ~[?:?]
at org.eclipse.jetty.util.SocketAddressResolver$Async.lambda$resolve$1(SocketAddressResolver.java:170) ~[?:?]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) ~[?:?]
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) ~[?:?]
... 1 more
20:16:51.785 [WARN ] [g.senechome.internal.SenecHomeHandler] - Error refreshing source 'senechome:senechome:ba729009'
java.util.concurrent.ExecutionException: java.net.UnknownHostException: http
at org.eclipse.jetty.client.util.FutureResponseListener.getResult(FutureResponseListener.java:118) ~[?:?]
at org.eclipse.jetty.client.util.FutureResponseListener.get(FutureResponseListener.java:101) ~[?:?]
at org.eclipse.jetty.client.HttpRequest.send(HttpRequest.java:732) ~[?:?]
at org.openhab.binding.senechome.internal.SenecHomeApi.getStatistics(SenecHomeApi.java:82) ~[?:?]
at org.openhab.binding.senechome.internal.SenecHomeHandler.refreshState(SenecHomeHandler.java:139) ~[?:?]
at org.openhab.core.cache.ExpiringCache.refreshValue(ExpiringCache.java:101) ~[?:?]
at org.openhab.core.cache.ExpiringCache.getValue(ExpiringCache.java:72) ~[?:?]
at org.openhab.binding.senechome.internal.SenecHomeHandler.refresh(SenecHomeHandler.java:133) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) ~[?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.net.UnknownHostException: http
at java.net.InetAddress$CachedAddresses.get(InetAddress.java:801) ~[?:?]
at java.net.InetAddress.getAllByName0(InetAddress.java:1533) ~[?:?]
at java.net.InetAddress.getAllByName(InetAddress.java:1385) ~[?:?]
at java.net.InetAddress.getAllByName(InetAddress.java:1306) ~[?:?]
at org.eclipse.jetty.util.SocketAddressResolver$Async.lambda$resolve$1(SocketAddressResolver.java:170) ~[?:?]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) ~[?:?]
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) ~[?:?]
... 1 more
Hey,
here my first try to debug and fix the issue. I enforce HTTPS now and ignore all certificates. The enforcement is static, I need to think about a good way how to make this smarter.
I tried to install your âNextcloudâ version.
I removed the 4.0.2 senec binding, and copied the new one into /usr/share/openhab/addons/
but:
2023-09-04 14:26:29.400 [WARN ] [org.apache.felix.fileinstall ] - Error while starting bundle: file:/usr/share/openhab/addons/org.openhab.binding.senechome-4.1.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.senechome [293]
Unresolved requirement: Import-Package: javax.measure; version="[2.2.0,3.0.0)"
at org.eclipse.osgi.container.Module.start(Module.java:463) ~[org.eclipse.osgi-3.18.0.jar:?]
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:445) ~[org.eclipse.osgi-3.18.0.jar:?]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) ~[?:?]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) ~[?:?]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:520) ~[?:?]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) ~[?:?]
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) ~[?:?]
There is a weird behaviour if you build a binding, the dependency to javax.measure is higher than what openhab provides. Found a workaround. This time I tested it also locally, for me the binding works on Openhab 4.0.2.
What I changed:
Downgraded the binding from 4.1 to 4.0, downgraded javax.measure dependency
Introduced a https configuration parameter, please set it to true
Smaller stability improvements and debugging output