Sonoff NSPanel

This is the latest enhancement to my system (ideas stolen from Graham Brown on the ZATech Slack community):

Sonoff NSPanel, running Tasmota and the NsPanel Lovelace UI software(pky.eu). No coding / GUI design required - it is just Yaml and existing Home Assistant entities.
Buttons below control two sets of lights.

Everything is connected to Home Assistant, so my family can also see / set:

  • Temperature outside & inside
  • Upcoming weather
  • Battery SOC, PV generation etc.
  • The aircon (who wants to use a remote!)
  • Control the geyser
  • Turn on/off lights inside and outside
  • see if some doors are still open
  • control my alarm
  • see upcoming loadshedding and whether Eskom is available or not (the wife loves this as our oven & stove still goes off with loadshedding and it helps planning dinner)

Only pain is the NSPanel US version is just about as big as our lightboxes, which means in this case there’s some ugly gaps around it. I need to figure out a backplate to make it look acceptable :frowning:

8 Likes

Oh bloddy hell, I promised myself I won’t push the credit card into the red any more this January… but this is too good to ignore!

The eBucks I had left after the rest of the Christmas shopping, was just enough :slight_smile:

I tweaked it (again!) last night, so the bottom icon is now permanently the battery SOC. When the grid is unavailable, it changes colour with shades of red (low SOC) to green (high SOC) - so more glanceable. With Eskom available, it is a normal white/gray colour.

As a bonus - the developer is also nice and helpful and responsive :slight_smile:

1 Like

I would really like it as well. Luckily my only problem isn’t that it is January, but that I ran out of time to do any sort of DIY around the house. Maybe next December!

Can you share your apps.yaml please. I am stuggling to get the temperature etc to display…
Other answers to questions below would be great! :wink:

I need to try and sort out the lack of Temperature values as well.

My Activate checkbox is also greyed out so I cannot activate the following template I need.
{“NAME”:“NSPanel”,“GPIO”:[0,0,0,0,3872,0,0,0,0,0,32,0,0,0,0,225,0,480,224,1,0,0,0,33,0,0,0,0,0,0,0,0,0,0,4736,0],“FLAG”:0,“BASE”:1,“CMND”:“ADCParam 2,64000,10000,3950 | Sleep 0 | BuzzerPWM 1”}
image

Was going to suggest the NSPanel discussions was split out from the Eskomsepush discussion, glad to see it was done :smiley:

@mmaritz the apps.yaml is only for the configuration of what entities you want to come up on the display of the panel by the look of it our NSPanel is not loading the template correctly and this is why you don’t have temperature.

You need to go to Configure Other then load the template below, hit save (my Activate Checkbox is also greyed out so I doubt that is your problem)

{“NAME”:“NSPanel”,“GPIO”:[0,0,0,0,3872,0,0,0,0,0,32,0,0,0,0,225,0,480,224,1,0,0,0,33,0,0,0,0,0,0,0,0,0,0,4736,0],“FLAG”:0,“BASE”:1,“CMND”:“ADCParam 2,11200,10000,3950 | Sleep 0 | BuzzerPWM 1”}

Once its loaded / saved the template go to Configure Module and make sure the template NSPanel (0) is selected and save that, you should now have temperature.

image

Your Configure Template should look like this:

Hope this helps…

1 Like

Thanks - I try and load the template but it won’t save it and reverts (the greyed out checkbox may be the issue).
I may reset the NSPanel and restart with the firmware. Just nervous of this process… :wink:

Mine does look like this:


It’s weird - I followed the instructions on NsPanel Lovelace UI Docs (pky.eu) exactly as is…

Finally redid everthing and all up and running…
Any advice on the commands for using the manual switches for other sonoff’s (ie lights) using mqtt?

I can’t work out the mqtt command(s) for each switch?

I have not mounted mine in the wall (no neutral yet) but just on the desk as a display.

I assume you’ve decoupled them? Physical Buttons - NsPanel Lovelace UI Docs (pky.eu)

The easiest way I would try and figure out the MQTT is to open up the Tasmota Console in a browser, and then click the buttons to see what it sends!

Would you mind sharing your apps.yaml file (the nspanel part)?

1 Like

Sure thing - sorry for only replying now.

nspanel-1:
  module: nspanel-lovelace-ui
  class: NsPanelLovelaceUIManager
  config:
    panelRecvTopic: "tele/tasmota_nspanel/RESULT"
    panelSendTopic: "cmnd/tasmota_nspanel/CustomSend"
    model: us-p
    sleepTimeout: 20
    sleepBrightness:
      - time: "sunrise"
        value: 10
      - time: "22:00:00"
        value: 3
    sleepOverride:
      entity: light.nspanel_kitchen_and_downlights
      brightness: 10
    locale: "en_US"
    dateFormatBabel: "" # "EEE d MMM"
    timeAdditionalTemplate: >
        {%if state_attr('sensor.eskomsepush','events')|count > 0 %}
        {{ iif(states("binary_sensor.calendar_loadshedding_active")=="on","Now",as_datetime(state_attr("sensor.eskomsepush","events")[0].start).strftime('%a')) }}: {{ state_attr("sensor.eskomsepush","events")[0].note }}, {{ as_datetime(state_attr("sensor.eskomsepush","events")[0].start).strftime('%H:%M') }} - {{ as_datetime(state_attr("sensor.eskomsepush","events")[0].end).strftime('%H:%M') }}
        {%else%}
        -
        {%endif%}
#       Show the next available loadshedding
    dateAdditionalTemplate: >
        {%if state_attr('sensor.eskomsepush','events')|count > 1 %}
            {{ as_datetime(state_attr("sensor.eskomsepush","events")[1].start).strftime('%a') }}: {{ state_attr("sensor.eskomsepush","events")[1].note }}, {{ as_datetime(state_attr("sensor.eskomsepush","events")[1].start).strftime('%H:%M') }} - {{ as_datetime(state_attr("sensor.eskomsepush","events")[1].end).strftime('%H:%M') }}
        {%else%}
            {{ as_datetime(states.sensor.date.state).strftime('%a, %d %b') }}
        {%endif%}
    homeButton: True
    screensaver:
      entity: weather.combined_weather
      statusIcon1: 
        entity: binary_sensor.power_outage
        name: Eskom
      statusIcon2:
        entity: binary_sensor.nspanel_gates_and_doors
      weatherOverrideForecast4:
        entity: sensor.victron_battery
        name: Batt
        icon: #'ha:{%if(int(states("sensor.victron_battery")) > 99) %}battery{%elif(int(states("sensor.victron_battery")) < 10) %}battery-alert-variant-outline{%else%}battery-{{int(states("sensor.victron_battery")) // 10}}0{%endif%}'
            "100": mdi:battery
            "99": mdi:battery-90
            "98": mdi:battery-90
            "97": mdi:battery-90
            "96": mdi:battery-90
            "95": mdi:battery-90
            "94": mdi:battery-90
            "93": mdi:battery-90
            "92": mdi:battery-90
            "91": mdi:battery-90
            "90": mdi:battery-90
            "89": mdi:battery-80
            "88": mdi:battery-80
            "87": mdi:battery-80
            "86": mdi:battery-80
            "85": mdi:battery-80
            "84": mdi:battery-80
            "83": mdi:battery-80
            "82": mdi:battery-80
            "81": mdi:battery-80
            "80": mdi:battery-80
            "79": mdi:battery-70
            "78": mdi:battery-70
            "77": mdi:battery-70
            "76": mdi:battery-70
            "75": mdi:battery-70
            "74": mdi:battery-70
            "73": mdi:battery-70
            "72": mdi:battery-70
            "71": mdi:battery-70
            "70": mdi:battery-70
            "69": mdi:battery-60
            "68": mdi:battery-60
            "67": mdi:battery-60
            "66": mdi:battery-60
            "65": mdi:battery-60
            "64": mdi:battery-60
            "63": mdi:battery-60
            "62": mdi:battery-60
            "61": mdi:battery-60
            "60": mdi:battery-60
            "59": mdi:battery-50
            "58": mdi:battery-50
            "57": mdi:battery-50
            "56": mdi:battery-50
            "55": mdi:battery-50
            "54": mdi:battery-50
            "53": mdi:battery-50
            "52": mdi:battery-50
            "51": mdi:battery-50
            "50": mdi:battery-50
            "49": mdi:battery-40
            "48": mdi:battery-40
            "47": mdi:battery-40
            "46": mdi:battery-40
            "45": mdi:battery-40
            "44": mdi:battery-40
            "43": mdi:battery-40
            "42": mdi:battery-40
            "41": mdi:battery-40
            "40": mdi:battery-40
            "39": mdi:battery-30
            "38": mdi:battery-30
            "37": mdi:battery-30
            "36": mdi:battery-30
            "35": mdi:battery-30
            "34": mdi:battery-30
            "33": mdi:battery-30
            "32": mdi:battery-30
            "31": mdi:battery-30
            "30": mdi:battery-30
            "29": mdi:battery-20
            "28": mdi:battery-20
            "27": mdi:battery-20
            "26": mdi:battery-20
            "25": mdi:battery-20
            "24": mdi:battery-20
            "23": mdi:battery-20
            "22": mdi:battery-20
            "21": mdi:battery-20
            "20": mdi:battery-20
            "19": mdi:battery-10
            "18": mdi:battery-10
            "17": mdi:battery-10
            "16": mdi:battery-10
            "15": mdi:battery-10
            "14": mdi:battery-10
            "13": mdi:battery-10
            "12": mdi:battery-10
            "11": mdi:battery-10
            "10": mdi:battery-10
            "9": battery-alert-variant-outline
            "8": battery-alert-variant-outline
            "7": battery-alert-variant-outline
            "6": battery-alert-variant-outline
            "5": battery-alert-variant-outline
            "4": battery-alert-variant-outline
            "3": battery-alert-variant-outline
            "2": battery-alert-variant-outline
            "1": battery-alert-variant-outline
            "0": battery-alert-variant-outline
#https://github.com/joBr99/nspanel-lovelace-ui/issues/622
      theme:
        autoWeather: true
        tTimeAdd: >
            {%if(states("binary_sensor.calendar_loadshedding_active") == "on") %}
                {%if(states("binary_sensor.power_outage")=="off") %}
                    [0,255,0]
                {%else%}
                    [255,255,0]
                {%endif%}
            {%else%}
                {%if(states("binary_sensor.power_outage")=="off") %}
                    [255,255,255]
                {%else%}
                    [255,0,0]
                {%endif%}        
            {%endif%}
#           When LS is active but Eskom is available, green
#           When LS is active but Eskom is out, yellow
#           When LS is inative and Eskom is available, white
#           When LS is inactive and Eskom is not available, red
        tF4Icon: >
            {%if(states("binary_sensor.power_outage")=="off") %}
                [180,180,180]
            {%else%}
                {{state_attr("light.gateway_light_7811dcb22c2b","rgb_color")}}
            {%endif%}  
#           When Eskom is not available, shade color from red --> green based on battery %, otherwise just white
    cards:
      - type: cardGrid
        title: Options
        entities:
          - entity: navigate.cardGrid_power
            status: sensor.victron_battery
          - entity: navigate.cardEntities_loadshedding
            status: binary_sensor.eskom_available
          - entity: navigate.cardThermo_aircon
            status: climate.samsung_aircon
          - entity: navigate.cardGrid_outside_lights
            name: Lights
            status: light.nspanel_controllable_lights
          - entity: navigate.cardGrid_geyser
            status: sensor.geyser_temperature
          - entity: navigate.cardEntities_security
            status: binary_sensor.nspanel_gates_and_doors
            name: Security
    hiddenCards:
      - type: cardGrid
        key: power
        entities:
          - entity: sensor.victron_battery
            name: Battery %
          - entity: sensor.victron_ess_minimum_soc
            name: Battery Min %
          - entity: sensor.victron_pv_power
            name: Solar power W
          - entity: sensor.victron_current_power_usage
            name: House Usage W
          - entity: binary_sensor.eskom_available
          - entity: sensor.solcast_forecast_remaining_today
        title: Power
      - type: cardEntities
        key: loadshedding
        title: Load shedding
        entities:
         - entity: sensor.upcoming_loadshedding_1
           icon: mdi:numeric-1
         - entity: sensor.upcoming_loadshedding_2
           icon: mdi:numeric-2
         - entity: sensor.upcoming_loadshedding_3
           icon: mdi:numeric-3
         - entity: sensor.upcoming_loadshedding_4
           icon: mdi:numeric-4
         - entity: sensor.upcoming_loadshedding_5
           icon: mdi:numeric-5
         - entity: sensor.time_till_loadshedding
           name: "Mins to loadshedding"
      - type: cardGrid
        key: outside_lights
        entities:
          - entity: scene.outdoor_off
            name: "All off!"
          - entity: light.outdoor_yeelights
          - entity: light.sonoff_gate_light
          - entity: light.front_flood
          - entity: navigate.cardGrid_outside_lights2
            status: light.nspanel_controllable_outside_lights_2
            name: Outside 2 »»  
          - entity: navigate.cardGrid_inside_lights
            status: light.nspanel_controllable_inside_lights
            name: Inside »»
        title: Outside lights
      - type: cardGrid
        key: outside_lights2
        entities:
          - entity: light.wendy_flood
          - entity: light.bedroom_courtyard
          - entity: light.path
          - entity: light.tasmota_bulb
          - entity: navigate.cardGrid_outside_lights
            status: light.nspanel_controllable_outside_lights_1
            name: «« Outside 1
          - entity: navigate.cardGrid_inside_lights
            status: light.nspanel_controllable_inside_lights
            name: Inside »» 
        title: Outside lights 2
      - type: cardGrid
        key: inside_lights
        entities:
          - entity: scene.all_lights_off
          - entity: scene.lights_bedtime
          - entity: light.entrance_hall
          - entity: light.dining_lamp
          - entity: light.tv_room
          - entity: navigate.cardGrid_outside_lights
            status: light.nspanel_controllable_outside_lights_1
            name: «« Outside
        title: Inside lights
      - type: cardEntities
        title: Security
        key: security
        entities:
         - entity: sensor.nspanel_open_doors
         - entity: sensor.nspanel_open_gates
         - entity: input_select.notify_outside_motion
      - type: cardGrid
        title: Doors
        key: doors
        entities:
         - entity: binary_sensor.door_kitchen
         - entity: binary_sensor.door_window_sensor_158d00019fa49f
         - entity: binary_sensor.door_window_sensor_158d0001c312ef
         - entity: binary_sensor.door_window_sensor_158d0002019666
         - entity: binary_sensor.door_window_sensor_158d0001bf4b18
         - entity: navigate.cardGrid_gates
           status: binary_sensor.nspanel_gates
           name: Gates »» 
      - type: cardGrid
        title: Gates
        key: gates
        entities:
         - entity: binary_sensor.door_window_sensor_158d0001e77396
         - entity: binary_sensor.western_gate
         - entity: navigate.cardGrid_doors
           status: binary_sensor.nspanel_doors
           name: «« Doors
      - type: cardThermo
        key: aircon
        title: Aircon
        entity: climate.samsung_aircon
        supportedModes: ['heat','cool','fan_only', 'off' ]
      - type: cardGrid
        key: geyser
        title: Geyser
        entities:
         - entity: sensor.geyser_temperature
           name: Temperature
         - entity: sensor.geyser_power
           name: Power use
         - entity: switch.cbi_astute_geyser
           name: On/off
         - entity: input_boolean.geyser_from_grid
           name: On/off (grid)
         - entity: script.run_geyser_predefined_time
           name: Run short time
         - entity: sensor.rain_today
1 Like

Sadly now mine is broken post upgrade to 3.9.3 from 3.8.3… still trying to wok out what has happened.

Anyone else have this issue?

Lots of this… 17:56:19.161 MQT: tele/nspanel/RESULT = {“CustomRecv”:“event,startup,49,us-l”}

Updated: Solved this but weather icons still a mess…
Updated: developer resolved issue. A small indent in .yaml file but be careful before you upgrade. changes to weather config not simple (for me anyway).

screensaver:
      entity: weather.mm_pi4_8gb
      theme:
        time: [65,105,225]
        date: [220,255,0]
        tMainText: [220,255,0]
      entities:
        - entity: weather.mm_pi4_8gb
        - entity: weather.mm_pi4_8gb
          type: 0
        - entity: weather.mm_pi4_8gb
          type: 1
        - entity: weather.mm_pi4_8gb
          type: 2
        - entity: delete
        - entity: sensor.victron_battery_soc
          icon: mdi:battery

New screen layout if very nice!

@ebendl Hope your NSPanel is all good.

Q: Did you have issues with the display of the Loadshedding Stage on the Screensaver given the update changes?

Mine still doesn’t display… I have tried tTimeAdd: and tMainText:

#   timeAdditionalTemplate: >
    tMainText: >
      {%if state_attr("sensor.eskomsepush","events")|count > 0 %}
      {{ iif(states("calendar.loadshedding_local_events")=="on","Now",as_datetime(state_attr("sensor.eskomsepush","events")[0].start).strftime('%a')) }}: {{ state_attr("sensor.eskomsepush","events")[0].note }}, {{ as_datetime(state_attr("sensor.eskomsepush","events")[0].start).strftime('%H:%M') }} - {{ as_datetime(state_attr("sensor.eskomsepush","events")[0].end).strftime('%H:%M') }}
      {%else%}
      -
      {%endif%}

I haven’t actually upgraded mine yet…

I couldn’t really figure out how the “type: 0” stuff works - even though he added it for my benefit.

Care to explain?

I am guessing but:

4 entity:data_values to display so Type nothing (for the current day) , 0, 1 ,2, 3, etc for the rest of the forecast days…
It is not self explanatory and his notes/examples aren’t clear. I ended up DM’ing and getting some help.