I have installed the Home Assistant companion app on a Pixel Tablet that has multiple user accounts set up. Home Assistant is installed under the “Owner” user, and I have another account set up for “Kiosk” for general use, without access to my personal accounts.
I noticed that the sensors don’t seem to get an update when you switch accounts, so they are stuck forever in their last known state.
In particular, I’d like the “Interactive” sensor to switch to “Off” upon switching user accounts, because it is no longer being used by the user that Home Assistant is running under.
While logged in as the “Kiosk” user, none of the sensors update at all (which is what I want). I just would like it if there was one last sensor update prior to switching users to put things into the right state.
I noticed that this same issue occurs when you simply shut down or reboot (which is true on the MacOS companion app as well).
that is not how sensors work, they read device states.
make sure the new profile has the same app and is logged in as well, might be kept separate.
as long as the correct profile which has the app installed and logged in when you reboot it should be fine. ot sure why you expect the app to send a sensor update if the device is shut down though. The integration only gets updates from the device. You may be able to detect when the device shuts down using the last update sensor, but theres no guarantee there.
From the perspective of the tablet, switching users is essentially the same as rebooting/shutting down. The app running on the “owner” user is no longer functioning, so the device “interactive” state should be “off”, since it’s no longer interactive.
The “other” profile doesn’t have HA installed, and doesn’t need to have it installed (for my purposes). Even if it did, it would be considered a separate “mobile app” device with separate entities anyway and it wouldn’t impact the same sensors as the “owner” user’s app.
I guess I could rig up some automation to synchronize the state between the two sets of entities, but that seems like a hacky solution.
I don’t expect the sensors to update if the device is shut down. I am saying it would be nice if the app could recognize that a shutdown (or user profile switch) was happening, and change the sensors that have to do with interactivity so that they don’t report something that isn’t true, and get stuck that way forever.
I understand that the device could lose power abruptly, and that there’s nothing you can do about that, but an intentional shutdown or a user switch seems like it should be possible to detect.
At the very least, the “interactive” binary sensor should switch to “off” if there hasn’t been any sensor updates detected in X amount of time, instead of waiting for the app to push it to “off” (which it might never do).
you are expecting behavior that is not going to happen the interactive sensor corresponds to the screen state being interactive. that has nothign to do with the logged in user.
the device reports devcie behavior and not user behavior.
yes because you switched profiles and teh app is no longer able to update the server, the app needs to access the server to send updates. Thats how it works and the sensors will not update otherwise.
You keep telling me “that’s how it works”… and I know that’s how it works. How it works is what I am bringing up.
I’m saying that how it works could be improved to make more sense.
Some kind of timeout on the server end where if it receives no sensor updates for some amount of time, to mark the device as no longer interactive.
Even if all of the sensors for the mobile device turned to “unavailable”, it would be better than saying that it is on and active, when it isn’t.
If you have an automation that is checking if the device is being used, and it says “on” when the device is turned off… that isn’t ideal.
I was simply asking if anyone has also dealt with this and what their workarounds are. I thought it would be a good discussion. You telling me “that’s how it works” is not helpful because I know that is how it works, and I’m here complaining about it