Sonoff NSPanel Blueprint - Configure your own custom NSPanel easy via a Blueprint

Anyone know the fix for blank tiles that still seem to work when pressed?
Tried TFT update, restart and removing/reapplying the buttons.

Help needed

Can’t get the tft uploaded, tried from HA and from the esp etc.


This looks like the lovelace ui loading screen. Did you use the correct file?

Anyone figured out how to use the icons and entity screens in the latest release?
I followed the instructions on Github, checked the box and reloaded the TFT but i see no change.

About to flash my panel and set this up - great blueprint. One question though - is it possible to have one of the physical switches as a physical light switch and the other as a virtual switch? I have some living room lights I want to replace the switch of for one of the buttons. and want an on-off switch for the Lifx bulbs in the room (which would have to be a virtual switch). I recall reading somewhere that it could either be physical or virtual but not mixed - is that still true? Is there a workaround I could use?

I use one,
for both my nspanels I use the right button as a physical one and the left one as a virtual one.
but you need to change some stuff in the esphome file and to match the state, also in the blueprint.

On the esphome I modified this

  ##### PHYSICAL SWITCH 2 ######
  - platform: gpio
    name: ${device_name} Relay 2
    id: relay_2
    pin:
      number: 19
#### CUSTOM SHARED ######
  ##### PHYSICAL SWITCH 2 ######
  - platform: gpio
    name: ${device_name} Relay 2
    id: relay_2
    pin:
      number: 19
    on_turn_on:
      then:
      - lambda: id(disp1).send_command_printf("home.icon_top_02.pic=106");
      - lambda: id(disp1).send_command_printf("home.right_bt_pic.pic=99");
    on_turn_off:
      then:
      - lambda: id(disp1).send_command_printf("home.icon_top_02.pic=51");
      - lambda: id(disp1).send_command_printf("home.right_bt_pic.pic=98");
  ##### RIGHT BUTTON BELOW DISPLAY TO TOGGLE RELAY #####
  - platform: gpio
    # name: ${device_name} Right Button
    id: right_button
    pin:
      number: 27
      inverted: true
    on_click:
    - min_length: 50ms
      max_length: 1000ms
      then:
        - binary_sensor.template.publish:
            id: right_button_short
            state: ON
        # - if:
        #     condition:
        #       and:
        #           - switch.is_on: relay2_fallback
        #           - not:
        #               api.connected:
        #     then:
        - switch.toggle: relay_2
        # - lambda: id(disp1).send_command_printf("home.icon_top_02.pic=51");
        # - lambda: id(disp1).send_command_printf("home.right_bt_pic.pic=98");
        # - if: 
        #     condition:
        #       switch.is_on: relay_2
        #     then:
        #       - lambda: id(disp1).send_command_printf("home.icon_top_02.pic=106");
        - delay: 500ms
        - binary_sensor.template.publish:
            id: right_button_short
            state: OFF
    on_press:
      then:
        - lambda: |-
            if (id(disp1_currentpage).state == "lightsettings" or id(disp1_currentpage).state == "coversettings") {
              ESP_LOGD("nspanel", "settingspage -> no press");
            } else {
              // ESP_LOGD("nspanel", "release button");
              id(disp1_lastclick_general).set_state("pressbuttonright",true,true);
            }
    on_release:
      then:
        - lambda: |-
            if (id(disp1_currentpage).state == "lightsettings" or id(disp1_currentpage).state == "coversettings") {
              ESP_LOGD("nspanel", "settingspage -> no release");
            } else {
              // ESP_LOGD("nspanel", "release button");
              id(disp1_lastclick_general).set_state("releasebuttonright",true,true);
            }

and in the blueprint this

  # ##### SET Right Hardware Button PIC on Home Page #####
                  
                  # - if:
                  #     - condition: template
                  #       value_template: '{{ right_button_entity |length > 0 and states(right_button_entity).state != "unavailable" }}'
                  #   then:
                  #     - variables:
                  #     # Hardware Button PIC
                  #         right_hardware_button_state: >-
                  #           {%- if states(right_button_entity) == 'off' -%} {{ hardware_button_pic_off }}
                  #           {%- elif states(right_button_entity) == 'on' -%} {{ hardware_button_pic_on }}
                  #           {%- endif -%}
                  #     - delay:
                  #         milliseconds: "{{ delay_value }}"
                  #     - service: "{{ command_printf }}"
                  #       data:
                  #         cmd: home.right_bt_pic.pic={{ right_hardware_button_state }}


                                    ##### StatusBar - Relay Symbols ######
                  - variables:
                      relay01_pic: >-
                        {%- if states(relay01_entity) == 'on' -%} {{ relay01_pic_on }}
                        {%- else -%} {{ top_menu_blank }}
                        {%- endif -%}
                      relay02_pic: >-
                        {%- if states(relay02_entity) == 'on' -%} {{ relay02_pic_on }}
                        {%- else -%} {{ top_menu_blank }}
                        {%- endif -%}
                      right_hardware_button_state: >-
                        {%- if states(relay02_entity) == 'on' -%} {{ hardware_button_pic_on }}
                        {%- else -%} {{ hardware_button_pic_off }}
                        {%- endif -%}
                  - delay:
                      milliseconds: "{{ delay_value }}"
                  - service: "{{ command_printf }}"
                    data:
                      cmd: home.icon_top_01.pic={{ relay01_pic }}
                  - delay:
                      milliseconds: "{{ delay_value }}"
                  - service: "{{ command_printf }}"
                    data:
                      cmd: home.icon_top_02.pic={{ relay02_pic }}
                  - service: "{{ command_printf }}"
                    data:
                      cmd: home.right_bt_pic.pic={{ right_hardware_button_state }}


                        #### Set Relay02-Symbol #####
      - conditions:
          - condition: trigger
            id: relay02_state
        sequence:
          - variables:
              relay02_pic: >-
                {%- if trigger.event.data.new_state.state == 'on' -%} {{ relay02_pic_on }}
                {%- else -%} {{ top_menu_blank }}
                {%- endif -%}
              right_hardware_button_state: >-
                {%- if states(relay02_entity) == 'on' -%} {{ hardware_button_pic_on }}
                {%- else -%} {{ hardware_button_pic_off }}
                {%- endif -%}
          - service: "{{ command_printf }}"
            data:
              cmd: home.icon_top_02.pic={{ relay02_pic }}
          - service: "{{ command_printf }}"
            data:
              cmd: home.right_bt_pic.pic={{ right_hardware_button_state }}

then in the config do not configure (in my case the right) button.
It would be nice to have the state matched by the esphome as well, but I think the blueprint overrides this one.

Yes but i cant get the new tft added

many thanks - needs me to look in detail at the code to see what gets put where, but most useful!

I’m currently using the EU version for US landscaped (which fits perfectly the 503 wall boxes commonly used in Italy), but I’ve noticed there is a slight mismatch of touch controls.
I have to touch buttons slightly to their right (less than 0.5 cm) for them to work.
Am I the only one to experience that?

No, the same problem also exists in the Lovelace UI version, only that they’ve already made a tft especially for the US version in landscape! I think Edward is preparing the landscape version!

1 Like

Unfortunately I’m stuck on this. Couldn’t find a way to rotate the text and still couldn’t find a good way to display the two physical buttons labels. :weary:
But I’m quite busy this week, hopefully I will have more time to invest in this next week.
Anyway, if anyone have experience with Nextio it would be welcome.

But about the misalignment, I will take a look.

2 Likes

I have a little experience with the nextion editor, I can try but I haven’t managed to switch from Lovelace UI to Blueprint yet. I could flash it by soldering the 2 pins, but I’m fiddly with soldering and wouldn’t want to end up with an expensive brick

Hi!

just installed nspanel blueprint - great work!

Is there any way to wake up the screen via ha?
Didn’t find any solution…I want to Wakeup the display via a motion sensor.

Thanks!

Yes.
The sleep is defined by the page named “screensaver”, so if you want to put it in sleep mode just send a command to set that page, similarly, when you want to wake up just call any other page, like “Home”.

Like this:

      - service: esphome.hall_panel_send_command_printf
        data:
          cmd: page home
3 Likes

Perfect - thank you so much!!

1 Like

Hmmm, this is suboptimal solution, cause at every movement there is a page reload and you have to wait till all entities are loaded.
Any other ideas?

Play with your conditions, or maybe add an if…then, something like this:

    - if:
      - condition: state
        entity_id: sensor.hall_panel_currentpage
        state: screensaver
      then:
      - service: esphome.hall_panel_send_command_printf
        data:
          cmd: page home

So you call the home page only when the panel is sleeping (and there is movement - your trigger).

3 Likes

Question: what does sleep mode do? If I go to settings and enable sleep.
Nothing seems to change.

When that switch (sleep mode) is on, the panel’s screen will turn off after a few second with no activity and will stay off until the next activity (someone touching the screen or one of the buttons, or HA send a comand to change screen).
When sleep mode if off the screen will be always on.

2 Likes

Thnx. I see, I just didn’t wait long enough.

1 Like