SenecHome Binding

Thanks for the support.
I’m trying to get the new version up and running.
I have a question about it:
How can I set the “https” option to True via the Thing file?

No Problem, should work like this:

Thing senechome:senechome:pvbattery [ hostname=“192.168.0.128”, useHttps=true, refreshInterval=60, limitationTresholdValue=70, limitationDuration=60 ]

My items are filling up with life.
As it looks in my short test, it is running again.
Thanks

Same for me: working again. Several tries to get away from offline (error) but after logging in and restarting several times, it went to green again.

Thanks a lot !!!

Just found a GitHub Issue and linked it to my Pull Request. Hopefully this PR is added to the next OpenHAB release.

Hi @KobiP ,

I found that the „Live“ parameters, like LiveGridImport a.s.o. are down to zero! Except the Live Wallbox 1 Charged Energy. This value is filled and ok, but all the others are 0.
Is it on my side only?

QHi, also works again for. In addition to @demlstda the wallbox1chargingPower also does not provide new values.

No reaction ;(

Hey,
the discussion continued also on GitHub in an Issue ticket. Another maintainer and myself try to get the changes merged to the official binding. And I started with an implementation that receives the live values from mein-senec.de. But it is a completely new implmentation and it will take some time.
Cheers

1 Like

Hi @KobiP

thank you for providing the snapshot.
is it possible that the live house consumption channel was accidentally removed from the snapshot?
Can this possibly be added again ?

Cheers
Michael

Sorry, it wasn’t removed by accident. SENEC removed it, so the binding can’t read it. I have an Idea how to get it back, but it ain’t simple. So I can’t promise that this will come any time soon.

By the way, my solution works, but another programmer also fixed it very similar. His solution will be merged to hopefully the next OpenHAB release. And it will need a slightly different configuration. Just to let you know :slight_smile:

@KobiP
Could you please upload the .jar file again. (your link is offline)

As Senec has removed some parts of the local interface (lala.cgi) as well as has no local interface for their current Home 4 systems at all. I have made the effort to to analyse the posibilities to use their app-gateway that provides the Data for their mobil APP.

A documentation of the REST Services used by the the current App v. 4.3.3 as well as the upcoming version 4.4.0_beta01 are available at:
SENEC APP API 4.3.3

Tracking the wallbox Services is still a work in progress and the documentation will be updated continiously.

Might be used as a basis to be implemented in the existing senechome binding or to create a new one based on the APP Api gateway.

Authorization is quite easy as it requires only a one time call of the login service with username and password, which returnes a static access token with no lease time, so the token can be used for all other service calls without the need to reauthentificate for ever

1 Like

This sounds great, who can bring this into the next release of openhab? @mstormi

Anyone can contribute to openHAB. Go ahead an open a PR or push it to the markeplace.

Please don’t arbitrarily ping me or anyone from now on.

Hey, indeed the API can be used. I have made a demo implementation in python that reads from the api:

Also I started with a demonstrator integration into the currently existing binding:

But in the discussions the Idea came up that it might be a bad Idea to bring in the online functionality into the existing binding. And now you say that v4 doesn’t have any local API endpoint any more? Then a second, online only binding would actualy totally make sense.

Downside: I currently don’t find the time to implement a complete new binding. Maybe later this year / early next year, but nothing that I can promise. But maybe my examples help someone to take over.

Cheers

Even so I’m a Java Dev by profession I’m not a openhab user myself. As I have seen that most Smart Home Platforms that are implementing Senec Web Integration are trying or doing so by using the mein-senec.de website service Endpoints, my intent is to provide an alternative that

  1. Less hassle with authentification as no fiddling around with cookie_jar and reauthentification due to expired session cookies is needed
  2. Delivers more data and services through the app-gateway than through the mein-senec services.

Other than that if anyone willing to use or implement a binding based on tha Senec app-gateway and has questions on the services itself is free to contact me

Cheers

How many tries?
Mine can not connect after several tries.

Running latest stable OH4.0.4 on RPi

Thing senechome:senechome:pvbattery [ hostname="10.180.254.144",useHttps=true, refreshInterval=60, limitationTresholdValue=70, limitationDuration=60 ]
2023-11-27 19:28:53.982 [WARN ] [.senechome.internal.SenecHomeHandler] - Error refreshing source 'senechome:senechome:pvbattery'
java.util.concurrent.ExecutionException: java.net.ConnectException: Connection refused
	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:840) ~[?:?]
Caused by: java.net.ConnectException: Connection refused
	at sun.nio.ch.Net.pollConnect(Native Method) ~[?:?]
	at sun.nio.ch.Net.pollConnectNow(Net.java:672) ~[?:?]
	at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:946) ~[?:?]
	at org.eclipse.jetty.io.SelectorManager.doFinishConnect(SelectorManager.java:355) ~[?:?]
	at org.eclipse.jetty.io.ManagedSelector.processConnect(ManagedSelector.java:347) ~[?:?]
	at org.eclipse.jetty.io.ManagedSelector.access$1700(ManagedSelector.java:65) ~[?:?]
	at org.eclipse.jetty.io.ManagedSelector$SelectorProducer.processSelected(ManagedSelector.java:676) ~[?:?]
	at org.eclipse.jetty.io.ManagedSelector$SelectorProducer.produce(ManagedSelector.java:535) ~[?:?]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produceTask(EatWhatYouKill.java:362) ~[?:?]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:186) ~[?:?]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173) ~[?:?]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131) ~[?:?]
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409) ~[?:?]
	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

Connecting to the Senec with the web interface is providing basic information without any log in to the device

Hey!
Currently using this binding and it works great. Thanks for all the updates, whenever Senec breaks stuff :smiley:

I found, that in HomeAssistant you can actually manually activate charging of the battery. I did some investigating and it is just another POST Call to the lala API. You can see the data that needs to be sent here: https://github.com/marq24/ha-senec-v3/blob/master/custom_components/senec/pysenec_ha/__init__.py#L1560

I already tried it via curl and it works like a charm :+1:
Are you already looking into this? Otherwise I might try to add it to the Binding myself. It might just take a while, since I am a little busy right now, and I dont have any of the dev tools for openhab set up atm.

Since no one seemed to be working on it, I set something up myself as soon as I had time.
Here is a preliminary version. I would really appreciate some testing and feedback.

Everything seems to be working as expected on my system, but I dont know how it will behave with other batteries etc.
If it works for some more people, I will see about creating a pull request.

Looking forward to hear from everyone!

1 Like