guerrerotook / securitas-direct-new-api

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

I linked my account but it doesnt show anything #145

Closed GerardPolloRebozado closed 10 months ago

GerardPolloRebozado commented 1 year ago

image Also in the integrations panel shows this error: image

mgomezgu commented 1 year ago

It happens exactly the same as you. Have you been able to solve it? I have a question about the first "code" that asks for the integration to which it refers? (This is not the mistake) Screenshot_2023-08-28-11-21-36-521_io homeassistant companion android-edit

mgomezgu commented 1 year ago

I have managed to make it work. I have created a second user, then I have entered this user in the mobile app (it asks for a password change) and once it works on the mobile, I have configured the homeassistant.

GerardPolloRebozado commented 1 year ago

It happens exactly the same as you. Have you been able to solve it? I have a question about the first "code" that asks for the integration to which it refers? (This is not the mistake) Screenshot_2023-08-28-11-21-36-521_io homeassistant companion android-edit

I dont know what the code is but checking the github saw that on an update the code was optional so I typed 0 and then in the config removed the value. Do you know what the code is?

SirLouen commented 1 year ago

I have managed to make it work. I have created a second user, then I have entered this user in the mobile app (it asks for a password change) and once it works on the mobile, I have configured the homeassistant.

Do you have more than 1 installation under the other user?

GerardPolloRebozado commented 1 year ago

I have managed to make it work. I have created a second user, then I have entered this user in the mobile app (it asks for a password change) and once it works on the mobile, I have configured the homeassistant.

Do you have more than 1 installation under the other user?

I only have 1 installation. Do I need to sign in with mi admin user or a second user?

mgomezgu commented 1 year ago

I only have one installation. But it was impossible for me to connect it with the main user, or that's why I made a second user.

SirLouen commented 1 year ago

I only have 1 installation. Do I need to sign in with mi admin user or a second user? I only have one installation. But it was impossible for me to connect it with the main user, or that's why I made a second user.

Ok, the thing is that I found some issues under multiple installations and I was wondering if these affected to you the same. When you create a new user, you create the new user for just one installation (regardless the amount of installations you already have), this is why was partially suspecting that this could be the problem

But it's super weird that you created a second user and it worked. There are a ton of weird things in this integrations because the Securitas API has a ton of things that are almost impossible to check them by the developer (because he is only seeing what his installation return to him).

So basically without the detailed logs from the connection it's impossible to know what it's hindering the setup. You must force debug mode in the configuration.yaml for the securitas direct integration and then check the debug logs and put them here. You can set this with:

logger:
  default: debug
  logs:
    custom_components.securitas: error

Considering that the logger component is installed in HA by default https://www.home-assistant.io/integrations/logger/

GerardPolloRebozado commented 1 year ago

This is the error: Could not log in to Securitas: Usuario bloqueado. Para desbloquearlo, pulsa sobre olvidé mi contraseña y sigue los pasos. It just says the user is blocked and I need to reset my password, logged out from the official app and can login again perfectly. tried changing the password and still same issue.

guerrerotook commented 11 months ago

Sorry for the inconvenience. The code that you are referring on the screenshots is for Home Assistant to required a code to arm and disarm, is not related to Securitas Direct.

Also, you can enable debug logs in the integration so see what is happening exactly.

logger:
  logs:
    custom_components.securitas_direct: debug
zav13r commented 10 months ago

I recently had a similar issue. After speaking with Securitas customer support, they confirmed that a second user is required to prevent an account being locked.

If you use the same login for mobile app and this integration, you will surely encounter issues because you may only be logged into one place at a time.

So, I have the integration connected through my admin securitas account, and my phone logged in using a second user.

Before this, I received the same error messages above and HA showed the integration, but no devices. Adding a second user, unlocking my account (Securitas customer support) and then setting up the integration again solved the problem for me.