NSPanel Flash from Docker

Hi all

I have successfully flashed an NSPanel with ESPHome following Marc Watt’s great video!
However I cannot get the display to update.

I am running home assistant in docker (I am running loads of things on the server so can’t go to a standalone OS) which made the whole process complicated. No ESPHome addon, doing things through the browser, Firefox not working with ESPHome web etc etc.

But, the flash was eventually succesful.

The final step is to call the TFT upload service. When I do this, the device resets, indicating the service is called succesfully, but boots back up to the original screen display.
I suspect it is to do with the location of the tft file on the server and access rights in linux… but I am not competant enough to tackle this (still learning!)

Can anyone help?

I have tried the following tft URLs to no avail:

tft_upload_url: "http://192.168.0.79:8123/opt/homeassistant/config/hmi.tft"
tft_upload_url: "http://192.168.0.79:8123/homeassistant/config/hmi.tft"
tft_upload_url: "http://192.168.0.79:8123/config/hmi.tft"
tft_upload_url: "http://192.168.0.79:8123/local/hmi.tft"
tft_upload_url: "http://192.168.0.79:8123/config/www/hmi.tft

.79 is correct for the HA instance.
I had to manually create the /www directory in /config

Longer dispair, but I can’t find a happy medium with HA. I can’t run the OS because I am running a CCTV server, Plex, NAS etc on the same hardware. And the socker based install I need isn’t user friendly with nice Add-ons and the like.

Really not trying to sound patronizing but are you really sure you are offering the new ‘compiled’ TFT file? Did you check timestamp? It indeed should be placed in config/www but the tft editor can save it anywhere. Just asking since I am a just 1-step more than ESP-newbee and with me all worked fine from the start
I am using a specific for this device tft service from HA btw, I am not at all typing in any url’s
Edit, my nspanel1.yaml contain below mentioned service, where the service then seeks for a nspanel1.tft in the www folder

EDIT2: I used this as my basis: GitHub - marcfager/nspanel-mf: Custom HMI controlled by ESPHome for the Sonoff NSPanel. Includes media player card and home screen with weather data and clock. More to come.


substitutions:
  # Name the device and it's entities
  node_name: nspanel
  device_name: NSPanel
  tft_prefix: !secret tft_prefix

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

esp32:
  board: esp32dev

# Wifi settings. Add these to your secrets.yaml. fast_connect must be true for a hidden ssid.
wifi:
  networks:
  - ssid: !secret wifi_ssid1
    password: !secret wifi_password1
  - ssid: !secret wifi_ssid2
    password: !secret wifi_password2
#  fast_connect: !secret wifi_fast_connect

# API. Add api_pwd to your secrets.yaml.
api:
  password: !secret api_pwd
  services:
    # Service to update the HMI file
    - service: upload_tft_nspanel1
      then:
        - lambda: 'id(disp1)->upload_tft();'

Yep - 100% confirmed the right file.
I think my issue comes from running in docker though. The paths and access are not straightforwrd.

I too run my HA and ESPHOME in docker, both on ‘host’…still, if you see the panel update progress moving then loading seems to take place, with me, a new TFT takes about 20-30 sec to load (donot have a stopwatch next to it :slight_smile: )
What I like about Marc Fagers setup is that it offers a dedicated TFT service…so the only thing to know is location (www) and filename …so can have multiple service for multiple panels

How do you get a specific TFT service in HA though?
I also DID NOT HAVE a www folder. I had to manually create it.

If I have a tft file I know is good, how can I push this file to the device?

Thanks

Repeating that I am not an expert but was able to re-use a lot…
For the service, see the section ‘api’ service in my above reply (also in Marc F’s example)…you need to add to your nspanelXYZ.yaml and then upload it to the device

with me this led to this below service
EDIT: I am pretty sure others now much more about alternatives but I used this and never needed to look further…

What did you set for “nextion_update_url”?

Nothing… what you see in my nspanel.yaml example above is all
it goes straight to www and fetches my nspanel1.tft
And donot ask me how this works, it just ‘did’ :slight_smile:

or… I did add a tft_prefix as you can see which refers to my instance https://…url…:8123
But I am not sure if this plays any role here
EDIT: I would love to help out more but my panel is built-in the wall now and not really looking forward to reflashing needing to take it out.
You could try with loading the example above to your nsp and then see how the service pops-up

Or…hope for more experienced users…

Have you seen this?

Not sure what URL he actually posted there, but in my case I have my nabu casa URL as the URL in the ESP-Home yaml

If the file is in www then the path is http://IP:8123/local/

I get 403: Forbidden when I try to get to that location

So… what does that mean?

I’m about to get an NSPanel too and intend to follow Mark video as well. One question remains unanswered for me: is it possible to get the 2 physical buttons to send events to Home Assistant? So that for instance, I can get them to control my (smart) lights without having them wired to the relays. (no-one wants their smart lights to go offline). Thanks.

Yes that is possible.
Either you decouple the switches from the relay with ESP-Home code or you wire it so that the relays are not used to switch the loads.

1 Like