seaky / nspanel_pro_tools_apk

281 stars 4 forks source link

NSPanel Pro Tools Application

This application is a custom developed apk which allows devices running on the

to leverage certain features such as proximity sensor, light sensor, and Home Assistant integration.

Application mainly tested on NSPanel Pro but may works on other devices.

Donate me if you want:

NSPanel Pro NSPanel Pro NSPanel Pro

Table of contents

App Version history

Actual plan is to have a release in every Quarter.

v2.x.0 (2024-xx)

v2.3.0 (2024-0x)

new features

v2.2.1 (2024-06-23)

improvements

bugfixes

v2.2.0 (2024-06-14)

Release is dedicated to:

US FLAG DAY

U.S. Flag day

new features

v2.1.0 (2024-03-15)

Release is dedicated to:

HUN NATIONAL DAY

Hungarian Revolution day

new features (see updated manual Manual 2.x version )

bugfixes

v2.0.1 (2024-01-28)

bugfixes

v2.0 (2024-01-21)

new features (see manual Manual 2.x version )

bugfixes

v1.1 (2023-02-02)

v1.0 (2023-01-22)

v0.8-alpha (ProximityTool)

Sonoff NSPanel Pro

Sonoff NSPanel Pro is a smart home control panel which based on Android 8.1 Oreo (AOSP) system.

NSPanel Pro

Device info: https://itead.cc/product/sonoff-nspanel-pro-smart-home-control-panel/

Device rooting and sideload

Gaining ADB access

[!TIP] With my RootTool app you can update your device

start adb listen:

adb tcpip 5555

list devices

adb devices -l

connect device

adb connect <ip-address>

Usefull ADB commands

connect device

adb connect <ip-address>

list devices

adb devices -l

press home button

adb shell input keyevent 3

press power button

adb shell input keyevent 26

show notifications

adb shell cmd statusbar expand-notifications

install app

adb install <apk>

Install custom launcher

To handle the device more easily, you need to install a custom launcher.

Download UltraSmall Launcher

Install custom webview

If you want to use Home Assistant companion app you must update factory provided webview component.

[!TIP] You dont need to instal Xposed root firmware as blackadder mentioned.

Just simple download com.android.webview_108.0.5359.128.apk or any new version which supporst arm64-v8, armeabi-v7a on firmware above 1.5 Lineageos version can be installed!

WebView 108 for firmware >=1.5

Under frimware version 1.5 you have two options, update firmware by my frimware updater or simply install this resigned version below.

WebView 108 for firmware <1.5

install webview apk

adb install -r <webview>

Install App

Manual 2.x version

[!NOTE] If the version number is marked, then it is only valid for that version.

backward compatibility

version 2.x supports all v1.x features. Except the automatic brightness change which was experimental and replaced by light-level triggered brightness control see [Brightness category] (#brightness-category).

[!NOTE] All configuration for v1.x is obsolete in 2.x therefore 2.x app must be reconfigured before use.

main switch

Main switch allows for the complete disabling of the application's functions. Controls the background activities. Purpose of being able to disable the whole app without uninstall.

display tab

This tab groups all screen or display related configurations and features. Such as how and when to turn on and off or how bright is it. etc


wakeup category


Category for all wake-up related functions.

Unfortunatelly this AOSP 8.1 build does not support wakeup device which causes that if official app is not running the device will go to deepsleep. Due to the lack of power button, just a hard reset (unplug) can wake up the device.

NSPanel Pro

Wake-on-wave

Wake up the device by hand wave.

[!NOTE] Before turning it on, set up the sensor parameters on the sensor tab.

Wake on gesture

Wake up the device by touch gesture. Multiple gestures can be selected the behaviour will be the same it will wakes up the device.

[!IMPORTANT] FW Over 1.10.0 wont support touch gestures.

NSPanel Pro

Wake from ScreenSaver

Dismiss the ScreenSaver if it is active. Only works if wake-on-wave is enabled.


brightness category


Category for all brightness related functions.

NSPanel Pro

Brightness

Set system level display brightness. On certain cases it is used to set if no light change event is triggered.

Brightness on light-below switch

Set brightness to the given value if light-below event is triggered.

[!NOTE] Before turning it on, set up the sensor parameters on the sensor tab.

Brightness on light-below seekbar

Set brightness to the prescribed value.

Brightness on light-above switch

Set brightness to the given value if light-above event is triggered.

[!NOTE] Before turning it on, set up the sensor parameters on the sensor tab.

Brightness on light-above seekbar

Set brightness to the prescribed value.


screen category


Category for all (lcd) screen related functions.

NSPanel Pro

Display sleep

Set system level display sleep time. After the prescribed interval the screen will be turned off if another function does not override it, for example: Prevent turn off or Screen begin

Display sleep mode

Defines the sleep mode behaviour

Screen-on time swicth

During a predefinied period it turns on the screen and it remains on untile the end of the interval.

Screen-on begin on weekdays

The time when the screen-on begins on weekdays.

[!TIP] If both begin time and end time is "00:00" it will be disabled or ignored If the weekend is disabled, weekdays will jump over weekends. So after friday the monday will be scheduled. If the weekend is enabled, after friday the weekend intervall will take effect.

Screen-on end on weekdays

The time when the screen-on ends.

Screen-on begin on weekends

The time when the screen-on begins at weekends

[!TIP] If both begin time and end time is "00:00" it will be disabled or ignored If the weekdays is disabled, weekends will jump over weekdays. So after sunday the next saturday will be scheduled. If the weekdays is enabled, after sunday the weekdays intervall will take effect.

Screen-on end on weekends

The time when the screen-on ends.

NSPanel Pro

sensor tab


sensor proximity category


Category for proximity sensor related functions.

NSPanel Pro

Proximity sensor

Proximity sensor live value shows actual sensor value and shows the trigger when it is activated.

Proximity sensor trigger threshold

Above the value the trigger event will be create


sensor light category


Category for proximity sensor related functions.

NSPanel Pro

Light sensor

Light sensor live value shows actual sensor value and shows the trigger when it is activated.

Light sensor trigger below

Below the value the trigger event will be created

Light sensor trigger above

Above the value the trigger event will be created

tools tab


autostart category


Autostart or launch other app after device restart

NSPanel Pro

Launch App after reboot

Launch selected application after device reboot

Wait for WIFI

Start selected application after WIFI connection is established

Whatchdog

Monitoring selected app daily if it is not running, then it starts it.

Switch to app

Switch to selected application

system ui (in 2.2.0)


NavigationBar

Always shows the system level navigation bar.

NavigationBar on swipe up

Available if NavigationBar is turned off. An edge swipe up enables the navigation bar for X seconds.

NotificationBar on swipe down

Shows the system level notification bar by edge swipe down. Originally it is disabled in Sonoff system.

other


NSPanel Pro

Switch to launcher

Switch to default launcher

Home on gesture

The selected gesture will switch back to this application.

integration tab


NSPanel Pro

zigbee category


Not yet available planned to v2.2

mqtt category


Category for MQTT and HomeAssistant related settings

State

The current state of the connection.

Possible states:

Setup

Setup MQTT Connection

Enabled

If turned off the connection will be dissconnected

MQTT Setup

NSPanel Pro

Enabled

If turned off the connection will be dissconnected. Turn on only if you setup connection parameters correctly

Connection status

The current state of the connection.

Publish events

You can select the messages you want to publish on this channel. Only publish those that you really need.

Currently supported events:

Host

MQTTv3 server host name only non-SSL is available in v2.1

Port

MQTTv3 server port only non-SSL is available in v2.1

ClienId

MQTTv3 client id

Username

Configured username

Password

Configured password

Use Hostname as Device Id

Automaticall generated Device Id is not quite human friendly, Hostname can be used as deviceid.

[!IMPORTANT] Hostname must be set

Device Id

Unique device id

HA Integration

Enables MQTT Integration based integration, events and diagnostics are implemented.

NSPanel Pro

HA Integration

If enabled it sends configuration message to the proper topics

[!TIP] In case of configuration trouble, off-on will reconfigure the HA endpoint

Topic prefix

Topic prefix usually homeassistant the default

settings tab


general category


NSPanel Pro

Audio feedback

Plays audio on certain events such as identified touch gestures on in order to provide audio-based feedback.

Resume on boot

Autostart NSPanelTools app after device restart

Reboot device

This option reboots the device

Hostname

Changes the device hostname

debug category


NSPanel Pro

Debug mode

Changes log level to debug

Verbos mode

Changes log level to verbose

View log

Display app log

Home Assistant integration

Integration based on HA official MQTT module.

[!IMPORTANT] Currently MQTT Support only non SSL connections.

Configured device data:

Device entities are unique thus generated entity name can be renamed anytime.

Entities

If an event has not been sent the value is unknown

Diagnostic Sensor

Proximity Event

Sends event when the proximity sensor trigger is occured. Event values:

Touch Event

Sends event when the touch event is triggered.

[!IMPORTANT] Touch events can only be triggered when the screen is off.

Event values:

Light Event

Sends light sensor triggers is occured. Event values:

Command topic (v2.2)

Example configuration

Device config

HASS Example uses-cases

Automation sample yaml

description: "bedroom nspanel2 automation"
trigger:
  - platform: state
    entity_id:
      - event.nspanel2_touch
    attribute: event_type
condition: []
action:
  - choose:
      - conditions:
          - condition: state
            entity_id: event.nspanel2_touch
            attribute: event_type
            state: swipe_up
        sequence:
          - service: cover.open_cover
            target:
              entity_id:
                - cover.rollershutter_0013
              device_id: []
              area_id: []
            data: {}
      - conditions:
          - condition: state
            entity_id: event.nspanel2_touch
            attribute: event_type
            state: swipe_down
        sequence:
          - service: cover.close_cover
            target:
              entity_id: cover.rollershutter_0013
            data: {}
      - conditions:
          - condition: state
            entity_id: event.nspanel2_touch
            attribute: event_type
            state: swipe_right
        sequence:
          - service: cover.stop_cover
            target:
              entity_id: cover.rollershutter_0013
            data: {}
mode: single

Manual 1.x version

main switch

Switch controls the background activities. Purpose of being able to disable the whole app without uninstall.

wake up

Unfortunatelly this AOSP build does not support wakeup device which causes if official app is not running the device will go to deepsleep. Due to the lack of power button, just a hard reset (unplug) can wake up the device.

Wake up on wave and touch feature are implemented in the app btw that was the original purpose of the app.

launch

This feature enables to run an application as a default app such as HomeAsistant.

light

This feature enables utilization of light sensor.