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

OK, will have a look,

So I make some changes in ESPHome yaml file and some automation in HA?

Sorry I’m a noob when it comes to this :slight_smile:

A good place to start is here. There are various links in his comments that provide further useful background. Try and understand his yaml file then look at the yaml files the likes of myselff, @lovejoy777 etc have posted above which include elements of what you want to do, but probably not the whole thing.

You can probably do everything in the yaml file, you shouldn’t need automations in HA.

All examples I have seen so far is that it increase or decrease 1 or what ever you set for one click on the button. I’m looking for some how that it should increase or decrease while I hold the button pressed. Not only x numbers and I need to press again. I haven’t seen anything like that. I have also seen sliders, but not what I’m looking for :slight_smile:

you will need a loop in your on_multiclick. look here, he is using a loop in esphome. although he’s using it to set brightness in steps with time, i presume you can alter the code to achieve what you want.

1 Like

This is my dimmer yaml that cycles through Dim → Bright → dim with a single hold. release and hold again and the cycle reverses. Single click is on/off toggle.

2 Likes

do you mind sharing the hmi file (Nextion file) or haven’t you changed to custom UI?

here is the start of my new thermostat page :slight_smile:

2 Likes

I use the default HMI and the nspanel component to send/receive JSON to control the widgets.

circular slider for target temperature :grin:
https://youtu.be/KqFpyDbmm_E

ok circular slider is finished, goes from 0-28 C. all code is on GitHub, I’ve included the svg images too incase anyone wants a different background.

the code for the variable given for target temperature is in a timer within the hmi.

1 Like

What is a yalm?
Or do you mean yaml?

I’m sure it’s a typo and should be yaml :joy:

While it looks really cool, I could never understand circular sliders on the flat-screen. It’s got to be the most user-unfriendly way of controlling the temperature, since it’s really hard to move your finger in a circle while seeing if you are actually doing something under that finger. It works wonderfully on nest, but that’s because it’s not a touch-screen and control is outside of the area that displays progress.

Hello @jobraun,

thanks for sharing. I tried it following the instructions in your repo and ended up being stuck in the “waiting for content, this is taking longer than usual” screen. I have already double and triple checked my configuration files but cannot see where I made an error.

This is my appdaemon.yaml:

---
secrets: /config/secrets.yaml
appdaemon:
  latitude: 52.0
  longitude: 4.0
  elevation: 2
  time_zone: Europe/Berlin
  plugins:
    HASS:
      type: hass
    MQTT:
      type: mqtt
      namespace: mqtt
      client_id: "appdaemon"
      client_host: 192.168.0.39
      client_port: 1883
      client_user: !secret mqtt_user
      client_password: !secret mqtt_password
      client_topics: NONE
http:
  url: http://127.0.0.1:5050
admin:
api:
hadashboard:

and my apps.yaml:

---
nspanel-1:
  module: nspanel-lovelace-ui
  class: NsPanelLovelaceUIManager
  config:
    panelRecvTopic: "tele/tasmota_nspanel/RESULT"
    panelSendTopic: "cmnd/tasmota_nspanel/CustomSend"
    updateMode: "auto-notify"
    timeoutScreensaver: 20
    #brightnessScreensaver: 10
    brightnessScreensaver:
      - time: "7:00:00"
        value: 10
      - time: "23:00:00"
        value: 0
    locale: "de_DE" # only used if babel python package is installed
    dateFormatBabel: "full" # only used if babel python package is installed
                            # formatting options on https://babel.pocoo.org/en/latest/dates.html?highlight=name%20of%20day#date-fields
    timeFormat: "%H:%M"
    dateFormat: "%A, %d. %B %Y" # ignored if babel python package is installed
    weather: weather.home
    pages:
      - type: cardEntities
        heading: Example Page 1
        items:
          - cover.rollo_wohnzimmer
          - light.wohnzimmer_decke
          - binary_sensor.bewegungsmelder_kuche
          - sensor.bewegungsmelder_kuche
          - switch.steckdose_flurregal

And here’s what the information tab in tasmota says:

Can you or anybody else see what I made wrong? The nspanel is found in HA and all switches and sensors are working. HA receives messages on topic tasmota_nspanel that I send via my analyzer app and vice versa. Messages published on the topic in HA, can be received in the analyzer.

I seem to have a problem that I can’t get some kind of info from Home Assistant to my NSPanels.

I removed everything and tried Christopher Mastos intro Youtube video (Flashing the Sonoff NSPanel with ESPHome - how to get a custom UI for Home Assistant! - YouTube)
But I can’t get the temp on the screen, it just say nan F.

Could I have missed some configuration thing in Home Assistant or Nextion that should already been done?

This is now how my yaml look like, “sensor.temperature_158d000156d8c5” is my own Aqara Zigbee sensor

# Grab current temperature from Home Assistant
  - platform: homeassistant
    id: current_temperature
    entity_id: sensor.temperature_158d000156d8c5
    attribute: temperature
    on_value:
      # Push it to the display
      then:
        - lambda: 'id(disp1).set_component_text_printf("temp", "%.1f ""\xb0""c", x);'

all help I can get is appreciated :slight_smile:

Problem solved! Spent hours researching until I came up with the idea of restarting AppDaemon, which helped. That’s just great, @jobraun! But even though I have multiple pages in my apps.yaml, scrolling through them is not possible. I keep getting stuck on the first page in the Tasmota console even though the console says that the button are being pressed.

13:53:28.484 MQT: tele/tasmota_nspanel/RESULT = {“CustomRecv”:“event,buttonPress2,cardEntities,bNext”}
13:53:32.390 MQT: tele/tasmota_nspanel/RESULT = {“CustomRecv”:“event,buttonPress2,cardEntities,bPrev”}

@Zahnweh Most likely you’ve mixed up the development version of the display firmware with the current release in HACS.

Download the current main branch in HACS (Touching doesn't open cards. · Issue #71 · joBr99/nspanel-lovelace-ui · GitHub) or flash the display firmware mentioned in the release notes of v1.7.3.

Just update in HACS to v1.8.3 and restart AppDaemon, just released v1.8.3

This did the trick! Thanks a lot! Also thanks for your great work!

  - platform: homeassistant
    id: hotwater_temperature
    entity_id: sensor.water_temp
    on_value:
      then:
        - wait_until:
            switch.is_on: nextion_init
        - lambda: id(disp1).set_component_text_printf("Thermostat.hwtemp_txt", "%.0f", id(hotwater_temperature).state);

try this format @DariBer

Thermostat is the page name & hwtemp_text the text field.

Hi, can you please share your code? I use domoticz and I want to control
nspanel over the MQTT. Greetings