NSPanel Lovelace UI Helpers (part 1/5, v1.0)

Thank you all for the inspiration after reading your solutions with the NS panel.

Yet I still have 2 problems, I wouldn’t name it like that, but how did you guys did the following:

  • set up a light dimmer with blockly? I find the visibility of an on-off switch (I don’t use it and would rather have it gone) ambiguous if you only want or can adjust the brightness?

  • and has anyone already dynamically adjusted the colors of the weather forecast (Openweather) on the screensaver, e.g. sun = yellow, clouds white, rain = blue? I wanted to make that with dictionary but it hasn’t really worked out so far.

Concerning the 2nd problem, I did a small test (with a card entities and an entity button) with the following blockly:

image

I did a test with my nspanel and it seems to work fine. You have just to adapt it to your screensaver: replace “weather-rainy” in the second block by a “get state of item” with the relevant item of your openweather thing.

Hope it helps

Hi, also regarding the 2nd Issue, not exactly what you wanted: I am colorizing the Icons based on the temperature using the ColorRangeHelper:

grafik

Maybe that’s also some option to get more colors on the panels :slight_smile: I am using this for the weather and some similar approach for room temperatures.

Best regards, Rene

Thanks,
Regarding my first question. maybe some clearer statement. I don’t like the toggle switch on the right and would like to use something more intuitive than the brightness slider to dim/switch ON-OFF our lights. How did you all do this when you used a dimmable light?
IMG_6783
IMG_6784

regarding my second question. I’ve now a more colorful screensaver. where I’ve assigned a color to each weather type of open weather.
Herby some snippets for others.
Scherm­afbeelding 2025-07-06 om 16.15.18
Scherm­afbeelding 2025-07-06 om 16.15.35
Scherm­afbeelding 2025-07-06 om 16.15.47

1 Like

Today I’ve successfully added a second NSpanel to openHAB. Every card is working except the screensaver not as intended.

I noticed that on the second panel the weather isn’t updating on the second screen.
It black below the time and date (simple screensaver).

Did I do something wrong in the screensaver update script?

IMG_3145

Hi @Vannue ,

seems ok, I’m doing it a similar way (just additionally setting some context variables for per-display values):

image

No idea, maybe some issue with the update-script itself?

Regards, Rene

Do you please this 'if statement" block above and in the same (attached or not to the screensaver script) “nspanel_ssaver_update”?

Hi @Vannue ,
not sure if I’m getting your question right, but the if-block posted is one complete rule. The “nspanel_ssaver_update” is some othe script called by this if-block.
If I’m looking again it seems like you are having two unconnected big blocks in the same rule, not sure how this runs in the end. Maybe you can split this into two rules or scripts?
Regards, Rene

Yes, indeed. Hence my question. As I followed the instructions in the online documentation and that part of the screensaver and screensaver update script wasn’t clear to me.
It’s also my first time I use Blockly and I’m normally used to use other program languages.

Herby my rules/script overview build up with the help of the online documentation:
Rules:

  • Callback for each NSPanel
  • Time update
  • Screensaver Update rule (nspanel_ssaver_update): In my previous post you can view the setup

Scripts:

  • Main card
  • Power card
  • Lights
  • HVAC card

Should I create a separate card for the Screensaver or a rule/script as this isn’t clear to me?

For sure, everything works for 1 NSPanel as I’ve build it up

Hi @Vannue,

so the image above with the if-block and the “Screensaver Notification” is your “spaniel_ssaver_update”? Then probably what happens is that this rule is calling itself and because of the lastRunTime-Limit it will not be called again for the 2nd Panel. Probably. Something like that.

If it is like that, just add everything you are planning to do on the panel in a separate script (in my case “nspanel_ssaver_update”). The rule, which is regularly called should just contain the if-block and should not call itself. If you are familiar with javascript programming, you can always check the source-code in the blockly editor with the icon on the bottom right.

Regards, Rene

@rene_rostock

Indeed by doing the following per your suggestion I get both panels working with all the details.
I’ve created a separate script “nspanel_ssaver” for all the screensaver related card, etc. and I call the rule “nspanel_ssaver_update” of which only exist out of the the if-block.

In this way my experimental sliders also suddenly works for dimming my lights.
This is a useful lesson :slight_smile:

Thanks

1 Like

Hi I just upgraded to Openhab 5 and somehow the main screen is only showing the date and time. Is there something I need to do on an upgrade?

I get this error on the callback script?

2025-09-16 14:42:00.981 [WARN ] [nhab.automation.script.ui.da6edc6b50] - event.itemState is deprecated, use event.receivedState for update triggers or event.newState for change triggers instead.

Hi @Julian_Divett ,

thanks for pointing me to this warning (and to the next releases of openHAB), I will check for any other issues during the upcoming days. But it’s just a warning and will not give you any problems with the current version. Just upgraded to openHAB 5.0.1 and had some issues, but could not see the mentioned warning. This only came up with 5.1, which one you are running?

I will have a look into this during the next days, attached you will find the nspanel_callback.yaml (as text) which has some minor modification to run on 5.0.1 - but it’s not assumed to be stable. You can copy the contents into your callback block library, update your rule and see if this fixes your urgent issues.

nspanel_callback.txt (29.3 KB)

Maybe you have some other Errors on your log?

Best regards, Rene

Hi Rene thanks for getting back to me. I’m running the 5.1 version on Openhabian. I updated the rule and got the following errors. The first is on the updated callback script and the second must be when I press the panel and it tries to run nspanel_media rule which uses the card media :

2025-09-17 12:31:54.011 [ERROR] [.handler.AbstractScriptModuleHandler] - Script execution of rule with UID ‘da6edc6b50’ failed: TypeError: Cannot read property “1” from undefined in at line number 205 at column number 10

2025-09-17 12:24:37.089 [ERROR] [.handler.AbstractScriptModuleHandler] - Script execution of rule with UID ‘nspanel_media’ failed: TypeError: Cannot read property “receivedEvent” from null in @openhab-globals.js at line number 2 at column number 57031

Hi @Julian_Divett ,

version 5.1 of openHAB is still not stable and I can’t get the add-on running at my end. Problem is that even some simple test to run another rule from blockly does not work - and this is the base of the whole extension.

grafik

Maybe there is some bigger issue, lets see. I will keep you updated. If this fix takes too long, I might provide some intermediate version for 5.0.1.

Regards, Rene

Yes I upgraded hoping to make use of the matter functionality but that has not worked either so I’ve gone back to 4 until everything works. Good luck with the fixes. Please let us know if you need testers. I’ve got an SD card with 5.1 so can easily run that.

Hi @Julian_Divett , Hi all,

just upgraded the add-on to be compatible with OpenHAB 5.x . Be aware, that the library will not work with snapshots of 5.1 containing openhab-js version 5.13.0. Latest snapshots of OpenHAB 5.1 should contain some fixed version (>=5.14.0).

Beside, I don’t have some bigger installation to test all different options of this panel now. But you will help me and all others if you can test the new version for compatibility with your setup. As of now this new version 1.1a is only available at github.

Any feedback is highly welcome - best regards,

Rene

Hi @rene_rostock,

I just installed v1.1a with my current set up (OpenHAB 5.0.1, 39 NSPanel scripts). It works fine so far. I will upgrade to 5.1 in the coming days. I will test it again and will report to you.

Thanks for all,

1 Like

Hi @rene_rostock,

Sorry for the slow response I’ve been away. I’ve installed the new add-on and everything seems to work fine with the latest Openhab 5.1.0 with one exception:

If I don’t set the Action as Landing page on the Complex Callback script then it will not allow me to go to other pages using Touch, Swipe etc…. (It does seems to work just one time if you restart the Panel)

The Landing page workaround seems to be ok so nothing critical for now. Would be nice if I could timeout back to the screensaver as before though.

Thanks for doing this.

Jules

Is there also a way to link only, let’s say the right button, to switch the right relay, of which is also switchable by another input from another item?

I’m using the left button as an “All Off” commando button to my setup