Sonoff NSPanel by ITead - Smart Scene Wall Switch based on ESP32 and custom Nextion Touch Screen Panel Display (non-Pro variant)

i will upload to github tomorrow, I’m very nearly done :grin:

1 Like

I’m surprised, so I’m bound to have a limit too. I limited the code and all the functions a bit “gadjet” so I don’t regret now. I also imagine that the optimization of the images of the tft file must play?
it is therefore necessary to have the maximum of code in automation with home assistant. I will work above all in this way knowing that.

There is no way you can change the partition sizes?
(4) #222 More Memory for the ESP32 without Soldering (How-to adapt partition sizes) - YouTube

i read somewhere that its only the ota function that requires the extra 30 odd %.and i presume that the tft goes to a different partition because the size of the tft file doesn’t seem to have any effect on the 68% we have. after watching the above video that makes sense now :rofl:

here is part of the explanation of component and memory breakdown. it should be quite possible to increase its size

When I have it finished I will share the code.
I manage everything from node-red and mqtt.
I have even created a screen where the notices that the house is generating come out.


Node-red*(sends info depending on the screen,…)*.
nspanel
When I have the debugged code I will share it.

3 Likes

Hi when I flash my NS Panel,it won’t connect to my wifi.

Here my nspanel-mf.yml :

substitutions:
  # Name the device and it's entities
  device_name: nspanel-dev

# Example config.yaml
esphome:
  name: nspanel
  comment: $device_name

esp32:
  board: esp32dev




wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  #fast_connect: !secret wifi_fast_connect

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Nspanel-Mf Fallback Hotspot"
    password: ""

captive_portal:

# NSPanel YAML by marcfager. Please check github for credits: https://github.com/marcfager/nspanel-mf
# Version 2022-01-19


# API. Add api_pwd to your secrets.yaml.
api:
  
# Logger. Disable the temperature sensor etc. to focus on the HMI development
logger:
  baud_rate: 0
  level: DEBUG
  logs:
    sensor: WARN
    resistance: WARN
    text_sensor: WARN
    ntc: WARN

# OTA (Over the air updates) password. Add to your secrets.yaml
ota:
  #password: !secret ota_pwd

# Uart for the Nextion display
uart:
  tx_pin: 16
  rx_pin: 17
  baud_rate: 115200
  id: tf_uart

# Functionality for the Nextion display
external_components:
  - source: github://pr#2956
    components: [nextion]
    refresh: 1h

# A reboot button is always useful
button:
  - platform: restart
    name: $device_name Restart

# Binary sensors
binary_sensor:
  # Left button below the display
  - platform: gpio
    name: $device_name Left Button
    pin:
      number: 14
      inverted: true
    on_click:
      - switch.toggle: relay_1

  # Right button below the display
  - platform: gpio
    name: $device_name Right Button
    pin:
      number: 27
      inverted: true
    on_click:
      - switch.toggle: relay_2


 

output:
  # Buzzer for playing tones
  - platform: ledc
    id: buzzer_out
    pin:
      number: 21
      
switch:
  # Physical relay 1
  - platform: gpio
    name: $device_name Relay 1
    id: relay_1
    pin:
      number: 22

  # Physical relay 2
  - platform: gpio
    name: $device_name Relay 2
    id: relay_2
    pin:
      number: 19

  # Turn screen power on/off. Easy way to configure the screen power control, but this should not be used from HA, as all components must be re-initialized afterwards. For lights, names of lights etc. this practically means that the state must change once to happen.
  - platform: gpio
    name: $device_name Screen Power
    id: screen_power
    entity_category: config
    pin:
      number: 4
      inverted: true
    restore_mode: ALWAYS_ON

  # Basically a global variable to keep track on whether the Nextion display is ready or not. Delays initial info from HA to the display.
  - platform: template
    name: $device_name Nextion inited
    id: nextion_init
    entity_category: config
    restore_state: false
    assumed_state: off
    optimistic: true

Did you find your problem ? I have the same one.

No, but then again I haven’t had the time to look into it yet haha

Have you tried to put the manual ip…

> wifi:
>   ssid: "XXXXX"
>   password: "XXXXX"
> 
>   **#Optional manual IP**
>   manual_ip:
>     static_ip: XXX.XXX.XXX.XX
>     gateway: XXX.XXX.XXX.X
>     subnet: XXX.XXX.XXX.X
1 Like

mine doesn’t work with “http//:homeassistant.local:8123” i have to use “http//:192.168.0.20:8123”

the only other time i have connection issues is when my memory get to 68.5% as mentioned above.

2 Likes

In case you haven’t got your secrets right, try it without using secrets. Also, if you switch off your wifi do you get the hotspot? If not, then your approach must be faulty so go back to the simplest set up possible.

2 Likes

Yes I try this also, I dont see the device connected to my wifi

Here is my Project. NSpanel/README.md at main · lovejoy777/NSpanel · GitHub
video Link: NSpanel Custom Firmware - YouTube.

1 Like

Hi PedroKTFC

I strip to code to what I think is the minimal configuration, but stil not connect to the Wifi or dont see the AP. Do you have more idea of what I do wrong ?

esphome:
  name: nspanel-1

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  

wifi:
  ssid: ""
  password: ""

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Nspanel-1 Fallback Hotspot"
    password: "123456789"

captive_portal:

I presume you’ve flashed your nspanel following Chris’s instructions here. I noticed you don’t have these lines in your yaml which I have just after the substitutions:

# Note: this may not be needed if the pull request has been merged.
# Check https://github.com/esphome/esphome/pull/2956 for current status.
external_components:
  - source: github://pr#2956
    components: [nextion]
    refresh: 1h

Finally, have you checked if your router has it in its list of connected devices?

Don’t think you need this either

You need to assign a fixed ip address.

wifi:
  ssid: vivelecanada
  password: jkjsaDGVKSAJDHSBKCSCKA
  use_address: 192.145.1.26

Hi,

Here is my minimal code is working, my ESPHome was not up to date thank you.

Do you know if I put HTTPS into the tft_url if it can cause a problem ?

Is it possible to use this protocol ?

it is essential to update your interface if you use a custom interface designed with nextion

in this case you must put your tft in the www file of home assistant with this type of url in the yalm of esp home:

display:
  - platform: nextion
    id: disp1
    uart_id: tf_uart
    tft_url: http://192.xxx.x.xx:8123/local/nspanel_config.tft