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

It looks like my questions will never end

I have the following code to change the brightness of the NSPanel depending on the time of day
Untitled

I have tried running the screen saver update rule and the callback rule, neither one works. The only way I have found to make the screen change brightness is to open the actual script in the callback rule and run the script.

Do you have another way to make it work?

Thank you

Hi clark, the callback is thought to be more static, I’ll have to change the description somehow to make this more clear. With your setup, even if it would work as expected, the brightness would only change of the callback is called - that’s most likely not what you want.

Use the following approach in a rule, which is in my case triggered by any change of the Astro-Item:

all versions:
grafik
since 0.6 you can also use helpers for setting the Page brightness:
grafik

Best regards, Rene

You are a savior, I followed your example to send the time in 12 hour format

image

and now the WAF has gone up significantly.

Thanks a lot for including the ā€œNoneā€ unit.

I wanted to test it, but was not able to update the library correctly. Initially, I installed the library via the market place. After your update, I overwrote the yaml files in the developers section. Here, I’m able to see the new ā€œNoneā€ unit in the Preview.

However, in the rules themselves, I still see the old card without ā€œNoneā€. Do I need to trigger somewhere, that the libraries are reloaded?

Hi,

Still have problems with this on my own. After you saw the changes in the developer section, it takes some indefinite while until I can use them in the ā€˜real’ blackly environment. Sometimes it’s nearly instant, sometimes it takes a few minutes. I don’t know of any other trick than waiting :frowning:

Hope you got it done somehow, best regards, Rene

this looks great and i’m creating my first cards right now but this is all very new to me (never used blockly before)…

the shutter still doesn’t work, does it? i have the same problem with returnvalue ā€œupā€ instead of ā€œUPā€ā€¦
also i seem unable to find some blocky elements? how am i supposed to ge the state of my blinds? the entity just accepts numbers so i’m not able to use ā€œget state of item ā€¦ā€ and i can’t even figure out how carlos creates number[get state of item [item] ] in post NSPanel Lovelace UI Helpers (part 1/5, v1.0) - #30 by clark …

Hi,

This was fixed since v0.6, current is 0.7, so it should work. Maybe your version is older?

[quote=ā€œnarf27, post:47, topic:152029ā€]
also i seem unable to find some blocky elements? how am i supposed to ge the state of my blinds?[/quote]

Maybe you can get the numerical value of the State?
grafik

You can find this in the ā€œItem & Thingsā€ section as well, the default element says ā€œget name of itemā€ and you can change this via the dropdown.

Hope this helps, best regards, Rene

1 Like

thanks for the tip with get numeric state of item :+1:

at least it shows the right value now :slight_smile:
but no luck with sending commands (0.7 installed):

image

when i press down:
Command 'down' cannot be parsed for item 'rs_buero

grafik

ohoh, still broken in 0.7 :frowning: You can convert it as shown above - find the ā€˜uppercase’ int the Text area. I will release version 0.8 later today.

Thanks for pointing me to this issue, best regards,
Rene

Hi all,

version 0.8 is out now. This is just a bugfix release, if you don’t have any issues with this add-on there is no need to upgrade. As a small bonus you will get some helper which let’s you reload the current page - without additional parameters. Version 0.8 gives you:

  • various selector issues fixed
  • finally got shutter returnValue right
  • added page reload helper

And, just report any issues with the add-on, it’s still beta for a reason. And personally I am using the display now, therefore my try-and-error phase is over and the things (pages) I am using are working fine :slight_smile:

Best regards, Rene

Hi ,

I like the work you have done on NSPanel with cards in Openhab. Finally a solution that directly integrates with Items that don’t require MQTT to port to another platform.

It works well but I get some errors in my OpenHab log that i can’t get resolved.

I’ve made some screenshots of the cards I created and the errors I get in OpenHab Log.

Log:
https://ibb.co/NyQPW0V

Card Example:
https://ibb.co/C1S7Zsm

The error is the same on the other 3 cards I made.
Can you let me know what I need to change to resolve this?

Thanks in advance.

Tim

Hi,

you need to call these cards via the callback. Check out the documentation on github (The important section on top).

Hope this helps, best regards,
Rene

Ahh, and maybe have a look at the installation description as well - it’s a little special how all of the different parts play together. But keeping the information of the Panel to work with out of the cards (and use it from callback) was required to have these cards running on different panels in your?/my home. This way you only need one callback per panel, seems to work nicely for me :slight_smile:

best regards, (I might be offline for a week),
Rene

HI Rene

Thanks for the swift feedback. I tried to add the callback but then the system gets into some kind of loop. I have to stop the rule and remove it to make it stable.

Screenshot of loop:
https://ibb.co/Gf6Xcr8

I went thru all documentation, I only have one difference.
I did define the item / thing in a file like this, the rest is exactly the same.

Things:
https://ibb.co/XzmXjpD

Items:

//HMI Displays
String NSPanel1 ā€œNSPanel 1ā€ { channel=ā€œmqtt:topic:MQTT-HMI:NSPanel_1:NSPanel_UI_1ā€ }

String NSPanel2 ā€œNSPanel 2ā€ { channel=ā€œmqtt:topic:MQTT-HMI:NSPanel_2:NSPanel_UI_2ā€ }

I don’t expect this to be the issue but that’s the only difference based on what you did.

Hi,

hard to say how the loop gets triggered in the first place without seeing your cardGrid script. Try to configure the callback in the beginning as close as possible like the example, try the cardGrid just without any other configuration around, just the plain cardGrid in some blockly script. Remove some external blocks, if you added some. Best build and extend from there.

As you see, not really a lot I can say, if you are still in trouble just post the callback and the nspanel1_cardGrid script somewhere. Those loops might also be caused by some previous wrong configuration - to go around this disable and re-enable the callback to reset any environment variables it keeps.

Best regards, Rene

is it possible to remove the hardware relais part, power the NSPanel with 5V and still use the hardware buttons (just to toggle a openhab item)?

and could somebody please post a configured media card?
can’t figure out the ā€œMedia Player Control Actionsā€ā€¦

and strange enough… i can’t find a specific item in this block:
image

this item controls volume:
Dimmer piCoreK_volume (piCoreK) { channel="squeezebox:squeezeboxplayer:unRaid:piCoreK:volume", alexa="VolumeLevel" }
but i can’t find this item (checkbox ā€œshow non-semanticā€ activated) :man_shrugging:

ok, there’s a bug in 4.1 that should soon be fixed: Blockly - can't find/pick some items

i got the volume control working but i’m struggling with PLAY/PAUSE…
this is my item: Player piCoreK_control "Küche Control" (piCoreK) ["Receiver"]
and its state is either ā€œPLAYā€ or ā€œPAUSEā€.
i’m able to get the correct icon with this:
image

but i’m not able to send the correct command with this:
image
the card/script always sends the same command: ā€œPLAYā€
makes no difference if the piCoreK_control state is ā€œPAUSEā€ or ā€œPLAYā€ā€¦

any help? :slight_smile:

Hi,

You can find some information about how to decouple the physical relays from the buttons at the nspanel documentation. I did so to prevent the useless clicking when using them as logical buttons and control their action in OpenHAB.

Here you can see my OpenHAB thing configuration, the buttons are triggering some OpenHAB rules which control some lights in my flat.

UID: mqtt:topic:0f11d1bffe:10df1b5c3f
label: NSPanel 3
thingTypeUID: mqtt:topic
configuration: {}
bridgeUID: mqtt:broker:0f11d1bffe
channels:
  - id: lovelaceui
    channelTypeUID: mqtt:string
    label: Lovelace UI
    description: this is the mqtt channel for lovelace UI
    configuration:
      commandTopic: cmnd/nspanel_3/CustomSend
      stateTopic: tele/nspanel_3/RESULT
  - id: buttonLeft
    channelTypeUID: mqtt:string
    label: Left Button
    description: null
    configuration:
      stateTopic: stat/nspanel_3/RESULT
      transformationPattern: JSONPATH:$.Button1.Action
  - id: buttonRight
    channelTypeUID: mqtt:string
    label: Right Button
    description: null
    configuration:
      stateTopic: stat/nspanel_3/RESULT
      transformationPattern: JSONPATH:$.Button2.Action

This should also work if you just remove the backplate of your NSPanel and supply 5V. Best regards,

Rene

Hi,

there is no returnValue available in these Media Player Control Actions except in the Volume action. The Panel does not know the state of your player, it’s just stupid and triggering some action. You should check the state on your own, as you can see in the example below (with Owntone, not Squeezebox - you need to adapt this)

grafik

Hope this helps, best regards,

Rene

1 Like

HI Rene

I got it to work. Thanks for help. There was an error in the callback script.

1 Like