Problem with screen off command in galaxy tab

Hello.
Based on the information at Notification Commands | Home Assistant Companion Docs, I tried to work on the presence detection mechanism on the tablet. My galaxy tablet does not have a proximity sensor, so, seeing the cost of managing this with the camera (detecting differences), I chose to work with an external proximity sensor, and set up the scenes of turning on the screen when I approach, and turn it off when I walk away. I did the ignition part with this:
trigger:

  • type: opened
    platform: device
    device_id: xxxxxxxxxxxxxxxxxxxxxxxxxxx
    entity_id: xxxxxxxxxxxxxxxxxxxxxxxxxxx
    domain:binary_sensor
    conditions:
    action:
  • service: notify.mobile_app_sm_t220
    metadata: {}
    data:
    message: command_screen_on
    data:
    command: keep_screen_on
    mode: single
    and it worked perfectly (for testing, I’m using a nearby door opening and closing sensor, I haven’t bought the motion sensor yet). Now, after enabling this scene, the automatic shutdown stopped working (just a comment, I need the shutdown to work when I move away from the tablet).
    So, I set up this scenario to run as soon as I walk away from the tablet:
    trigger:
  • type: not_opened
    platform: device
    device_id: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    entity_id: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    domain:binary_sensor
    conditions:
    action:
  • service: notify.mobile_app_sm_t220
    metadata: {}
    data:
    message: command_screen_off_timeout
    data: 10000
    mode: single
    This is supposed to be, 10 seconds after I walk away (in my test, closing the door), the screen should turn off.
    Well, it doesn’t happen. Can you help me with this, please?

Help us help you

Hello. Apologies for the format of the post (it really looks horrible, once it is published, I missed making a preview). On the other hand, I couldn’t get the thing to work. Even, at one point, the part that was working (turning on the screen) also failed. So I decided to try (and buy) the Fully Kiosk PLUS software (it can be used in demo, but the useful part requires the license). This allowed me to turn the screen on and off very simply, from a homeassistant scene. This software also contains the possibility of, by itself, handling the presence issue (simulating with the camera). But, really, it is quite poor, not because of the product, but because the tablet’s camera does not work properly in the dark (obviously, I bought a cheap tablet, Samsung Galaxy Tab 7 Lite). So I chose to have an external sensor more or less like Tuya (for now, I have the WiFi version, but, it is quite slow due to the number of devices I have on the network, I guess, tomorrow they will deliver the version with Zigbee, which works much better, and takes good care of the battery). Obviously, it’s not what I expected, I think it’s always good to be able to work with gnu components, but, well, here we are talking about Samsung’s “somewhat proprietary” platform, and it is difficult to find the debug tools (I understand that with adb I should be able to solve it, but, well, I have bought my tablet for almost 6 months, to use it as a console, and I urgently wanted my family to be able to manage lights and other elements in a common place, without having to use the cell phone or the “ok google”, which I hope to be able to completely migrate to ha, but, well, everything takes time…
I hope my explanation helps someone else, and worries those who have the power to improve things.

Greetings!