Lockdown Android "Device Control" Panel?

I have a custom dashboard setup that home assistant provides to the built-in device control feature in Android 14. I applied kiosk mode to this which works fairly well.

My inquiry is about securing this panel better, since it’s available when the phone is locked (as desired).

Is there any way for home assistant to differentiate between a dashboard being viewed by the device control panel versus within the companion app? That would be an ideal situation as we could use browser mod or kiosk mode to lock it down further.

Otherwise, I’m thinking that I need to create a dashboard specifically for this use that is fully locked down. I already have that for the main view, but it links to some other views that are not as locked down.

The end goal being that I have to manage less individual dashboards that are basically duplicates of each other except some are more restricted. I figured out how to do this between users, but since this is all on my admin user it has some loopholes that could be exploited.

Thanks!

I’m working on something similar, however I have not gotten as far to implement this yet, so I cannot guarantee it’ll work. Anyhow, what I was planning to do:
The mobile app supplies a sensor for whether your device is locked (binary_sensor.device_name_device_locked, you may need to turn it on within the app). This updates when you open the app, I believe, as well as when you open the device control panel, since that also opens the app. If you open it from the device controls, sensor will still indicate the device is locked (since it is), but not when you’ve opened the panel from within the app, or from the status bar device controls for example.

And then add the block_mouse option to the kiosk_mode config like so:

kiosk_mode:
  entity_settings:
    - entity:
        binary_sensor.device_name_device_locked: 'on'
      block_mouse: true

Again, not 100% sure if this will work. If it does (or doesn’t) let me know so I’ll know for my own dashboard :sweat_smile:

1 Like

Thanks, that’s a good idea. I’ll give that a try when I’m on the PC.

It seems like it would work, I guess it’s just a matter of how reliable the sensor’s update is.

Oh, next question. Are you aware if it’s possible with kiosk mode to use different sensors for different users?

I haven’t moved my wife’s phone away from the standard device control panel to a home assistant panel, but I’d like to, and I’d prefer to use the same views for her, however it obviously couldn’t be based on my phone’s sensor.

From my testing it’s quite reliable with updating, though maybe that’ll differ depending on the settings you use for updating sensors. However since you open the app anyways, I believe it should be decently fast to up date.

From what I could see on the github page it’s not possible to combine entity settings with user settings sadly. Maybe you could open a feature request on the github page for it? I don’t think it’s possible to use templates within the configuration either, since it’s not in cards…

Right on.

Dang, that was my conclusion too. I made a question over there about it, but if it’s the same as some other similar inquiries it sounds like it’s a pretty major re-write of the project logic.

Ah that would be a shame! My only idea otherwise would be to do something with incorporating Javascript code, since that would make hass.user accessible.

Another idea I had was the restriction card. You could use this with a state switch perhaps (since that can switch based on user), although I do not know if it’s possible to use it as just a condition. If you’d need to incorporate all cards within it, you’d still basically be making two dashboards for the both of you :sweat_smile: