joBr99 / nspanel-lovelace-ui

Custom Firmware for NsPanel with the design of HomeAssistant's lovelace UI in mind, works with Tasmota.
GNU General Public License v3.0
883 stars 191 forks source link

[Feature Request] Permanent notification #933

Closed marek-vrana closed 1 year ago

marek-vrana commented 1 year ago

FEATURE DESCRIPTION

I'd like to display a permanent notification with popupNotify (until closed). Currently when I declare sleepTimeout in config it always fires with higher prio than the time sent with entityUpdateDetail command. Sending 0 with entityUpdateDetail also had the same effect, so it possibly may be a bug.

ADDITIONAL CONTEXT

N/A

PANEL / FIRMWARE VERION

EU

joBr99 commented 1 year ago

What's the timeout you are sending with popupnotify? 0 should work.

marek-vrana commented 1 year ago

I'm sending it like this:

pageType~popupNotify
entityUpdateDetail~id~Title~65535~btn1~3840~btn2~61440~desc~65535~0

So by entityUpdateDetail I meant popup notify.

joBr99 commented 1 year ago

Just tested on my panel and it works fine.

Can you run weblog 3 in your tasmota console and post the log from tasmota from sending the notification until it's disappearing?

marek-vrana commented 1 year ago

Well, setting sleepTimeout to 0 and adjusting anything in app.yaml afterwards will show the screensaver on my nspanel with missing icons. I'm using latest tft 4.1.1 and actually I'm using esphome - do you think it's more related to it?

marek-vrana commented 1 year ago

okay, I did a bit more testing. The culprit here is the screensaver. Originally I thought it's because custom sensors, but I think it behaves the same with weather entities, it's just not that visible because of 1hr update interval. So if you use a sensor with frequent refresh interval (e.g. local temperature sensor) in your screensaver, fullscreen notification get's overwritten. Is there anything that can be fixed so that when notification fires, screensaver will not take precedence?

joBr99 commented 1 year ago

need to check in earlier versions the notification blocked weather/screensaver updates in the HMI Project

antibill51 commented 1 year ago

I encounter the same problem. The notification disappears after 15/20 seconds.

joBr99 commented 1 year ago

can you please send an exmaple of your popupNotify command's that have this issue?

joBr99 commented 1 year ago

So I've seen this on my panel a few times now, however I wasn't able to spot why the panel is switching to the screensaver and it's also not consistent for me. For the most time the notification stays there a really long time.

Can you enable run weblog 3 on the tasmota console and post the log during the moment the notification is going away?

joBr99 commented 1 year ago

okay nevermind, just had this again and the panel is requesting to exit the popup

21:03:03.203 MQT: tele/tasmota_nspwohn/RESULT = {"CustomRecv":"event,buttonPress2,popupNotify,bExit"}

joBr99 commented 1 year ago

I've uploaded an version that is showing the sleepValue and the sleepTimeout on the popup Page, maybe that helps to diagnose the Problem. In my tests both values stay zero so far :/

An workaround for a permanent notification in the meantime might be using an high value as timeout. Maximum should be 2147483647 seconds. Would be interesting if the issue is also happening with this value too.

FlashNextion http://nspanel.pky.eu/nspanel-sleeptimer.tft

joBr99 commented 1 year ago

Using a high value and counting seconds seems to be way more stable than doing nothing.

Try latest development version; in case the sleepTimeout in the popupNotify is 0 it is now replacing zero with the number of seconds of a year.

~FlashNextion http://nspanel.pky.eu/nspanel.tft~

FlashNextion http://nspanel.pky.eu/lui.tft

marek-vrana commented 1 year ago

Hi, I uploaded sleeptimer.tft to my panel and with both 4.1.4 and latest dev version can only confirm what I stated before:

screensaver:
  entities:
    - entity: sensor.gw2000a_v2_2_3_outdoor_temperature
    - entity: weather.home
      type: 0
    - entity: weather.home
      type: 1
    - entity: weather.home
      type: 2
    - entity: delete
    - entity: sensor.nspanel_temperature
      icon: mdi:home-thermometer-outline

I wasn't able to download tft from your latest post (404).

joBr99 commented 1 year ago

This would have been the correct URL:

FlashNextion http://nspanel.pky.eu/lui.tft

marek-vrana commented 1 year ago

still behaves the same. Need to comment out custom sensors, otherwise screensaver is shown.

joBr99 commented 1 year ago

I've found the issue please reflash development version.

FlashNextion http://nspanel.pky.eu/lui.tft

marek-vrana commented 1 year ago

it works! thank you!