Securitas Direct (Verisure EU) Custom Component [TESTERS WANTED]

Hi All,

I have had similiar issues and found that the best thing to do is remove the component and also the alarm control panel from lovelace.
Then give everything a restart. and add the component again. Restart and all should work.

Let me know if this helps

Cheers

Ross

Hi Jezzard,

Iā€™ve tried it a dozen of time already and two days ago it worked for a few hours until I had to restart Hassio for other reasons and since then, no way to put it back on. There should be something wrong somewhere, it clearly logs in as it shows my installation number and name in Hassio but there is no communication about status changes. Iā€™m getting mad about it

I know this sounds silly but have you logged in to the verisure app recently and set an alarm and deactivated it? Then restarted HA? This has happened with me previously?
If that does not work, have you tried the CLI above and is this responding with the logs for any status. Thats a good place to start

Yes I tried to log out than log in again, arm, disarm, through the app, directly from the keyboard, restert HA but this did not work. What is the ā€œCLIā€?

Sorry to ask stupid questions but we will get there. I have had similiar issues and it took me about a day so i appreciate the frustration. There seems to be something in the update by HA since about 1.08 which knocks everything out for some reason. Trust me it comes back and is steady once it does.

So first thing i would say as step by step.

  1. Remove everything from config.py
  2. In lovelace remove the alarm_control_panel
  3. Remove the custom component
  4. Remove any automations, scripts etc (copy them and add them back again kater) from all config. We want no history of the alarm in HA.
  5. Restart HA/ Hassio
  6. Go to developer tools and check the ā€œstatesā€ for any entities, automation scripts that referred to the alarm. If you see them and they are greyed out, get rid of them.
  7. Log in via vrisure app, check status, arm, disarm etc
  8. Not sure if neccesary but i check config and restart again to be sure. Maybe me just being over cautious
  9. Add the custom component again
  10. Add back to config
  11. Reboot
  12. Add back to lovelace

If this doesnt work, try again. It will work as long as nothing is connected to an alarm anywhere before you add in. That was my downfall.

If that fails after 3 times and all is clear. I am happy to give you step by step to check the api is interacting with your alarm which will help us see where the issue may be.

Cheers

Ross

Thank you so much for your procedure. I will follow it step by step as soon as I can find a little time to do so (most probably tonight) and Iā€™ll let you know. The other big frustration I have is that my Hassio (running on RPI4) takes aproximatively 15 minutes to restart so any change takes so long. But I will try it and hopefully I wonā€™t need to do it 3 times :slight_smile:

Good luck. I wonder why it takes so long? Funnily enough i had the same issue in docker as you Pi when the alarm was having issues. After i removed it and followed the steps, the restart took approx a minute. Just curious if you find the same.

To avoid restarting too many times just search for anything in the developer tools > states, which was connected to the alarm. I know mine caught me out on an automation i had which had a trigger with the alarm entity still attached. This caused me a headache.

Cheers

Ross

Just left a code fix on GITHUB for the Keyrror ā€œREGā€. I have been running the fix for a few days already and seems to work fine. The lack of the ā€œREGā€ info on the web responses impairs the component to learn the status of the alarm and when it happens on a restart impairs the component to be set-up.

It now needs @segalion blessing to be added to the repository.

@jezzard, this is a 3 times failure ā€¦ :frowning: Iā€™ve followed the procedure and unfortunately had 3 times the same issue. I even tried to remove ā€œhomekit:ā€ from my config file as I thought it could potentially interfer but the result is the same. @jimenbar Iā€™m not sure to understand, would your fix solve my issue?

Updated to new HA version and working againā€¦ itā€™s strange.

I updated HA and reinstalled everything as described above several times but still face the same issueā€¦

Not sure exactly what is the error you get, but if it is related with the crash that the component suffers every other minute which is the one pointed out by @javy97 a few post before the answer is YES.

The problem of the components is that such error happen so frequently that if just by chance it happens when HA is re-started the component will not be set-up and will not work. If you are lucky enough and the problem does not happen in the re-start you, the component will be set-up and you will only see the noise in the log. That is why people in complaining about unpredictable behaviours, some times work, some time does not work.

As I said, with the fix, the component works like a charm with zero issues and zero log noise. It is up to @segalion to review my code change, review it and create a new version.

For reference, the underlying reason of the problem is that Securitas web service sometime is not able to answer the status request HA makes every minute and when the component is set-up on a HA restart. When that status request fail the component throws and error in the log or is not able to be set-up.

Thank you @jimenbar, is there anything I can try on my side while waiting for a new version from Segalion to be available? My HA takes 15 minutes to restart so I guess the chance having this error happening during this period is higher than if it only took a few seconds? For info, Iā€™ve managed to have it work only once among something like 50 restarts of HA and it only worked till the next restartā€¦

Look to the github repository of the component. In there you should see my pull request with the code changes. I believe you could download my amended version of the securitas.py or see the changes and madr those on your own.

It is at your own risk as @segalion had not reviewed or agree.

Hello, Iā€™m from Italy and Iā€™m trying to use this component.
The ARM AWAY and ARM NIGHT are working fine. Iā€™m not able instead to activate the garden section. Please consider that when Iā€™m going away from my house I need to activate both the ARM AWAY and the EXTERNAL section with two different actions.
In any case also trying to use the CUSTOM BYPASS the external section in not activated.
One more info, Is I activate the garden (external perimeter) the component report the NOT ACTIVATED icon.
Thanks for your clarifications and help.

@jezzard @jimenbar I just foud the solution to both my issues of long startup and Securitas integration. All came from netatmo that I have on my network but direclty linked to homekit and not integrated into HA. For any reason, HA was trying to log to my netatmo acount and adding:

netatmo:
  client_id: dummy
  client_secret: dummy

to my configuration file it solved my problem of long restart, and enable my alarm to work again through home assistant!

Thank you very much for your assistance!!!

I just have one small remaining issue: when I arm my alarm using the physical control unit, status is not updating in Home assistant, only it is when arm is made through the phone app. Is there a way to track these actions or shoud I resign from using it anymore?

@Romain_Pioch, you are welcome. Did you implemented my code change then?

Your other problem is because the wall unit does not record any entries on the Securitas log therefore the HA component does not know you have armed from there. You can ask your Securitas support for the wall device to be logged and then iHA will know. This problem only affects the arming, when you disarm the alarm, as you use your hand devices, their activity is recorded. It is a must all your keys must be logged for the component to work.

@jimenbar I finally not implemented your solution as Iā€™m far to be skilled in this field and I prefer to stay on the safe sideā€¦ :slight_smile: Thank you for your information regarding the wall device, I will thus stop using it for arming my alarm and try the system like this for a while.

Thanks again!

Hi all guys, I got this error:

File ā€œ/config/custom_components/securitas_direct/init.pyā€, line 107, in update_overview
self.overview = self.session.last_state()
File ā€œ/config/custom_components/securitas_direct/securitas.pyā€, line 111, in last_state
regs= res[ā€˜PETā€™][ā€˜LISTā€™][ā€˜REGā€™]
KeyError: ā€˜REGā€™

Anyone can help?