Skip to content

Bierchermuesli/ansibel-nspanel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

NSPanel Pro - Ansible Update Playbook

Standing on the shoulders of giants. This playbook would not exist without the foundational work of @seaky (NSPanel Pro Tools), @CFenner (NSPanelPro-Config), and @blakadder (sideload guide). Full credits in Sources.

Ansible playbook to update and debloat Sonoff NSPanel Pro devices over ADB. Supports multiple panels in one run.

What it does:

  • Connects to each panel via ADB and prints device info (model, Android version, build)
  • Fetches the latest NSPanel Pro Tools APK from GitHub releases
  • Fetches the latest Home Assistant Companion (minimal) APK
  • Downloads APKs once, installs to all panels in parallel
  • Removes known bloatware packages via pm uninstall --user 0

Requirements

  • Ansible >= 2.12
  • adb installed on the controller (apt install adb / brew install android-platform-tools)
  • ADB enabled on each NSPanel Pro (Settings → Developer options → USB debugging, then adb connect <ip>:5555)
  • NSPanel Pro must already be rooted / have developer mode unlocked — see sources
  • Tested on NSPanel Pro firmware 1.7.0 and 3.0.0 (likely works on newer versions too)

Setup

1. Clone / copy this folder

git clone https://github.com/your-user/nspanel-pro-ansible
cd nspanel-pro-ansible

2. Create your inventory

Copy the example and fill in your device IPs:

cp inventory.yaml.example inventory.yaml
# inventory.yaml
all:
  children:
    nspanels:
      vars:
        adb_port: 5555
      hosts:
        nspanel-living-room:
          adb_host: 192.168.1.100
        nspanel-bedroom:
          adb_host: 192.168.1.101

3. Enable ADB on each panel

Settings → Developer options → USB debugging, then pair once manually:

adb connect 192.168.1.100:5555   # accept the prompt on the panel screen

The playbook handles connection, device detection, and disconnection automatically from there.


Usage

Update all panels (latest release):

ansible-playbook -i inventory.yaml nspanel-update.yaml

Update a single panel:

ansible-playbook -i inventory.yaml nspanel-update.yaml --limit nspanel-living-room

Pin to a specific NSPanel Pro Tools version:

ansible-playbook -i inventory.yaml nspanel-update.yaml -e "nspanel_tools_version=v2.3.3"

Dry-run (check mode) — shows what would change without touching devices:

ansible-playbook -i inventory.yaml nspanel-update.yaml --check

Packages removed (debloat)

The following packages are removed with pm uninstall --user 0 (non-destructive — can be restored with a factory reset). Source: CFenner/NSPanelPro-Config.

Package Description
com.rockchip.devicetest Device testing utility
com.android.gl2jni OpenGL test app
com.eWeLinkNSPro.dev eWeLink development build
com.smatek.test Generic test app
acr.browser.barebones Bare-bones browser
com.android.music Stock music player
com.DeviceTest General device test tool
com.cghs.stresstest Stress test app

Example output

Full playbook run — 2 panels, click to expand
ansible-playbook nspanel-pro/nspanel-update.yaml 


PLAY [Update NSPanel Pro devices] ******************************************************************

TASK [Create APK download directory] ***************************************************************
ok: [nspanel1.home.example.com -> localhost]

TASK [Fetch NSPanel Pro Tools release info] ********************************************************
ok: [nspanel1.home.example.com -> localhost]

TASK [Find NSPanel Pro Tools APK asset] ************************************************************
ok: [nspanel1.home.example.com -> localhost]

TASK [Fetch HA Android release info] ***************************************************************
ok: [nspanel1.home.example.com -> localhost]

TASK [Find HA Companion minimal APK asset] *********************************************************
ok: [nspanel1.home.example.com -> localhost]

TASK [Show versions to be installed] ***************************************************************
ok: [nspanel1.home.example.com -> localhost] => {
    "msg": [
        "NSPanel Pro Tools: v2.3.4Beta3 — nspanel-pro-tools-2.3.4-beta3-release.apk",
        "HA Companion:      2026.3.2 — app-minimal-release.apk",
        "WebView:           not in release, skipping"
    ]
}

TASK [Download NSPanel Pro Tools APK] **************************************************************
ok: [nspanel1.home.example.com -> localhost]

TASK [Download WebView APK] ************************************************************************
skipping: [nspanel1.home.example.com]

TASK [Download HA Companion APK] *******************************************************************
ok: [nspanel1.home.example.com -> localhost]

TASK [Include ADB install tasks] *******************************************************************
included: ../nspanel-pro/tasks/nspanel_adb_install.yaml for nspanel1.home.example.com, nspanel2.home.example.com

TASK [Connect via ADB] *****************************************************************************
reference_appendices/interpreter_discovery.html for more information.
changed: [nspanel2.home.example.com]
changed: [nspanel1.home.example.com]

TASK [Wait for device to be ready] *****************************************************************
changed: [nspanel2.home.example.com]
changed: [nspanel1.home.example.com]

TASK [Wait for device to be ready] *****************************************************************
changed: [nspanel2.home.broccoli.rocks]
changed: [nspanel1.home.broccoli.rocks]

TASK [Gather device info] **************************************************************************
ok: [nspanel2.home.broccoli.rocks] => (item=ro.product.manufacturer)
ok: [nspanel1.home.broccoli.rocks] => (item=ro.product.manufacturer)
ok: [nspanel2.home.broccoli.rocks] => (item=ro.product.model)
ok: [nspanel1.home.broccoli.rocks] => (item=ro.product.model)
ok: [nspanel2.home.broccoli.rocks] => (item=ro.build.version.release)
ok: [nspanel1.home.broccoli.rocks] => (item=ro.build.version.release)
ok: [nspanel2.home.broccoli.rocks] => (item=ro.build.version.sdk)
ok: [nspanel1.home.broccoli.rocks] => (item=ro.build.version.sdk)
ok: [nspanel2.home.broccoli.rocks] => (item=ro.build.display.id)
ok: [nspanel1.home.broccoli.rocks] => (item=ro.build.display.id)

TASK [Device info] *********************************************************************************
ok: [nspanel1.home.broccoli.rocks] => {
    "msg": [
        "Manufacturer : rockchip",
        "Model        : px30_evb",
        "Android      : 8.1.0 (SDK 27)",
        "Build        : 3.0.0"
    ]
}
ok: [nspanel2.home.broccoli.rocks] => {
    "msg": [
        "Manufacturer : rockchip",
        "Model        : px30_evb",
        "Android      : 8.1.0 (SDK 27)",
        "Build        : 1.7.0"
    ]
}


TASK [Install WebView APK] *************************************************************************
skipping: [nspanel1.home.example.com]
skipping: [nspanel2.home.example.com]

TASK [Install NSPanel Pro Tools APK] ***************************************************************
changed: [nspanel1.home.example.com]
changed: [nspanel2.home.example.com]

TASK [Install HA Companion APK] ********************************************************************
ok: [nspanel1.home.example.com]
changed: [nspanel2.home.example.com]

TASK [Install results] *****************************************************************************
ok: [nspanel1.home.example.com] => {
    "msg": [
        "WebView: skipped",
        "Tools:   Performing Streamed Install\nSuccess",
        "HA:      Performing Streamed Install"
    ]
}
ok: [nspanel2.home.example.com] => {
    "msg": [
        "WebView: skipped",
        "Tools:   Performing Streamed Install\nSuccess",
        "HA:      Performing Streamed Install\nSuccess"
    ]
}

TASK [Remove bloatware packages] *******************************************************************
ok: [nspanel2.home.example.com] => (item=com.rockchip.devicetest)
ok: [nspanel1.home.example.com] => (item=com.rockchip.devicetest)
ok: [nspanel2.home.example.com] => (item=com.android.gl2jni)
ok: [nspanel1.home.example.com] => (item=com.android.gl2jni)
ok: [nspanel2.home.example.com] => (item=com.eWeLinkNSPro.dev)
ok: [nspanel1.home.example.com] => (item=com.eWeLinkNSPro.dev)
ok: [nspanel2.home.example.com] => (item=com.smatek.test)
ok: [nspanel1.home.example.com] => (item=com.smatek.test)
ok: [nspanel2.home.example.com] => (item=acr.browser.barebones)
ok: [nspanel1.home.example.com] => (item=acr.browser.barebones)
ok: [nspanel2.home.example.com] => (item=com.android.music)
ok: [nspanel1.home.example.com] => (item=com.android.music)
ok: [nspanel2.home.example.com] => (item=com.DeviceTest)
ok: [nspanel1.home.example.com] => (item=com.DeviceTest)
ok: [nspanel2.home.example.com] => (item=com.cghs.stresstest)
ok: [nspanel1.home.example.com] => (item=com.cghs.stresstest)

TASK [Disconnect ADB] ******************************************************************************
ok: [nspanel1.home.example.com]
ok: [nspanel2.home.example.com]

PLAY RECAP *****************************************************************************************
nspanel1.home.example.com : ok=16   changed=3    unreachable=0    failed=0    skipped=2    rescued=0    ignored=0   
nspanel2.home.example.com : ok=8    changed=4    unreachable=0    failed=0    skipped=1    rescued=0    ignored=0   


ADB cheatsheet

Replace <ip> with your panel's IP. Omit -s <ip>:5555 if only one device is connected.

Connection

adb connect <ip>:5555           # connect
adb disconnect <ip>:5555        # disconnect
adb devices -l                  # list connected devices
adb -s <ip>:5555 shell          # open interactive shell

Input — text & keys

adb shell input text "mypassword"         # type text (no spaces; use %s for space)
adb shell input tap 540 960               # tap at x,y coordinates
adb shell input swipe 100 500 900 500     # swipe left→right

Input — keyevents

Command Keycode Action
adb shell input keyevent 3 HOME Go to home screen
adb shell input keyevent 4 BACK Back button
adb shell input keyevent 26 POWER Toggle screen on/off (wake or sleep)
adb shell input keyevent 82 MENU Open menu
adb shell input keyevent 224 WAKEUP Turn screen on (no toggle)
adb shell input keyevent 223 SLEEP Turn screen off (no toggle)
adb shell input keyevent 187 APP_SWITCH Recent apps

Apps & packages

adb shell pm list packages                          # list all installed packages
adb shell pm list packages | grep ewelink           # filter by name
adb shell pm uninstall --user 0 com.example.app     # remove package (non-destructive)
adb install -r app.apk                              # install / update APK
adb shell am start -n com.example.app/.MainActivity # launch an app

Screen & display

adb shell settings get system screen_off_timeout    # get screen timeout (ms)
adb shell settings put system screen_off_timeout 60000  # set to 60 seconds
adb shell screencap -p /sdcard/screen.png && adb pull /sdcard/screen.png  # screenshot

System

adb reboot                                          # reboot device
adb shell getprop ro.build.version.release          # Android version
adb shell getprop ro.product.model                  # device model
adb logcat -s nspanel_pro_tools:V                   # filter logs for NSPanel Pro Tools

Sources

Huge thanks to the people who did the hard work of reverse-engineering, documenting, and building tooling for the NSPanel Pro ecosystem — this playbook is just automation glue on top of their efforts.

Project Author Contribution
seaky/nspanel_pro_tools_apk @seaky NSPanel Pro Tools app — gesture wake, MQTT, Zigbee, HA integration
CFenner/NSPanelPro-Config @CFenner Debloat package list and device configuration guide
home-assistant/android Home Assistant HA Companion app
blakadder.com/nspanel-pro-sideload @blakadder Initial ADB setup, rooting and sideloading guide
DeepWiki installation guide Installation overview

About

Ansible tasks to Install / Update NSPanel Pro for Home Assistant

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors