Verisure Plugin

Posted on
Sun Dec 01, 2019 10:23 am
CrazyFin offline
Posts: 356
Joined: Jan 08, 2015
Location: Stockholm, SWEDEN

Re: Verisure Plugin

@howartp:

You actually do not need to change status of the Verisure devices at all to get this error.
Just set the plugin to login every minute and check the status of the alarm and all the other Verisure devices the user might have (like door locks, smart wall pugs etc).

Then you will just have to wait until the error appears. It can happen within an hour or so or it can take 5-6 hours until it happens.

So the error does not happen when one tries to send a command to CHANGE the state of the alarm or any other Verisure device.
The error happens only when the Verisure plugin makes a login attempt (for example every minute if the plugin is configured to check state every minute).

You could even set the status checks to every 15th second. That will most likely trigger the error much sooner.
Polling for status every 15th second is the current lowest possible setting and I do not think a user need so much more frequent polling. In fact, I really believe that we should not poll the Verisure web page too often since Verisure might start taking action against us if we do frequent polls.

I have been using 1 minute polling frequency and the lowest I would like to have is 30 seconds which is currently not available as a setting in lindehoff's plugin. This might be something you maybe can change in the code for us? :D

Posted on
Sun Dec 01, 2019 10:30 am
howartp offline
Posts: 4083
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Verisure Plugin

I’ve got the error, and I think I’ve fixed it, but the error occurs when getting a token (secret password) that is subsequently sent with every instruction such as lock/unlock. (It isn’t used when just updating statuses)

So I need to test a lock/unlock to check I’ve not broken it.

Tazswe has pm’d me.


Sent from my iPad using Tapatalk Pro

Posted on
Sun Dec 08, 2019 11:25 am
howartp offline
Posts: 4083
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Verisure Plugin

Right, locking/unlocking (and presumably any 'action' such as setting the alarm) is irecoverably irevocably broken with the current version of the plugin.

So, i'm going to start from scratch with a Verisure v2 plugin, using perandstrom's rewritten version.

I'll start with door locks, then see about whatever else the plugin supports.

Should have it ready to test tonight.

Peter

Posted on
Sun Dec 08, 2019 11:59 am
tazswe offline
Posts: 70
Joined: Mar 13, 2017
Location: Sweden

Re: Verisure Plugin

Thanks Peter,

Looking forward to test it .


Skickat från min iPad med Tapatalk

Posted on
Sun Dec 08, 2019 4:52 pm
howartp offline
Posts: 4083
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Verisure Plugin

Et voila:

https://github.com/howartp84/Verisure/releases

It installs as a separate plugin called "Verisure v2" so you can test it, then migrate any actions or control panels etc etc over as I make functionality available.

Let me know how it goes.

Peter

Posted on
Mon Dec 09, 2019 8:19 am
tazswe offline
Posts: 70
Joined: Mar 13, 2017
Location: Sweden

Re: Verisure Plugin

Thank you howartp for the amazing work you have done.

I have tried for a couple of hours and it worked well.
I have used different update times without the system hanging. I also opened and closed the lock via plugin.
I can also find out who opened the lock, the problem is that I do not get any update that the door has been opened and closed if this occurs within the status update rate that have a minimum of 15 seconds.
One solution is to add the option with a lower status update, for example 5 seconds.
It is possible that this is not appreciated by Verisure and that you should have another trigger that updates the status.
howartp, can you post both trigger and and shorter status update rate and let's test?


Skickat från min iPad med Tapatalk

Posted on
Mon Dec 09, 2019 11:20 am
howartp offline
Posts: 4083
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Verisure Plugin

I can certainly add lower refresh times.

There is no mechanism, that I’ve found, to be alerted about lock changes other than by polling.

Perer


Sent from my iPhone using Tapatalk Pro

Posted on
Mon Dec 09, 2019 2:23 pm
tazswe offline
Posts: 70
Joined: Mar 13, 2017
Location: Sweden

Re: Verisure Plugin

I should be very great full if you could ad 5 seconds as an alternative.


Skickat från min iPad med Tapatalk

Posted on
Mon Dec 09, 2019 5:56 pm
howartp offline
Posts: 4083
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Verisure Plugin

https://github.com/howartp84/Verisure/releases

v2.0.1 uploaded.

Matt/Jay, can you tell me why the "Verisure Alarm" devices permanently show "off" instead of eg "disarmed"?

I even manually coded it to set the status to "locked" in case you only accept certain values, but never could I get it to show "locked" like the "Verisure Smart Lock" devices.

I can't see any difference in devices.xml or plugin.py

Peter

Posted on
Wed Dec 11, 2019 2:31 am
tazswe offline
Posts: 70
Joined: Mar 13, 2017
Location: Sweden

Re: Verisure Plugin

Have been running the 2.0.0 version until the 2.0.1 came out and upgraded to it 5 minutes after it was released and set the update frequency to 5 seconds.
Worked like just like I wanted it.
I could use its full potential to trigger different things depending on if it was me or wifey that open the door :D
I could also use the alarm function on the look to trigger an non Verisure alarm or start random ligthning in my house :mrgreen:

Unfortunately this morning I had the following problem (I replaced the real key with XXXXX)

Verisure v2 Debug Checking status for all Verisure Devices
Verisure v2 Error Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
File "plugin.py", line 246, in runConcurrentThread
File "plugin.py", line 152, in refreshData
KeyError: 'XXXXXXX`

Posted on
Wed Dec 11, 2019 2:48 am
howartp offline
Posts: 4083
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Verisure Plugin

Can you restart the plugin and check if it carries on?

That key error implies the ID of the lock has changed, something like “2ABC WXYZ”, which I presumed was a fixed identifier.

Peter


Sent from my iPhone using Tapatalk Pro

Posted on
Wed Dec 11, 2019 3:30 am
tazswe offline
Posts: 70
Joined: Mar 13, 2017
Location: Sweden

Re: Verisure Plugin

I have restarted the plugin and it works again.

Yeah the key was “something” like that, let’s see if it starts again and the key change or what happens.

It was running for about 23-30 hours and crashed during night.


Skickat från min iPad med Tapatalk

Posted on
Fri Dec 13, 2019 6:01 am
tazswe offline
Posts: 70
Joined: Mar 13, 2017
Location: Sweden

Re: Verisure Plugin

The new plugin have been running now for a couple of days.

I’m very grateful that I can finally use all the features of the lock. I don’t have any other Verisure products and can’t confirm if they work or not.

I have played a bit with it and my settings and have an update rate of 5 seconds and I also use autolocking .

I can trigger a lot of things like:

I can use the built in alarm activation even if I don’t have an Verisure alarm to trigger for example another alarm or start random lightning.

I put how last change was made equal to STAR and it will trigger an action.

I can turn it of and also trigger the right music on the Sonos depending on who opened the door by use a trigger that is activated by the on of state with the following conditions.

How was the last change made is equal to CODE.
Person who made the last change is equal to “name”.

You can probably build up a lot of other triggers depending on your need.


Skickat från min iPad med Tapatalk

Posted on
Sat Dec 14, 2019 4:11 am
tazswe offline
Posts: 70
Joined: Mar 13, 2017
Location: Sweden

Re: Verisure Plugin

Plugin crashed, log file enclosed.

Image


Skickat från min iPad med Tapatalk

Posted on
Sat Dec 14, 2019 6:40 am
CrazyFin offline
Posts: 356
Joined: Jan 08, 2015
Location: Stockholm, SWEDEN

Re: Verisure Plugin

@howartp
I just came back home after being away from home for 10 days and was really happy to see that you have managed to create a new Verisure plugin!
I could not even wait to pack up my travel bags before downloading your plugin to try it out.

Seems to work very good! Wonderful!

Just some "easy" things to fix now and it will be running perfectly well. 8)


1. Alarm state (is as you have written above) not shown properly in the Indigo GUI. I see only "Unlocked" there all the time even though I set the alarm to "ARMED AWAY" or "ARMED HOME". However, when I look in the Indigo Touch app on my iPhone and go into the details I see that variable "statusType" shows the three correct states when I change the status of the alarm. I see "DISARMED", "ARMED_AWAY" and "ARMED_HOME". So I guess it is a matter of mapping the variable "statusType" to the proper variable in the Indigo GUI?
When I compare the devices.xml files between your plugin and the old one there are some differences in how the different alarm states are mapped and also the device type is different in your xml-file versus the "old" one.

2. I get the same error as @tazswe has reported above. I get it whenever I just open the plugin configuration panel and then press SAVE (without even having made any changes).

Code: Select all
Verisure v2                     Debug logging disabled
   Verisure v2 Error               Error in plugin execution UiClosed1:

Traceback (most recent call last):
  File "plugin.py", line 63, in closedPrefsConfigUi
  File "plugin.py", line 129, in doLogin
  File "plugin.py", line 143, in refreshData
AttributeError: 'Plugin' object has no attribute 'session'

   Verisure v2 Error               Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 246, in runConcurrentThread
  File "plugin.py", line 143, in refreshData
AttributeError: 'Plugin' object has no attribute 'session'

   Verisure v2 Error               plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)

When this happens the only solution is to reload the plugin.

Who is online

Users browsing this forum: No registered users and 0 guests