[PROJECT] SONOFF NSPanel Pro API Driver

Overview:
This driver is intended to provide basic access to a SONOFF NSPanel Pro's API. The goal is to allow Hubitat to incorporate what information the panel has available as well as allow for some control (as possible/feasible).

Features:

  • Check for devices connected to the panel
  • Play panel's built-in sounds upon command
  • Allow commands to control some panel functions such as brightness, whether the panel screen is on, and play various sounds through the panel speaker
  • Daily check for new driver versions. It will NOT load updated drivers, just post an event that a newer version is available.

Driver Links:

Setup:

  1. Add the driver as a new user driver
  2. Add a Virtual Device for the parent
  3. Go to the device's Preferences section and enter the Panel's IP/Hostname BUT DO NOT SAVE YET (OPTIONAL: You can also pre-set the Refresh Rate and other Preferences)
  4. On the panel itself, go to Device Settings then About.
  5. Tap the Name label (on the left, so it does not trigger renaming the device) 7 times until you see the "Allowed to generate gateway access token" message popup on the panel
  6. Go back to the device's Preferences on the Hubitat screen and Save Preferences

Caveat(s) / Known Issue(s):

  • Only minimal functionality at this point. Primarily allowing the built-in sounds to be controlled.
  • Refresh Rate is pretty much pointless because there is nothing it currently polls from the panel. Checks for new child devices (not that it does anything with them yet) and the overall panel info are done as part of the DailyCheck because they should not change that frequently.
4 Likes

This will be a great addition to Hubitat!

Is it a local or cloud API?

As we speak, I am in a middle of setting up ESPHome on a regular NSPanel (not a Pro).
The capability of this project is enormous but I will be using less than 10% of potentials.
My whole idea is to create some sort of Scene Controler with only 6-8 Buttons with
ability to label them electronically. I.e each Button will have an appropriate Icon and
Label. It will be a replacement for the ZEN32 panels which are doing nice job but labeling
Buttons is next to impossible. So far do good. One panel already running ESPHome and
integrated with HE via HA+HADB. Next step should be easy enough to add Labels and
Icons for each Button.

I also played with NSPanel Pro. It could be easely hacked to run plain Android. After that
it is possible to run Android based Dashboards. This was working just fine but I didn't like
a Pro version first, because of shape and second - it. does not have any relays. The original
one actually has two relays and two physical button which could be used either completely
independently or physical buttons can control relays.

So, Pro ver SD ion will be returned but regular one is my choice for highly customizable
Scene Controller with two relays.

Happy New Year!

The API is local to the panel itself, which is why I was willing to get one I found on sale. Plus it has an optional desktop mounting stand that did not look too bad and was cheap, so I will not have to put it on a wall.

1 Like

I saw the standard one also... but that did not appear to have an API. I REALLY do not need any more switches, relays, or anything of the sort. But, something with a display is always interesting (do not even get me started on some PAST projects I have taken part in). The Pro display looked a bit larger and the ability to be able to directly interact with it right from the Hubitat was interesting to me.

I have a bunch of ESP-related (ESP8266 mostly) devices that I wrote simple code for and then Hubitat drivers, mostly for Christmas light pixel-related projects. But I have not had much interest in ESPHome.

In opposite, I was looking for something which could go right into the existing switch box.
Pro will be difficult to mount but regular is designed for wall mounting application.

1 Like

So my and yours requirements are very different. As I mentioned, I am interested in wall
mounted Scene Controller like ZEN32 but with ability to easy add custom Icons and Labels.
Regular NSPanel is exactly what I need. Setup is a bit tricky but it worth it. And control of
course, is 100% local. This is an absolute must.

1 Like

I am looking for something similar. Let me know if I could shadow your implementation.

Please be aware, the project is DIY and requires some learning and effort to implement it.
But in my opinion, the result is very nice and definitely worth it. I already almost configured
one NSPanel for replacing ZEN32 in the Living Room and already ordered second panel.
(At this time I will need only two panels.)
Here is a link to the project:

And here is a link to the NSPanel (from Walmart):
https://www.walmart.com/ip/SONOFF-NSPanel-Smart-Switch-Thermostat-Function-2-Switch-Panel-Home-Control-Touchscreen-Control-Work-Alexa-Google-Assistant/2455899511

In addition you will need a running version of Home Assistant. And for the integration with
HE you will nee Home Assistant Device Bridge. On the Home Assistant I created a bunch of
Virtual Switches (number depend on a desired number of buttons). The same Virtual Switch
instance is used to Display a Button on the NSPanel and as a Switch to be used in the
HE RM Rules. NSPanel has two built-in relays and two physical buttons. All they are accessible
from HE RM.
After I finish panel configuration for the Living Room I will post few pictures.

Might be better to start a separate project thread and detail it there for people that are interested in following along with you on that.

I guess, you are 100% right.

Especially with the HA portion, I know there are a lot of people that use a combination of both systems so that might catch some people. Plus it always seems like people are looking for more ways to display their information at a glance so that would catch attention as well.

1 Like

@snell Thanks for sharing. How's your experiment and any driver?

I got some basics running so I need to remember to post at least the initial version soon. That way people can at least have it make noises at them.

Hi there! Any further update on this? Thanks!

Heh, a 2025 item... No, I have not done anything more with it really. It sat at the side running all this time but never really took over for my tablet running HD+ so I basically forgot about it. Looking back though I am surprised I never even published the basic one that allowed controlling the sounds.

I guess I should dust it off and take another look over time. In the meantime, I will get my current driver posted. I picked it up and am letting it do updates. I will confirm the stuff I had working before still works, then get the driver published.

INITIAL VERSION POSTED:

  • NSPanelProAPI.groovy - Initial version now posted in original thread message

INITAL FEATURES:

  • Can play the various built-in sounds that the panel is capable of
  • Can get some basic panel info
  • Will check my website daily for any driver update and post notice if there is one

NOTE(S):

  • This is initially being posted with the NS Panel Pro at firmware version 3.7.0. Back when I first started creating the driver so long ago... things worked a bit differently (and this driver did not work after I updated). So there is a chance that future firmware could break it. If such issues are found they will be worked through and posted.

Thanks for your work on this. Which panel with your driver work with? Are these compatible:

https://www.aliexpress.us/item/3256807185165634.html?search_direct=true&spm=a2g0o.productlist.0.0&gatewayAdapt=glo2usa

https://www.amazon.com/SONOFF-Integrate-Security-Monitoring-Thermostat/dp/B0D848YHDT/ref=asc_df_B0D848YHDT?mcid=732036e7aef43d119d77aff6371b9f5c&tag=hyprod-20&linkCode=df0&hvadid=724230361136&hvpos=&hvnetw=g&hvrand=18354998892597794910&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9192544&hvtargid=pla-2383253731828&psc=1

The driver is designed for the SONOFF NSPanel Pro which I personally have and can try out functions with.

It should work with the SONOFF NSPanel Pro 120 as this appears to be a newer, larger, more advanced version of the Pro. The official page does list the Open API as well (this is an edit, as when I checked originally I did not see it/find it, but when I rechecked a minute ago I saw it and discovered it is an image, which is why Find did not show it).

I have no idea if it would work with the SONOFF NSPanel. It certainly will not understand the buttons (if it works at all) as the API does not cover them (probably because the API was created specific to the NSPanel Pro which lacks them. The itead.cc product page does not mention an API (but it does not for the NSPanel Pro either).

Updated Version(s):

  • NSPanelProAPI.groovy = 0.1.2

Change(s):

  • Added command to control screen brightness (0 to 100) or set for auto (value outside the range)
  • Added command to control system volume (0 to 100)
  • Added command to control screen auto-off/auto-lock duration (15 to 1800 seconds) or turn off (value outside the range)
  • Added command to reboot the system (requires typing "reboot" in the field to confirm)

Caveat(s)/Known Issue(s):

  • The set commands do not appear to work when the system settings menu is open, only when the normal screens are showing.
2 Likes