Keyguard Sensors on state change instead of periodic?

Hi,

Any chance to change the behavior of how Keyguard Sensors are updated?
Would it be possible to push them on state change instead of periodic (15 minutes)?

Lets say I want to automate something every time I unlock my phone, currently with the periodic implementation it is unfortunately not possible.

Best regards

If you enable the interactive sensor they will update faster. Only certain sensors update on a state change, the others update on the regular interval and when another sensor has an update. Most keyguard sensors update with the screen on/off. Read the docs to learn more.

I would not written here without reading the docs. And the docs clearly say the keyguard sensors update with the periodic sensor (15 minutes)

What docs are you referring to?

What I’m asking is if it’s possible to have screen unlock push the state instantly to trigger automation instead of only updating once every 15 minutes as stated in the docs?

I had already given you the answer. When any other sensor has an update then we update all sensors, that’s part of the update logic. The interactive sensor is closely related to keyguard so that’s the best you can get. The more you enable the more frequent updates you can expect.

I really appreciate the work people are doing and I usually only ask questions when I come to an dead end and can’t figure it out on my own or can’t read or understand the docs.
I do not agree that you actually answered the question.
My question is if it’s possible to have the keyguard sensor push instantly?

If you ask me about a push button that only updates once every 15 minutes and you want it to turn on your lights instantly. The answer would not be: Start your HVAC and vacuum cleaner then the light will come on faster. Of course you want the button to push the state to HA instantly and turn on the lights instantly. If that was possible with the actual button the answer would explain how, if not possible with this particular button then the answer would be: sorry, not possible with this button.

Back to my question, is it possible to put the finger on my fingerprint scanner to unlock my phone and then instantly trigger some automation?
If it’s possible by activating some other sensor, then please let me know because I still don’t get it from the documentation or your answer.
If not possible today, would it be possible to add the option into home assistant companion app for Android?
If not, I guess I will have to set this up in Tasker.

In both of my responses I had already said to enable the interactive sensor as that will push the keyguard state faster in the apps current state.

Looking deeper in the android code there might be a broadcast intent for when the keyguard itself has been removed so we will need to do further testing on that.

https://developer.android.com/reference/android/content/Intent.html#ACTION_USER_PRESENT

To utilize this today before we get the app updated you will need to register for this intent using the Last Update sensor and adding the constant value from the link as an intent in the sensor settings

When you follow the steps to register for the intent this will basically force all sensors to update when your device emits that a user is present. From there you should see the sensor update immediately, then once we get the app updated you can safely remove the setting as the app will already have it registered for you. If you try this now and tell me that the intent works for your use case I can get a PR submitted.

Now this intent will only tell you when the keyguard has been removed, if you want to understand when the user is gone then you will need to use the interactive sensor for that because that sensors utilizes the screen off intent.

Not all sensors offer a way to update instantly which is why the app updates all of them anytime one sensor has an update. The more you enable the more updates you can expect to receive.