TheTimeWalker / wallpanel-android

WallPanel is an Android application for Web Based Dashboards and Home Automation Platforms

Home Page:https://wallpanel.xyz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to deal with Screen on/off

GekoCH opened this issue · comments

commented

Hy

I'm a bit confused how to setup my android to get following function:
I like to wake up the screen via MQTT (this currently works great)
I like to witch off the screen via MQTT (how do I need to set the system settings and the app settings so that I can send the {"wake": false} command to switch the screen off ??)

Thx for any suggestions
Andy

Unfortunalty, it seems not possible right now with the app or I didnt find the way and would love to know.

If it can help, for achieving this, I use another application called Tasker where you send Intent action from other application (for me Home Assistant), Tasker app then catch the intent and do whatever you want, like switching it off.

commented

Unfortunalty, it seems not possible right now with the app or I didnt find the way and would love to know.

If it can help, for achieving this, I use another application called Tasker where you send Intent action from other application (for me Home Assistant), Tasker app then catch the intent and do whatever you want, like switching it off.

Thx, do you send the command from HA over mqtt or how can tasker listen to a command comming from HA?

I send it from HA.

You can send broadcast intents as describing here: https://companion.home-assistant.io/docs/notifications/notification-commands/#broadcast-intent

I forgot to mention that you need Home Assistant Companion (android app) installed on the device.

Here is an example of an intent send to my tablet from HA using a script :

image

Then, in Tasker you need to create a task which would receive this intent and switch off the screen of the device (didnt take time to make screenshot here sorry).
Documentation of Tasker intent : https://tasker.joaoapps.com/userguide/en/intents.html

To come back to the real issue, that Wall Panel can't switch off tablet over HTTP or MQTT :

  • If I get it correctly, in his current state, wall panel dont screen off the device but instead define the sleep time before device automatically switch off the screen of the device.
  • To my understanding, it can be challenging to force screen off of device depending of the Android version and it can require specifics permissions. Also, there is many applications that already support this kind of feature.
  • For a basic usage of the app, switch off the screen is normally not needed as default sleep time of device would eventually switch it off.

So maybe it's more of a feature request here ?

For me, I had some use cases where I wanted to specifically switch off the screen of my wall panel device, which were :

  • Sometimes, maybe caused by camera stuck on detection, my device would not normally screen off ;
  • My wall tablet is near my TV, so when I start to watch something, I wanted to screen off the device in addition to disable camera detection ;
  • When I enable / disable charging of the device, tablet would automattically screen on, so I created a routine to automatically screen off the device after the action.

Hope it can help you and I would love to know how others people have achieved this differently, maybe there is an even easy way !

commented

wow thx a lot for this detailed explanation.

In the mean time I was able to fix it myself.
I have MQTT client and Tasker running on my wallpanel. I even rooted my tablet so I can disable the lock screen. So it is even easier that way since I don't have to "swipe away" the lock screen after waking up the tablet.
Now I can send MQTT commands to the wallpanle that are then executed by tasker like screen on / screen off etc.