guerrerotook / securitas-direct-new-api

This repository contains the new securitas direct API that can be integrated in Home Assistant
Apache License 2.0
80 stars 30 forks source link

Alarm status not refreshing #67

Open shantur opened 2 years ago

shantur commented 2 years ago

With the latest v2.0.0, the alarm status doesn't get updated in HomeAssistant when the status is changed from the key or Verisure app. I have configured it for 40 seconds scan interval but it doesn't scan every 40 seconds.

Thanks for the integration.

andr1u commented 2 years ago

It happens to me too. I’ve activated the home mode and still appears as deactivated in HA. And one more question, since the integration is configured by UI, YAML code is needed? Because in UI I don’t see where to write the secret code… Thank you all!

andr1u commented 2 years ago

It happens to me too. I’ve activated the home mode and still appears as deactivated in HA. And one more question, since the integration is configured by UI, YAML code is needed? Because in UI I don’t see where to write the secret code… Thank you all!

Well, now it has changed to armed in home.

@guerrerotook , how is configured to check status against web? Or still checks to the alarm panel?

Thanks!

guerrerotook commented 2 years ago

Let me take a look!

guerrerotook commented 2 years ago

Do you guys have any kind of exception in the logs?

guerrerotook commented 2 years ago

The update code for the alarm panel works. It's set to 1200 seconds or 20 minutes.

The code is here.

https://github.com/guerrerotook/securitas-direct-new-api/blob/main/custom_components/securitas/alarm_control_panel.py#L44

If you update you alarm outside your Home Assistant it will take a maximum of 20 minutes, depending on when was the last update, to reflect that.

This is a know issue because we don't want to bother the API making request every 40 seconds. That is took much.

You can change that value at your request.

Also make sure that you have the property check_alarm_panel to false for not for force a fully update with the central unit at your home. That can take minutes an make the system unstable.

andr1u commented 2 years ago

The update code for the alarm panel works. It's set to 1200 seconds or 20 minutes.

The code is here.

https://github.com/guerrerotook/securitas-direct-new-api/blob/main/custom_components/securitas/alarm_control_panel.py#L44

If you update you alarm outside your Home Assistant it will take a maximum of 20 minutes, depending on when was the last update, to reflect that.

This is a know issue because we don't want to bother the API making request every 40 seconds. That is took much.

You can change that value at your request.

Also make sure that you have the property check_alarm_panel to false for not for force a fully update with the central unit at your home. That can take minutes an make the system unstable.

But is still requieres the YAML? The config flow in the UI ask for the username and password… but not the secret code and the check_alarm_panel.

guerrerotook commented 2 years ago

But is still requieres the YAML? The config flow in the UI ask for the username and password… but not the secret code and the check_alarm_panel.

Oh I see, then I guess I have to ask for this also in the UI as well. You are right.

If you configure that from the yaml also works as well.

shantur commented 2 years ago

There are a lot of options to choose from UI if you configure a new setup. I let all the configuration optons to be configured in the UI and my expectation was that if I set the scan interval to 40 then it will scan every 40 seconds. I understand we shouldn't do this.

Can we change it so there are 2 options

  1. Check Alarm Panel - In this case the scan interval is minimum 20 minutes or whatever is the safe value.
  2. No Check alarm panel - In this case the scan interval can be anything minimum of 1 minute.

This would help both set of people, I am hoping the alarm state from server is almost same as the panel ( with a minor delay ). In my setup, I would prefer a quick response rather than an very accurate one to allow automations.

Hope it helps