Testers for Verisure openHAB 2 binding

Hi @stivbert

There has never existed a separate climate control, it is built in the things types:

  • Smoke Detector (climate)
  • Water Detector (climate)
  • Siren (climate)
  • Mice Detection Status (incl. climate)

Hi Mike! :slight_smile:

There is no difference in implementation compared to 2.x version of binding.
lastEventType and lastEventCategory from the eventLog thing gives you a string with the type of event, e.g.:

1 Like

I’m trying to install Verisure Bindong on OH3@Rpi, but get cyclic warnings and error.

2021-01-19 15:52:04.225 [WARN ] [core.karaf.internal.FeatureInstaller] - The misc add-on 'ruleengine' does not exist - ignoring it.

2021-01-19 15:52:04.263 [WARN ] [core.karaf.internal.FeatureInstaller] - The ui add-on 'homebuilder' does not exist - ignoring it.

2021-01-19 15:52:04.271 [WARN ] [core.karaf.internal.FeatureInstaller] - The ui add-on 'habmin' does not exist - ignoring it.

2021-01-19 15:52:04.277 [WARN ] [core.karaf.internal.FeatureInstaller] - The ui add-on 'paper' does not exist - ignoring it.

2021-01-19 15:52:04.491 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-binding-verisure': Error:

	invalid bit length repeat

Is the binding in need of update before it works on OH3 or do I need to fix something before it can be installed?

/BS

I am using it in OH3 with the version included in OH3 without any problems.

OK, did you upgrade to OH3 or did you install from scratch? I upgraded.

Hi @BjornS

This post might give some help to you:

Hej Janne.

Would it be possible to update LastEvent items when you trigger channels.
Now when i use the trigger channels in this rule

triggers:
  - id: "3"
    configuration:
      channelUID: verisure:smartLock:liegatan:2A8LL8TX:smartLockTriggerChannel
    type: core.ChannelEventTrigger
  - id: "1"
    configuration:
      channelUID: verisure:doorWindowSensor:liegatan:2JJSN37D:doorWindowTriggerChannel
    type: core.ChannelEventTrigger
conditions: []
actions:
  - inputs: {}
    id: "2"
    configuration:
      type: application/vnd.openhab.dsl.rule
      script: >
        logInfo("Verisure", "A trigger event was detected:" +
        receivedEvent.toString())

        logInfo("Verisure","Event " + Verisure_LastEventCategory.state.toString + ":"+ Verisure_LastEventType.state.toString + ":"+Verisure_LastEventUserName.state.toString)
    type: script.ScriptAction

i get

2021-01-19 21:48:37.410 [INFO ] [g.openhab.core.model.script.Verisure] - A trigger event was detected:UNLOCK
2021-01-19 21:48:37.415 [INFO ] [g.openhab.core.model.script.Verisure] - Event DOORWINDOW_STATE_CLOSED:DOORWINDOW_STATE_CHANGE_CLOSED:NULL
2021-01-19 21:48:37.420 [INFO ] [g.openhab.core.model.script.Verisure] - A trigger event was detected:DOORWINDOW_OPENED
2021-01-19 21:48:37.425 [INFO ] [g.openhab.core.model.script.Verisure] - Event DOORWINDOW_STATE_CLOSED:DOORWINDOW_STATE_CHANGE_CLOSED:NULL
2021-01-19 21:48:37.915 [INFO ] [g.openhab.core.model.script.Verisure] - A trigger event was detected:UNKNOWN_EVENT_TYPE
2021-01-19 21:48:37.920 [INFO ] [g.openhab.core.model.script.Verisure] - Event DOORWINDOW_STATE_CLOSED:DOORWINDOW_STATE_CHANGE_CLOSED:NULL
2021-01-19 21:48:39.910 [INFO ] [g.openhab.core.model.script.Verisure] - A trigger event was detected:DOORWINDOW_CLOSED
2021-01-19 21:48:39.916 [INFO ] [g.openhab.core.model.script.Verisure] - Event DOORWINDOW_STATE_CLOSED:DOORWINDOW_STATE_CHANGE_CLOSED:NULL

Good morning, I have installed this binding and I get this error, I have tried it by installing from the paper-ui and then manual and it always comes out the same, use OH2 (updated correctly) I attach the screenshot

Hi @tnemrap!

Sorry for a late answer, but since several events can be triggered between binding refresh interval, the last event will always show the latest event being triggered for that refresh period.

So in your example during the last refresh period Veriure has detected events in the time order:

  • UNLOCK
  • DOORWINDOW_OPENED
  • UNKOWN_EVENT_TYPE
  • DOORWINDOW_CLOSED

and hence the last event type is being reported as DOORWINDOW_STATE_CHANGE_CLOSED.

Hi @mdepablo!

I need to see DEBUG logs for the Verisure binding to be able to know what goes wrong.
For instructions to configure DEBUG log, you can use the following instructions:

I strongly recommend that you configure your OH to create separate log files for all the bindings that you are especially interested of, e.g. Verisure :slight_smile:

This documentation is really good.
Just c&p this to correct places in the file /var/lib/openhab2/etc/org.ops4j.pax.logging.cfg:

### Custom Loggers ###
# Logger - verisure.log
log4j2.logger.verisure.name = org.openhab.binding.verisure
log4j2.logger.verisure.level = DEBUG
log4j2.logger.verisure.additivity = false
log4j2.logger.verisure.appenderRefs = verisure
log4j2.logger.verisure.appenderRef.verisure.ref = VERISURE

# Audit file appender
log4j2.appender.verisure.type = RollingRandomAccessFile
log4j2.appender.verisure.name = VERISURE
log4j2.appender.verisure.fileName = /var/log/openhab2/verisure.log
log4j2.appender.verisure.filePattern = /var/log/openhab2/verisure.log.%i
log4j2.appender.verisure.append = true
log4j2.appender.verisure.layout.type = PatternLayout
log4j2.appender.verisure.layout.pattern = %d{yyyy-MM-dd HH:mm:ss.SSS} [%-5.5p] [%-36.36c] - %m%n
log4j2.appender.verisure.policies.type = Policies
log4j2.appender.verisure.policies.size.type = SizeBasedTriggeringPolicy
log4j2.appender.verisure.policies.size.size = 10MB
log4j2.appender.verisure.strategy.type = DefaultRolloverStrategy
log4j2.appender.verisure.strategy.max = 10

You can send them in a PM to me!

Is it possible to implement a ‘set temp’ ? Or more climate control

Hi @stivbert!

You mean climate control of Panasonic heat pump?
I do not have one of my own, it is controllable from the web page?

If it is, can you then provide me with examples from both requests/responses?

I have difficulties to get the binding work properly.
It starts up fine and runs for about a half day then it suddenly stops to update, the bridge status is still online.
I can read this from openhab log file:

2021-06-10 04:25:34.121 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: 
java.lang.NullPointerException: null
    at org.openhab.binding.verisure.internal.VerisureSession.updateSmartLockStatus(VerisureSession.java:590) ~[?:?]
    at org.openhab.binding.verisure.internal.VerisureSession.lambda$2(VerisureSession.java:525) ~[?:?]
    at java.util.concurrent.ConcurrentHashMap.forEach(ConcurrentHashMap.java:1603) ~[?:?]
    at org.openhab.binding.verisure.internal.VerisureSession.updateStatus(VerisureSession.java:519) ~[?:?]
    at org.openhab.binding.verisure.internal.VerisureSession.refresh(VerisureSession.java:119) ~[?:?]
    at org.openhab.binding.verisure.internal.handler.VerisureBridgeHandler.refreshAndUpdateStatus(VerisureBridgeHandler.java:181) ~[?:?]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
    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:1128) [?:?]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
    at java.lang.Thread.run(Thread.java:834) [?:?]

And this from verisure debug log:

2021-06-10 04:25:32.736 [DEBUG] [ternal.handler.VerisureBridgeHandler] - Refresh and update status!
2021-06-10 04:25:32.736 [DEBUG] [ng.verisure.internal.VerisureSession] - Checking if we are logged in
2021-06-10 04:25:33.068 [DEBUG] [ng.verisure.internal.VerisureSession] - Fetching vid xxxxxxxxxxxxxxxxxxxxxxxxx from cookie
2021-06-10 04:25:33.068 [DEBUG] [ng.verisure.internal.VerisureSession] - Update status
2021-06-10 04:25:33.598 [DEBUG] [ng.verisure.internal.VerisureSession] - Got CSRF: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2021-06-10 04:25:33.704 [DEBUG] [ng.verisure.internal.VerisureSession] - postVerisureAPI URL: https://m-api02.verisure.com/auth/login Data:empty
2021-06-10 04:25:33.705 [DEBUG] [ng.verisure.internal.VerisureSession] - Setting cookie with username xxxxxxxxxxxxxxx@gmail.com and vid xxxxxxxxxxxxxxxxxxxxxxxx
2021-06-10 04:25:33.705 [DEBUG] [ng.verisure.internal.VerisureSession] - HTTP POST Request HttpRequest[POST /auth/login HTTP/1.1]@38ecdb26.
2021-06-10 04:25:34.027 [DEBUG] [ng.verisure.internal.VerisureSession] - HTTP Response (200)
2021-06-10 04:25:34.028 [DEBUG] [ng.verisure.internal.VerisureSession] - Quering API for alarm status!
2021-06-10 04:25:34.028 [DEBUG] [ng.verisure.internal.VerisureSession] - postVerisureAPI URL: https://m-api02.verisure.com/graphql Data:[{"operationName":"ArmState","variables":{"hideNotifications":false,"offset":0,"pagesize":0,"giid":"xxxxxxxx"},"query":"query ArmState($giid: String!) {\n  installation(giid: $giid) {\n armState {\n type\n statusType\n date\n name\n changedVia\n allowedForFirstLine\n allowed\n errorCodes {\n value\n message\n __typename\n}\n __typename\n}\n __typename\n}\n}\n"}]
2021-06-10 04:25:34.028 [DEBUG] [ng.verisure.internal.VerisureSession] - HTTP POST Request HttpRequest[POST /graphql HTTP/1.1]@2170f7bd.
2021-06-10 04:25:34.072 [DEBUG] [ng.verisure.internal.VerisureSession] - HTTP Response (200)
2021-06-10 04:25:34.073 [DEBUG] [ng.verisure.internal.VerisureSession] - REST Response (VerisureBaseThingDTO [deviceId=, name=null, location=null, status=null, siteName=null, siteId=0, data=Data [installation=Installation [armState=ArmState [type=null, statusType=null, date=null, name=null, changedVia=null, allowedForFirstLine=false, allowed=false, errorCodes=null, typename=null], broadband=Broadband [testDate=null, isBroadbandConnected=false, typename=null], eventLog=EventLog [moreDataAvailable=false, pagedList=[], typename=null], climates=[], doorWindows=[], communicationState=[], mice=[], doorlocks=[], smartplugs=[], userTrackings=[], typename=Installation]]])
2021-06-10 04:25:34.074 [WARN ] [nternal.handler.VerisureThingHandler] - Alarm status is null!
2021-06-10 04:25:34.074 [DEBUG] [ng.verisure.internal.VerisureSession] - Quering API for smart lock status
2021-06-10 04:25:34.074 [DEBUG] [ng.verisure.internal.VerisureSession] - postVerisureAPI URL: https://m-api02.verisure.com/graphql Data:[{"operationName":"DoorLock","variables":{"hideNotifications":false,"offset":0,"pagesize":0,"giid":"xxxxxxxx"},"query":"query DoorLock($giid: String!) {\n  installation(giid: $giid) {\n doorlocks {\n device {\n deviceLabel\n area\n __typename\n}\n currentLockState\n eventTime\n secureModeActive\n motorJam\n userString\n method\n __typename\n}\n __typename\n}\n}\n"}]
2021-06-10 04:25:34.074 [DEBUG] [ng.verisure.internal.VerisureSession] - HTTP POST Request HttpRequest[POST /graphql HTTP/1.1]@28ca6ecc.
2021-06-10 04:25:34.118 [DEBUG] [ng.verisure.internal.VerisureSession] - HTTP Response (200)
2021-06-10 04:25:34.120 [DEBUG] [ng.verisure.internal.VerisureSession] - REST Response (VerisureSmartLocksDTO [smartLockJSON=null])

Have anyone seen this before?

Will this support the new video doorbell?

The problem described above happends after 99 updates.
Dependent on what I choose as refresh intervall the binding fails after different amount of time but always after 99 updates.

Interesting, I’m on vacation right now but I will look into it after that.

I’m also experiencing problems with the 2FA that causes the bindning to stop. Logging into the app again using 2FA triggers it. Deactivating/activating the bridge resolves it but then I need to logout from the app but logging in again triggers it again. So only using binding and not app still works.

Looks like VeriSure has gone out of their way to make it even harder for external systems to interact. This half-hearted 2FA implementation completely ignores 3rd party API integrations. @VeriSure: never heard of API Tokens? :smirk:

Meanwhile, I will check if it stays online for me if I don’t login to the App, like Jan mentioned.

@jannegpriv enjoy your vacation! :sunglasses:

To get some ideas, 2FA seems to be implemented to verisure python module.

There is also some discussion around emails received from Verisure, and it seems that Verisure might come more open to 3rd party integrations.

Python module also use different urls nowadays, which might be dedicated for 3rd party integrations

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