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

Just a short update on the US landscape version:

I couldn’t find a way to rotate text in Nexion. I’ve successfully wrote the text in the vertical, but it looks quite weird and takes a lot of space, even when reducing the font, so I will have to investigate the text rotating a bit more.

Thanks, I would like to help you but at the moment I’m struggling with the transfer of the blank file, with Tasmota the update screen appears but the indicator stays still, with the esphome service it gives me an transfer error. Could it be that the problem is that I can’t access Home Assistant using http but only https (either using the IP or using homeassitant.local)? And if so, how can I fix it? Thank you

Could you please share the error code/message?

I don’t think so. I’m pretty sure I’ve already transferred using my external address and I’m sure I’ve used the github address directly to download TFT files.

I would suggest you open a new thread to take this issue with you not accessing with internal IP. Please let me know the link to this new thread and I will try to help over there.

|10:35:10|[D]|[nextion_upload:169]|Connected|
| --- | --- | --- | --- |
|10:35:10|[D]|[nextion_upload:175]|Requesting URL: http://192.168.1.204:8123/local/nspanel_blank.tft|
|10:35:10|[W]|[nextion_upload:186]|HTTP Request failed; URL: http://192.168.1.204:8123/local/nspanel_blank.tft; Error: connection lost, retrying (1/5)|
|10:35:10|[W]|[nextion_upload:186]|HTTP Request failed; URL: http://192.168.1.204:8123/local/nspanel_blank.tft; Error: connection lost, retrying (2/5)|
|10:35:11|[W]|[nextion_upload:186]|HTTP Request failed; URL: http://192.168.1.204:8123/local/nspanel_blank.tft; Error: connection lost, retrying (3/5)|
|10:35:11|[W]|[nextion_upload:186]|HTTP Request failed; URL: http://192.168.1.204:8123/local/nspanel_blank.tft; Error: connection lost, retrying (4/5)|
|10:35:11|[W]|[nextion_upload:186]|HTTP Request failed; URL: http://192.168.1.204:8123/local/nspanel_blank.tft; Error: connection lost, retrying (5/5)|

One question, to make the US landscape version are you using the EU version or the US portrait one?

I’m using the EU version and moving the 2 button labels from the bottom to the right side of the screen.

If you copy and paste this link (http://192.168.1.204:8123/local/nspanel_blank.tft) in your browser, can you get the TFT file?
You mentioned you cannot access the internal address in your Home Assistant, so maybe you should try your external address instead.

if i copy and past :
ERR_EMPTY_RESPONSE.

external address:

|10:51:19|[D]|[nextion_upload:175]|Requesting URL: https://xxxxxxxx.duckdns.org:8123/config/www/1.tft|
| --- | --- | --- | --- |
|10:51:22|[E]|[nextion_upload:205]|Failed to get file size|
|10:51:22|[D]|[nextion_upload:324]|Restarting Nextion|

if I try to download it with the external address no problem

mmmmm
This is interesting… I was trying and got the same error for internal, external or even the github (main & dev) url:

[11:24:08][D][nextion_upload:169]: Connected
[11:24:08][D][nextion_upload:175]: Requesting URL: https://github.com/Blackymas/NSPanel_HA_Blueprint/raw/dev/nspanel_eu.tft
[11:24:10][W][nextion_upload:186]: HTTP Request failed; URL: https://github.com/Blackymas/NSPanel_HA_Blueprint/raw/dev/nspanel_eu.tft; Error: , retrying (1/5)
[11:24:10][W][nextion_upload:186]: HTTP Request failed; URL: https://github.com/Blackymas/NSPanel_HA_Blueprint/raw/dev/nspanel_eu.tft; Error: , retrying (2/5)
[11:24:10][W][nextion_upload:186]: HTTP Request failed; URL: https://github.com/Blackymas/NSPanel_HA_Blueprint/raw/dev/nspanel_eu.tft; Error: , retrying (3/5)
[11:24:11][W][nextion_upload:186]: HTTP Request failed; URL: https://github.com/Blackymas/NSPanel_HA_Blueprint/raw/dev/nspanel_eu.tft; Error: , retrying (4/5)
[11:24:11][W][nextion_upload:186]: HTTP Request failed; URL: https://github.com/Blackymas/NSPanel_HA_Blueprint/raw/dev/nspanel_eu.tft; Error: , retrying (5/5)
[11:24:11][D][nextion_upload:324]: Restarting Nextion
[11:24:13][D][nextion_upload:327]: Restarting esphome

I will investigate it a bit more…

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