Use Proximity Sensor to Wake Screen on NSPanel Pro and Tuya Smart Home Panels

blakadder
Written by blakadder on
Use Proximity Sensor to Wake Screen on NSPanel Pro and Tuya Smart Home Panels

Use proximity sensor for actions (f.e. screen wake up) on Android 8.1 multi-functional smart control panels running such as NSPanel Pro, T6E, S6E and S8E.

Shopping links in this article are affiliate links and I earn a small commission when you buy through them

This guide applies to touch control panels such as:

  • Sonoff NSPanel Pro (ITEAD Store*, Amazon</a>*)
  • Zemismart T6E (Zemismart store*, AliExpress*)
  • Avatto T6E Central Control Touch Screen (AliExpress*)
  • HiHome T6E Smart Home Control Panel (HIhome EU store*)
  • Tuya T6E Multi-functional Control Panel (Amazon*, Amazon*, AliExpress*)
  • Smatek T6E 4" Whole Home Control Panel (EU Spec. Android 8.1) (Alibaba)*
  • Moes T6E Smart Multi-functional Control Panel (Moes store*, Banggood*)
    • discontinued and replaced with an “Alexa” version that has completely different hardware
  • Tuya S6E Whole Home Control Panel (AliExpress*)
  • Smatek S6E 4" Whole Home Control Panel (Asian Spec. Android 8.1) (Alibaba)*
  • Zemismart S8E 6" Whole Home Control Panel (Zemismart store*, Amazon*)
  • Tuya S8E 6" Multi-mode Gateway Dimmer Switch (AliExpress*, AliExpress*, Amazon)
  • Smatek S8E 6" Whole Home Control Panel (Asian Spec) (Alibaba)*
  • These panels have a light and proximity sensor in top bezel of the display panel but the proximity sensor is misconfigured and cannot not wake the device from sleep when the default panel app is not active.

    Considering it works as expected using the default panel app I determined to discover a solution. After trying standard wave to wake apps and combing through the driver files I learned that the proximity sensor max range is lower than the distance measured when its mounted in the case. After I took the proximity sensor out it worked as it should. The simplest solution was drill a hole in the front. Simplest in this case is not the best solution. I put out a call on twitter for some help from any Android developer but that didn’t go far either.

    Determined to find the solution I set on the hunt for that one perfect app. The journey was arduous and fraught with failure but in the end my google fu dug up the perfect solution:

    Enter Automagic

    Automagic is an automation app, reminiscent of Tasker, with many triggers for automations or, as they’re called in the app, flows. Most importantly it can access proximity and light sensor values which is exactly what is needed

    After Google kicked it off the Play store for being too awesome its development has stopped but the author graciously allowed downloads from the official site. You even get the premium version!

    Installation

    You need to have the ability to sideload apps to your panel via ADB.

    Download the newest version of Automagic.

    Install the apk. Command via ADB:

    adb install Automagic_1_38_0.apk
    

    Open the app and read the… I mean: Skip everything cause we don’t need no damn tutorial!

    You can delete all the included flows and start fresh.

    Proximity Flow

    Download the flow for proximity sensor file to your panel

    adb push flow_Proximity_turn_screen_on.xml /sdcard/Download/flow_Proximity_turn_screen_on.xml
    

    Import it by clicking the hamburger icon and select “Import Flows/Widgets”.

    Import Flow

    Navigate to “Downloads” folder and select the flow file.

    Select Flow

    This is how the flow looks. You can pinch zoom if its too small for you.

    Flow

    Adjust the proximity distance trigger to be above the value shown when nothing is in front of the panel.

    Set distance

    Adjust screen wake options if you wish.

    Screen Duration

    Turn the flow on. If asked allow permissions required by the app.

    If everything is set up correctly the flow with turn red when you trigger the proximity sensor.

    Flow working

    Go to Settings -> Display -> Advanced -> Sleep and set the timeout to turn the screen off. On some panels screen never turns of when it’s set to 15s so use a higher value.

    And now you can simply walk up to the panel or do the Jedi wave for the screen to turn on

    Don’t Stop There

    You can make this basic flow more complex with various conditions to turn it on dimmer during the night and so on.

    Also make sure to explore other automation possibilities of this very capable app, such as the sound level trigger!

    2023 Update New App

    In January 2023 began development of NSPanel Pro Tool, an app directed to making the NSPanel Pro easier to use and aims to replace the Automagic solution.

    Features in v1.0:

    • support wakeup on proximity sensor trigger
    • support wakeup on touch
    • support auto launch application

    Download it from GitHub and sideload to NSPanel Pro.

    blakadder

    Chief shenaniganeer!

    Comments

    comments powered by Disqus