Dashboard button to switch off ipad screen?

I am about to wall mount an iPad as a Home Assistant dashboard. I’ve tested out the trick of having a motion sensor wake the ipad up, using homekit notifications in Guided Access mode. it works fine.

However, it is very annoying to have the ipad screen lit for X minutes after I’m done using the dashboard (wife acceptance factor), and I’d like to have a button in my Home Assistant dashboard to switch the ipad screen off (ie turn the ipad into sleep mode).

Assumingly it is not possible to control the ipad screen from remote (from the HA server), but I’m pretty sure the Home Assistant iOS app would be able to locally put the screen to sleep on the device the app is running on.

Is this already possible, or can it be considered for future development?

It would be simpler if you activated voice control and left it on and just tell your iPad to Lock Screen.

But if you need a dashboard button, first you need a Bluetooth keyboard, then it could be achieved by activating Bluetooth keyboard in accessibility in iPad settings, changing Lock Screen command there to one of the home assistant keyboard integration key presses , then installing keyboard integration of home assistant (not remote keyboard) and then finally installing

And after configuration of the emulated keyboard you’ll be using a dashboard button to press a Home assistant keyboard integration key that will send the key press through the emulated keyboard to your iPad to finally lock it.

Thanks! i will look into it