I used this Binding to access the openHAB instance on the “Solarwatt Manager Flex (SMF)” for some years.
Since an update of SMF 2 or 3 days ago the Binding cannot longer connect to the SMF-openHAB because the signon suddenly does not only need a password, it now also needs a sessionid stored in a cookie! And this sessionid is only 30 Minutes valid.
As the Solarwatt Binding is unusable for SMF and only the Remote OH can be used I cannot retrieve data in my openHAB any more! (I use 4.3.5 and tested it also under 5.0.2 openHABian).
Any ideas how this new sessionId could be integrated?
It is definetely not an error or problem of Remote openHAB Binding! This side worked and works as designed.
The difficulty has been braught in some days ago from the other side: Solarwatt/Kiwigrid with their SMF, based on openHAB. They invented besides the password, for whatever reason, a sessioncookie and since then the acess from my Remote openHAB Binding to the SMF’s openHAB doesn’t work any more.
The SMF is a device installed in my house to control my photovoltaic installation. (more or less openHAB on a Raspi with some additional interfaces).
The problem has also been detected and discussed in the HA-Forum i. e. here and here
To my understanding they created at HA a workaround to catch the “kiwisessionid” out of the cookie to be able to connect to the /rest/api of SMF-openHAB.
My question is, whether something like that could also be integrated in openHAB as script or somewhere else. And I really need help to solve this issue.
That’s pretty cool! I wasn’t aware that anyone was using OH like that.
Possibly but you’ll need to abandon the Remote OH add-on and do the HTTP REST calls to the SMF directly using a rule or an external script.
Or, if you can access the openHAB on the SMF and change things, you might be able to use the MQTT Event Bus rule template to link the two OH instances in another way which will bypass what ever additional authentication they implemented.
But I think even then I’d need the kiwisessionid, or?
2,5 years ago that was possible. But after some versions of their SMF they hided it and I still cannot find it (port I think)… Remote OH was such a perfect solution! It was read only and so noone could compromise their local openHAB instance…
I’m not sure how we would know. Maybe they donate to the foundation. Ideally, submitting PRs would be the best way they could contribute.
Yes, you’d have to implement the HTTP calls as necessary.
All the Remote openHAB add-on does is make HTTP calls to the other OH’s REST API. You’d have to do the same, only with the addition of acquiring and using the cookie authentication.
If Remote openHAB can do it the port is there and open. I assume you discovered the Remote openHAB Thing instead of manually configuring it. So you should be able to find the port number on that Thing.
But you’ll also need the credentials to log in as an admin role which is likely not available.
Yesterday I made a portscan with nmap and saw, that there are only 2 ports open: 80 ant 443. So I think, they implemented a kind of redirection from openhab paperUI to their own local SMF app.
Then Remote openHAB add-on wouldn’t be able to connect at all except through one of those two ports and what ever reverse proxy they’ve implemented is allowing access to the OH REST API. All of that can be confirmed by looking at the Remote openHAB Thing in your instance of OH.
And if that’s the case you should be able to bring up MainUI with https://<ip of SMF>/overview and you might be able to bring up the REST API explorer with https://<ip of SMF>/developer/api-explorer. If not, they’ve locked it down and made it so you cannot access their insdtance of OH at all except through their system.
I am completely new to the whole topic and to openHAB. I installed it just today to find a possibillity to access the data of my solarwatt PV installation where a SMF is part of.
I also tried to connect via the Remote openHAB Binding, an of course I failed.
The two URLs suggested by @rlkoshak boeth lead to the same UI as just http://<ip of SMF>
The only thing that leads to something else is http://<ip of SMF>/rest/
I am axperimenting with a http binding … also with experience level “0”. Maybe this leads to a way to access the values. Nevertheless there are still 152 values available in /rest/items
Update: I have not been successfull yet. All I get back when trying to read a JSON element is