Bridge between NSPanel with Lovelace UI and openHAB

Hi Guys,

I just want to introduce my GitHub project to connect a Sonoff NSPanel with lovelace UI to openHAB.
The project implements a python mqtt client which is bridging the panel mqtt messages to openHAB items:

You can configer the content in the panel over yaml files similar to the openhab UI.
The bridge is running as systemd service in linux. For example in openhabian.

All details in the GitHub GitHub - olialb/nspanelMqttBridge: Bridges MQTT messages from NSPanel with lovelace UI to openHAB · GitHub

I know there are other ways to connect such an NSPanel but they looked for me not flexble enough or it was complicated for me to get it running.

I just published the first versions. Some cards of the panel UI pages needs to be added in future releases (popupTimer,???). But the most important once are fully supported already.

If anyone is interessted to give my bridge a try I would be happy to get some feedback.

I need to appologize!!

I hope nobody tried it in the last days and was frustrated because the installation process failed.

I missed to update some naming after the last pylint runs. I relazied this today morning.
Its fixed in release V0.6

Just release V0.7 with support of chartCards:

simple example for a number chart:

  - name: PowerChart
    title: Stromverbrauch
    type: cardChart
    slots:
      - class: ohItem
        type: number
        item: Stromzaehler_power

The y axis label is used to show the maximum and minimum values during the period. The minimum value in the chart is scaled that 0 on the y axis is equivalent to the minimum value in the defined period. The labels on the x axis show the start and end of the defined period. The date and time is formated dependant on the language you specified in the ini file.

Another example for a chart with the states of a Switch item:

  - name: StateChart
    title: Küchenlicht
    type: cardChart
    period: d
    past: w
    color: yellow
    slots:
      - class: ohItem
        type: switch
        item: Switch_Kueche

You can see how long the kitchen light where active on the same day as today one week ago.

Additionally group items are generally supported now if they have an item type assigned

New release V0.8 with notification cards:

and cardGrid2 with 2x4 slot format added:

You can also control the font and icon size now in the cards which support this feature.
Date in screensaver is improved for different languages
Issue fixed in cardChart when no persistance data is available for the selected period

Feel free to raise issues on github!

V0.9: Now also cardPower is supported including control of the animation speed:

Aditionally sceensaver2 is inlcuded with much more wather slots and 5 extra item slots:

I see 2 issues with sceensaver2 implamentation in lovelace UI:

  • When you use AM/PM time the AM/PM text is shown over the last time diget
  • If you click on one of the 5 additonal buttons, the button event is send twice from the panel. That means also the items are toggeled twice. I need to investigate that further.

V0.10: With this release is now also the cardMedia supported:

  • New: You can define now all icons and icon colors dependant on the item state. The attribute iconStateColor which existed only for switch and light types is replaced by this more generic way of defining the icon and iconcolors
  • An issue with simple option lists in openHAB like A,B,C is fixed.
  • Each connected Panels gets now a reset command when the bridge is started

Addtionally I made some tests ith this fork of lovelace UI: ioBroker.nspanel-lovelace-ui. Seams that most of the cards are compatible. But its more experimental.
If you install on of the last versions of this HMI on your panel the bridge detect an HIM version >= 60 and behaves a bit different:

  • The ppoupNotify has 3 instead of 3 buttons.
  • You can also use cardGrid3 with a 2x2 slot design:

I hope you have fun with the new features.
Raise issues if you find something does not work like expected.

Version V0.11 adds more support for the ticaki/ioBroker.nspanel-lovelace-ui fork of the HMI.

Now the alternative popups for shutter:

and Light:

are supported.
Also screensaver3 is added:

Additionally the effect selector in the popuplight can now be used. This is valid for both HMI versions:

To improve the readability of the documentation, the documentation is now moved to the github wiki

V0.12 Release adds:

  • New slot types to open popups directly with one click
  • New Radio Button functionality to implement radio buttons for an item over several slots:
      - class: ohItem
        type: button
        item: H_Schlafzimmer_SysMode
        radioButtonState: "Off"
        iconColor: default=green,Off=red
      - class: ohItem
        type: button
        item: H_Schlafzimmer_SysMode
        radioButtonState: "Heat"
        iconColor: default=grey,Heat=red
      - class: ohItem
        type: button
        item: H_Schlafzimmer_SysMode
        radioButtonState: "Cool"
        iconColor: default=grey,Cool=blue
      - class: ohItem
        type: button
        item: H_Schlafzimmer_SysMode
        radioButtonState: "Auto"
        iconColor: default=grey,Auto=white

ExampleRadioButton

This release implements the popupTimer from ticaki/ioBroker.nspanel-lovelace-ui:


It comes with a new slot type:

    ...
    slots:
      - class: ohItem
        type: popupTimer
        text: popupTimer
        item: NSPanelTimer
        stateItem: NSPanelTimerState

Additionally the compatibility check with the fork ticaki/ioBroker.nspanel-lovelace-ui are improved, because all the add ons are only available in EU panels.

In release V0.14 got the bridge a new feature to show the departure of puplic transport stations in germany based on the opendata-oepnv.de:

The yaml configuration is super simple. You just need to specify the place (City) and the station name and the 6 next departures are shown in the card. The card is updated every minute in the background:

- name: MyDepartures
    title: Frankfurt Hbf
    type: cardDepartures
    station: F,Hbf

In near future I want to add MQTT topics with the schedule, that the schedule can also be used in openHAB.

Additinally the handling of popupNotify in HMI from ticaki/ioBroker.nspanel-lovelace-ui is fixed. It sends different button events as the card from jobr99

Further more you can configure in the ini file the hmi which is installed on the panels to improve the compatibility, because the version topic is send out very seldom by the panels.

I love the simplicity of the setup.

Got the screensaver and screensaver2 working at once.

But I cannot get the (sub)pages to work. I got stuck in the screensaver, nor the navigation buttons show or something else. I used the newer UI

I tried the example config, no go….

Any idea?

Hey @JustDude,

diffcult to say without knowing your yaml configuration files in detail
The default card group which is active after startup is “home”.

What you need is yaml file with some cards defined for group home.
After clicking twice on the screensaver you should enter the first of the group home.

May be you can share some details of your yaml files here or on Github by creating a new issue.

It is also interessting for me how you struggling with the configuration.

Which version are you using?
Share also your configuration of the panel in the ini file please:

Like:

[panels]
Flur=tasmota/NsPanel01,hmi1

I don’t want to pollute your thread with my lack of knowledge on this nice piece of work, I try your suggestions and create an issue on GH if needed.

As said I used also the provided sample yaml files, changed the panels section in the ini and changed the same in the screensaver.yaml:

(main)# rg ns2 *.ini
69:NS2=iot/ns2,hmi2

creensaver.yaml
5: - name: NS2.screensaver

Hi @JustDude,

thanks for raising an issue on GitHub about your issue with the yaml configuration.
This feedback is super helpful!

I just released V0.17 to improve the stability with different yaml configurations and improve the logs in such cases.

As a hint to all users:
I want to highlight that the correct topic configuration of the panel in Tasmota is essential to get the bridge correctly working.