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:
- 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?
- 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?
- 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…





