NSPanel support

Hi guys,
Is there anyone that knows how to get the newly introduced Sonoff NSPanel working with Homey?

I recently got an NSPanel, and flashed Lovelace UI onto it:

It should be possible to get it working with Homey, although it would require some MQTT dialogs back and forth to handle certain requests. For instance, if the screensaver is on, and I touch the screen or a button, a MQTT message is published, which needs to be replied to by the host, to “unlock” it and launch a specific page.
The only approach I can think of is doing this via some advanced flows that listen to the MQTT messages and respond to it accordingly. I’ll see if I can cook up a simple proof of concept tomorrow.

Update, some first steps, controlling the device via MQTT client.

What this does:

  • update time every minute (and once after startup)
  • update date once a day (and once after startup)
  • acknowledge the device after startup and switch to screensaver

Communication is based upon nspanel-lovelace-ui/HMI at main · joBr99/nspanel-lovelace-ui · GitHub, I’ll extend from here and share my experiences.

Edit, updating the flow so the screensaver gets weather info. The icon for current weather is placed into a text variable, so it can be used in the message. I have to add many more variables and “AND” statements to get all the stuff I want, but the good news is: it’s not impossible to get this thing working with Homey!

Todo:

  • Fill the “screensaver” with data.
  • Return to the screensaver after moments of inactivity
  • Turn the screen off when there’s no-one in the room.
  • Add a page to control the lights in the livingroom (buttons for scenes, and sliders for brightness/temperature)
  • Add a page that shows information like the personal agenda of the house (garbage being picked up today, stuff like that)
  • Showing important notifications (like: water leak alarm triggered or so)
  • Hopefully I’ll also be able to show a camera snapshot when the doorbell is ringing.
  • Ideas are welcome!

Dear @Chillout ! I am very interested in this project, did you manage to continue? Will it work with a bridge?

I am making small progress, one feature at a time.
I have no idea how the bridge works, but if it can run mqtt client you should be fine.

The bridge doesn’t run anything locally, only in the cloud.

Hi,

I’m also playing with this.

I have some questions:

  1. When changing a device from another place, like turning a light on with your telephone, is it necessary to reload the whole page on the NSPanel or can only the switch be changed?
  2. Is it possible to paint the pictures from the Homey-app on the NSPanel screen or is it necessary to make a new .tft file with the pictures already in it?
  3. How to get the weather forecast on the screensaver?

Thanks in advance.

h3n3

Anyone working with this anymore? It’s work in progress and nothing yet published, but I have been working on with app for nspanel. It’s based on Tasmota MQTT App, and for the moment it can handle pretty much same that is on the flow shown by @Chillout except notifications; There’s actions for updating weather with json (and I also have a homeyscript that can be used to fetch weather from openweather’s service) and another one to update just indoor temperature with selected value. Maybe I should add same for outdoor temperature as well, since you might want to fetch current temperature locally. There’s auto update for date and time, and I have converted Lovelace UI’s icon dictionary to map for js. I also have a primitive rgb → rgb565 function for colors, but that’s still work in progress; nothing so far is using it.

Like I said, I haven’t pushed anything yet to GitHub, but my time is limited - so I am looking for people who would want to contribute with the project. This is very complex “protocol” and method of controlling the device; but if you could make it work easily, for example with flows - or with a designer like Lovelace ui(sounds like too much work), I think this would be superb.

Personally I plan to use device to display weather information, but also a timer and status display for alarm (30 seconds going down when alarm is enabled, and panel saying armed or something like that when alarm is on) - one could make a keyboard for de-activating alarm as well, but I already have frient’s keypad for that…

Some progress on app; I had to begin re-writing it from fresh, but finally I have reached progress that my previous version had, and some more; app updates time and date automatically and then some; Initially screensaver comes up with time, but in few seconds it adds forecast to it, indoor temperature can be retrieved from panel’s own temperature sensor - or it can be set from other source with flow as well.

Panel’s device page has switches and their state’s + you can change state from there, on the sensor page, you get firmware version, temperature sensor’s value and region for now.

There is no automatic retrieval of forecast- it’s left for user; There’s 2 ways to do this, with simple json:
{'weather': [{'icon':'11d', 'temp': 21.3}, ..]} where array is parsed for maximum of 4 objects, first object is today.. Or you can use secondary action that accepts OpenWeatherMap’s OneCall API 3.0, which I will not start describing here, anyway - I excluded minutely, hourly and alerts and chose metric units - and retrieved JSON can be sent to NSPanel as is-

So, my flow is quite a lot simpler than previously introduced one;


In this picture, both; retrieval and updating of weatherData and sending to nspanel is handled both in very little effort. What I forgot, was to make it update weather on panel, when weatherData is updated - but that’s very simple to add, there is condition “is panel online”, that can be checked after storing weatherData, and then link to same sending of data to Panel.

Offline and online events on panel are detected. For the moment - only screensaver/forecast screen is supported; there is support for top left and top right icons in code, but no flow yet for using it.

I have plans to make triggers such as “exited screensaver”, that you could combine with action such as “show alarm_pane with settings {json}” or something similar and some kind of simple format for those settings; which of course, would be different for every page type, but would make it a lot easier than using through Tasmota mqtt…

I thought this had automatic dimming; well, no it doesn’t, so that should be also done as a flow, like “screensaver activated” → “start timer for 120seconds” → “set brightness to 0”

But it’s a long road to do all alone.

Updates have been made; had to start from somewhere, so I decided to take a rather simple page, QRCard- I have added new flows.. So here goes..

This gives me:

screensaver btw looks like this:

I have gotten dimming to work, screensaver and deep sleep (brightness 0) are still work in progress, as are every other cards also. And navigation (arrows on top at qrcode page), also do not work yet, well, quite obvious since I for the moment have only 1 page type…

Oh, entity parser (check from page update config on flow screenshot), works and supported entities light, switch, text and button are all supported. Icons are material icons show icon names/previews are available online - also of course, source code has same list. I noticed there were some icons that are either renamed from material icons or extras (weather related icons) but mostly, it’s material icons index keys.

EDIT:

  • screensaver color theme copied from ha config
  • screensaver, dimming and return from screensaver works now
  • media player page and it’s config update definition has completed
  • power page is complete with config update definition

Next plans:

  • navigation (arrows or custom icons on top left and right corners)
  • notifications
  • rest of the cards: entities, grid, thermostat, alarm/unlock,
  • actions (press button/switch/light on screen, adjust slider, etc and allow setting flow action to it)

Any thoughts? It’s been a good start.. Soonish I think I might be ready to publish a development version to GitHub, I was wondering… If there’s anyone interested in participating, this is quite a lot of work and I think little help wouldn’t be a bad thing at all..

When it’s finished, you could use this for many things - such as a thermostat replacement (at least for water heating), alarm panel… Or just a simple thermometer with weather prediction.. Well, you could do quite many things. I was also interested in esphome blackymas version, graphics are so much better, it was also do-able; but it’s much more complex and not actually designed for dynamically changing content (for example, you could change “grid” page to match selected conditions) - and I also think that I’ve done a huge job with this, so let’s not give everything for just one man..

Nice work! Would love to test it with the lovelace UI that I’m currently using.

I Don’t understand how you get the weather on the screensaver. I got the time and date working…

Terribly sorry for my absence. I had (and have) a family related problem, so I haven’t worked on this for a long time, and probably won’t (interest is in other things).

But, to allow further development, I will share my work- it is available here: GitHub - oskarirauta/homey-nspanel-app: incomplete nspanel implementation (not nspanel pro)

Contributors, etc happily accepted :slight_smile:

Is there still interest in this project. I have a new version (not pushed yet) - it is rather big and complex, panel’s can now be “built” through a “wizard”, weather data importing from internet is supported out of the box - basic use can be possibly done completely without any flow - for example, if you are looking for a energy monitor or switch panel. Complex json definitions to panel are long gone and there’s a lot of customization and behavior modification available through flows for advanced setup that isn’t possible through NSPanel studio - yet, you use studio to create your views so that it’s combined - you just alter or feed panel through flows for details that are not supported by NSPanel Studio. And there’s a lot of presets for quickly building up your interface. All views besides screensaver2 is supported (I opted out from it). There’s a lot of stuff, such as bars and line diagram, which can be directly made to demonstrate power usage from NSPanel Studio without a single flow. Sorry for Finnish language in photos.. I should had done screenshots in English..

I am for example having a line chart that shows energy usage of my HVAC. No flows needed for that.

So.. What do you think? And are there still anyone interested in this or has everyone moved on to NSPanel Pro or similars?

Hi Osku,

Yes, I am definitely interested in this project.

I have 3 NSPanel Pro units and 2 regular 120-type NSPanels at home. I bought the regular ones especially for my children’s rooms because they have physical buttons. For children I think this is important. Even if there is a nice touchscreen, they should always be able to press a normal button and turn the main light on or off.

I have also been trying to make the regular NSPanel work properly with Homey Pro 2023 for some time.

At first I tried to make my own screen design and TFT file. I spent quite a lot of time with Nextion Editor on Windows, but honestly it became very difficult. Making the screens was one thing, but fixing the touch areas, long press events and popup pages on the real panel was another problem. Sometimes the screen looked correct but a button did not work, or I opened a light page and could not close it again.

After a while I decided not to continue drawing the complete interface myself. I installed the ready-made joBr99 Lovelace UI TFT and started working on the Homey side instead.

At the moment I have a custom Homey app that can find and pair the panel locally. Both relays are visible separately in Homey, the panel temperature is received and the physical buttons can be configured. I also added local HTTP and WebSocket communication, reconnecting after a restart and updating the relay states without sending old commands again.

On the display side I managed to show Homey lights and temperature sensors. A short press can control a light, a long press can open the light controls and the screensaver can show the time, date and room temperature. I also worked on multiple pages, navigation and some support for fans, covers and thermostats.

It is working, but it is still not something I would call finished or easy to use. The Lovelace protocol has many small details that took a lot of time to understand. For example, some values cannot be shown on the grid page, the light popup only opens with a certain card type and some touch events behave differently than I expected.

The most difficult part for me is not turning a light on and off. It is making the whole system reliable and easy to configure: pages, cards, popups, physical buttons, external state changes from Homey and reconnecting when something goes offline.

That is why your latest message was very interesting for me. The wizard, presets, weather support, energy graphs and the possibility to combine Studio with Homey Flows sound very close to what I have been trying to achieve.

If you need someone to test the new version, I would be very happy to help. I can test it on a Homey Pro 2023 and real 120-type NSPanels, including the screen, both relays and physical buttons.

I can also share the files from my project if they are useful to you. I have the Homey app, firmware experiments, protocol notes, tests and the settings/editor work. My project is not finished and I am not saying that my solution is better, but maybe some of the things I already tried can save you some time.

For now I am using the ready-made Lovelace TFT because maintaining all the drawings in Nextion Editor was too difficult for me. But if your version works reliably with Homey and keeps the physical buttons working, I would happily switch to it immediately.

Please let me know if you publish the new version or if you want somebody to test it before release. It is really nice to see that you are working on this project again.

Testing will be available after I push my work to current repository; but that takes few days probably, I am working currently with English localization and there are some tests that I still want to do BEFORE pushing it; but once I push it, I would be grateful if you could test features/views, as I am pretty worn out on testing technical app features and if someone is interested in testing actual functionality in usable environment, that would be great. This does use Tasmota/lovelace ui as a firmware on nspanel.

I like nspanel more than nspanel pro, because it’s more dedicated. There is a underlying problem with nspanel pro and similar systems, as they use android - there is a lot more going on that can cause (temporary) malfunction than what there is in basic nspanel which is dedicated to.. Only doing nspanel things, data handling is processed elsewhere, not on nspanel.. So for example if I’d like to use this as a alarm system’s control panel, it would be quite problematic if device would had hanged and sirens would go on, because I couldn’t unarm alarm because device is not working (well, I could do that with my phone, but what if it’s my son who comes from school?) - also, you probably want to install such device in a way that it’s locked to it’s place - and then you can’t access buttons or anything that you could use to reset it.. So, even though possibilities are simpler and interface is “uglier” than that it is in NSPanel Pro or similar approaches; there are certain things where old NSPanel is superior.

But pushing this to my repository, isn’t far. I have also used gemini, codex and claude AIs to improve and check my work, but since I have low priced versions, I have quite limited amount of tokens so using them takes a lot of time, especially after usage was reduced few months ago. Although, gemini still has reasonable amount of usage for user; problem just with gemini is that codex and claude are superior to it, gemini makes much more errors, but it’s useful too since it has some vision.

That sounds great, thank you. There is no hurry from my side, so please finish the English localization and the tests you want to do first.

When you push the new version, just let me know here. I will be happy to install it and test it in a real daily-use environment, not only on a desk. I can test the different views, lights, temperature values, screensaver, navigation, popups, physical buttons, both relays, reconnecting and longer-term stability.

It is also very good to hear that you are using Tasmota and Lovelace UI, because this is the same direction I finally followed after giving up on maintaining my own Nextion drawings. This should make testing much easier for me.

I completely agree with you about the regular NSPanel. The Pro model looks nicer and gives more possibilities, but the normal NSPanel feels more like a dedicated wall device. In the children’s rooms, the physical button is the most important part for me. Even if Homey, Wi-Fi or the screen interface has a problem, they should still be able to use the room light in the normal way.

Your alarm example is also a very good point. A wall-mounted control device should be predictable and should not need a hidden reset procedure when somebody needs it urgently.

Once the repository is updated, I can start with the normal everyday functions and report what works, what feels confusing and what causes problems on the real panel. I can also share logs, photos or videos if that helps.

Repository will be in same place where my previous work currently is, but don’t mind about that for now; it’s completely re-factored. Repository address is GitHub - oskarirauta/homey-nspanel-app: incomplete nspanel implementation (not nspanel pro) · GitHub

There’s also a new view coming: weather, which is actually a modified version of screensaver view, but with navigation arrows. I don’t support EVERYTHING, which means that navigation arrows are ALWAYS navigation arrows, if I’d add “everything”, NSPanel Studio wouldn’t be easy or fast to use because it would clutter with too many things. Some features aren’t even available through flows, such as that navigation icon settings, but I have tried my very best to support everything useful. Things such as navigation icons instead of arrows, does not feel “important” to me.

Another thing that I have no plans to support, is screensaver2 view. I think it’s weird and does not give that much of context that working with it would be important enough for my time. Otherwise, all other views are supported and I have done my very best to allow “automation” without requirement of using flows; yet - flows can be used for more complex/advanced setups that are not available to be performed through Studio, such as custom actions when button entity is used - for example, turning on homey’s ambient led with button on panel, should be doable through flow even though it isn’t available in Studio (except through virtual button which again should be linkable to grid views buttons).

Okay, you may begin testing - it’s pushed and initial tests have succeeded. To use this, you need to have your mqtt ready, I used MQTT Broker and MQTT Client combo, but you should be able to “roll your own” setup just fine. Add nspanel device normally and then go to Settings → Apps → NSPanel and choose Configure. This opens up NSPanel Studio, choose which one of your panels you want to modify and.. Well it’s pretty easy, you’ll figure it out. There also should be a substantial amount of flow options available. Happy testing.

Let me know what you think.