Testers for Verisure openHAB 2 binding

I’ve made a temporary w.o. solution that seems to resolve the situation after getting the “Invalid session cookie” error, the next poll interval the bridge will succeed in refreshing status again.

2.5.x jar-file.
3.2.x jar-file.

Please test and come back with findings! :slight_smile:

Running openhabian and version 3.1
All verisure things seems to be online and working again after applying the new version.

Jan,
Thx for your effort!

/t

Running latest milestone and with the new version verisure works ok.

Great work Janne!

My setup have benne up and running for a day now with 100+ updates from the verisure server without problem.
Im running openhab 3.1

Thanks!

Sorry for (maybe) a stupid question but what do I need to do fo override the existing add-on with the updated .jar-file? Just put it in the addons-folder?

I’m using the 3.1 release in a docker container and get disconnected after a day of operation.

Put it in the addons folder and then login to the karaf console (different ways of doing it depending on how you run OH) typically by doing: (default password is habopen)

[13:30:38] openhabian@openhab:~$ openhab-cli console

Logging in as openhab
Password:  

                           _   _     _     ____  
   ___   ___   ___   ___  | | | |   / \   | __ ) 
  / _ \ / _ \ / _ \ / _ \ | |_| |  / _ \  |  _ \ 
 | (_) | (_) |  __/| | | ||  _  | / ___ \ | |_) )
  \___/|  __/ \___/|_| |_||_| |_|/_/   \_\|____/ 
       |_|       3.1.0 - Release Build

Use '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
To exit, use '<ctrl-d>' or 'logout'.

Then find the running version:

openhab> bundle:list|grep -i verisure
286 │ Active    │  80 │ 3.2.0.202108112040    │ openHAB Add-ons :: Bundles :: Verisure Binding

NOTE: You will have another version listed.

Stop and uninstall it:

openhab> bundle:stop 286
openhab> bundle:uninstall 286

Then install the new version and start it:

openhab> bundle:install file:/usr/share/openhab2/addons/org.openhab.binding.verisure-3.2.0-SNAPSHOT.jar
openhab> bundle:list|grep -i verisure
301 │ Active    │  80 │ 3.2.0.202108112040    │ openHAB Add-ons :: Bundles :: Verisure Binding
openhab> bundle:start 301
1 Like

Excellent, thanks!

This evening the verisure binding (the 3.2.0 as per previous post) stopped working, and the log fills up with entries as per below. As the binding goes bananas hammering the verisure page, I seem to reach some kind of maxium tries in a few seconds, and cannot reach “my pages” from the same IP for an hour or so.

Anyone else experiencing any issues? I have not done any changes for the last few days, so this just suddenly happened out of the blue.

2021-09-08 20:33:04.586 [WARN ] [ng.verisure.internal.VerisureSession] - Failed to set session cookie and auth login, HTTP result code: 503
2021-09-08 20:33:04.588 [WARN ] [ternal.handler.VerisureBridgeHandler] - Failed to initialize bridge, please check your credentials!
2021-09-08 20:33:04.934 [WARN ] [ng.verisure.internal.VerisureSession] - Failed to set session cookie and auth login, HTTP result code: 503
2021-09-08 20:33:04.936 [WARN ] [ternal.handler.VerisureBridgeHandler] - Failed to initialize bridge, please check your credentials!
2021-09-08 20:33:05.202 [WARN ] [ng.verisure.internal.VerisureSession] - Failed to set session cookie and auth login, HTTP result code: 503
2021-09-08 20:33:05.203 [WARN ] [ternal.handler.VerisureBridgeHandler] - Failed to initialize bridge, please check your credentials!
2021-09-08 20:33:05.504 [WARN ] [ng.verisure.internal.VerisureSession] - Failed to set session cookie and auth login, HTTP result code: 503
2021-09-08 20:33:05.505 [WARN ] [ternal.handler.VerisureBridgeHandler] - Failed to initialize bridge, please check your credentials!
2021-09-08 20:33:05.867 [WARN ] [ng.verisure.internal.VerisureSession] - Failed to set session cookie and auth login, HTTP result code: 503
2021-09-08 20:33:05.868 [WARN ] [ternal.handler.VerisureBridgeHandler] - Failed to initialize bridge, please check your credentials!
2021-09-08 20:33:06.144 [WARN ] [ng.verisure.internal.VerisureSession] - Failed to set session cookie and auth login, HTTP result code: 503
2021-09-08 20:33:06.146 [WARN ] [ternal.handler.VerisureBridgeHandler] - Failed to initialize bridge, please check your credentials!
2021-09-08 20:33:06.431 [WARN ] [ng.verisure.internal.VerisureSession] - Failed to set session cookie and auth login, HTTP result code: 503
2021-09-08 20:33:06.432 [WARN ] [ternal.handler.VerisureBridgeHandler] - Failed to initialize bridge, please check your credentials!
2021-09-08 20:33:06.725 [WARN ] [ng.verisure.internal.VerisureSession] - Failed to set session cookie and auth login, HTTP result code: 503
2021-09-08 20:33:06.726 [WARN ] [ternal.handler.VerisureBridgeHandler] - Failed to initialize bridge, please check your credentials!


1 Like

I can confirm the same issue, something has been changed on the Verisure side today.
My temp w.o. does no longer work and I need to look into a full MFA solution, I will spend some time the coming week-end on this. I will keep you posted!

2 Likes

Verisure has changed the “API” in regards to authentication procedure. Two endpoints for quering smartlock and battery status has also been removed.

I will work on 2 different solutions:

  1. Support for new authentication procedure without having MFA activated on your account

  2. Support for MFA

I’ll keep you posted.

3 Likes

I now have an update on 1.

Verisure has added an option to turn off MFA and you can do that per user.
Hence you can create a specific user that you then use for automation that can have MFA deactivated, if you want to use MFA on your primary account. I looks like that the user needs to be an administrator to be able to deactivate MFA.

What is interesting is that when you deactivate MFA on a user, Verisure gives you the possibility to answer questions on 3rd part integrations which indicates that they maybe will have an open API in the future.

To deactivate MFA on a user, you need to log in to the Web application MyPages and the go to your account settings:

and then Activate 2FA:

and answer Verisure’s questions.

I have then adapted the binding to the changes that Verisure has made to the authentication process, but only for a user with MFA deactivated.

I would like to get feed-back if everything works as expected using these binding jar-files:
2.5.x
3.2.0

I will look into support for MFA as well, but for an automation user I think it makes sense to not have MFA activated.

Thanks to @John_Galt for beta-testing! :slight_smile:

2 Likes

I just downloaded the 3.2 binding. Works perfectly fine.

1 Like

Is there any updated version for OH3? I tried installing the latest binding you posted (3.2.0 SNAPSHOT) and I get some Import-Package error. I guess this is because I run OH3 and not OH2?

  Error starting bundle 335: Could not resolve module: org.openhab.binding.verisure [335]
  Unresolved requirement: Import-Package: javax.measure; version="[2.1.0,3.0.0)"

The build system was changed after OH3.0, which version of OH3.x are you running? I’ve tested it on 3.2.0.M2.

Im running 3.0.1, should I update OH to the milestone (3.2.0.M2) and test?

In that case the Versure binding will work, for me 3.2.0.M2 seems stable. :slight_smile:

Updated OH to 3.2.0M2 and now it works :slight_smile:

1 Like

Looks like back to “normal” status again.
I’m running openhabian stable which currently is 3.1.0.

Thank you very much
/t

1 Like

I have tested the 2.5.x version, running on Openhab 2.5.9, and it all works as expected.

Thank you very much for the update Janne!

1 Like

I put the 3.2.0…jar on my system. The bridge now connects without any problems and it comes online, which it was not doing before :+1: I disabled / enabled it a few times to double check it and it worked every time. However, the channels of the Things are not updating (this was also happening before), and I see this list of errors in the log file every time I re-enable the bridge:

2021-09-15 21:18:56.999 [WARN ] [ng.verisure.internal.VerisureSession] - Failed to query for climate status: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 1 column 1 path $
2021-09-15 21:18:57.151 [WARN ] [ng.verisure.internal.VerisureSession] - Failed to query for climate status: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 1 column 1 path $
2021-09-15 21:18:57.298 [WARN ] [ng.verisure.internal.VerisureSession] - Failed to query for climate status: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 1 column 1 path $
2021-09-15 21:18:57.572 [WARN ] [ng.verisure.internal.VerisureSession] - Failed to query for climate status: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 1 column 1 path $
2021-09-15 21:18:57.721 [WARN ] [ng.verisure.internal.VerisureSession] - Failed to query for climate status: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 1 column 1 path $
2021-09-15 21:18:57.788 [WARN ] [ng.verisure.internal.VerisureSession] - Failed to send a POST to the API Invalid session cookie
2021-09-15 21:18:57.852 [WARN ] [ng.verisure.internal.VerisureSession] - Failed to send a POST to the API Invalid session cookie
2021-09-15 21:18:57.914 [WARN ] [ng.verisure.internal.VerisureSession] - Failed to send a POST to the API Invalid session cookie
2021-09-15 21:18:57.979 [WARN ] [ng.verisure.internal.VerisureSession] - Failed to send a POST to the API Invalid session cookie
2021-09-15 21:18:58.048 [WARN ] [ng.verisure.internal.VerisureSession] - Failed to send a POST to the API Invalid session cookie
2021-09-15 21:18:58.129 [WARN ] [ng.verisure.internal.VerisureSession] - Failed to send a POST to the API Invalid session cookie