joBr99 / nspanel-issue-graveyard

place to move waiting for content issues to and to keep the search a bit cleaned up
0 stars 0 forks source link

[Help] Waiting for Content #45

Closed Doser86 closed 2 years ago

Doser86 commented 2 years ago

PROBLEM DESCRIPTION

I'm seeing the waiting for content message on the Panel and I'm unable to find the configuration issue.

[] I've double checked each step explained in the FAQ:

https://docs.nspanel.pky.eu/faq/#waiting-for-content-this-is-taking-longer-than-usual-on-the-screen

REQUESTED INFORMATION

Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!

https://1drv.ms/u/s!AnevBfzUGi77gtACBsRLiPYGmU-izw?e=yefaPh


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.86.39" client_port: "1883" client_user: "DVES_31FD40" client_password: "xxxxx" client_topics: NONE http: url: http://127.0.0.1:5050 admin: api: hadashboard:


- [ ] Provide your apps.yaml:

apps.yaml here:

- [ ] Go to Settings>Add-ons>AppDaemon>Log and then, provide the output of the log after restarting the appdaemon container:

Log output here:

2022-10-20 20:52:07.507013 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/mqtt.py - ignoring 2022-10-20 20:52:07.511253 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/apis.py - ignoring 2022-10-20 20:52:07.515365 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/theme.py - ignoring 2022-10-20 20:52:07.518303 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/config.py - ignoring 2022-10-20 20:52:07.521351 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/localization.py - ignoring 2022-10-20 20:52:07.523998 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/icon_mapping.py - ignoring 2022-10-20 20:52:07.527774 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/helper.py - ignoring 2022-10-20 20:52:07.530899 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/controller.py - ignoring 2022-10-20 20:52:07.538557 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/icons.py - ignoring 2022-10-20 20:52:07.542694 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/updater.py - ignoring 2022-10-20 20:52:07.547398 INFO AppDaemon: Initializing app nspanel-1 using class NsPanelLovelaceUIManager from module nspanel-lovelace-ui 2022-10-20 20:52:07.560057 INFO nspanel-1: Starting 2022-10-20 20:52:07.562894 WARNING AppDaemon: Unknown Plugin Configuration in get_plugin_api() 2022-10-20 20:52:07.573689 INFO nspanel-1: Input config: {'panelRecvTopic': 'tele/tasmota_sov1nspanel/RESULT', 'panelSendTopic': 'cmnd/tasmota_sov1nspanel/CustomSend', 'screensaver': {'entity': 'weather.k3ll3r', 'weatherOverrideForecast4': {'entity': 'sensor.example_item', 'name': 'name', 'icon': 'lightbulb'}, 'alternativeLayout': True}} 2022-10-20 20:52:07.578545 INFO nspanel-1: Loaded config: {'panelRecvTopic': 'tele/tasmota_sov1nspanel/RESULT', 'panelSendTopic': 'cmnd/tasmota_sov1nspanel/CustomSend', 'updateMode': 'auto-notify', 'model': 'eu', 'sleepTimeout': 20, 'sleepBrightness': 20, 'screenBrightness': 100, 'defaultBackgroundColor': 'ha-dark', 'sleepTracking': None, 'sleepTrackingZones': ['not_home', 'off'], 'sleepOverride': None, 'locale': 'en_US', 'timeFormat': '%H:%M', 'dateFormatBabel': 'full', 'dateAdditionalTemplate': '', 'timeAdditionalTemplate': '', 'dateFormat': '%A, %d. %B %Y', 'cards': [{'type': 'cardEntities', 'entities': [{'entity': 'iText.', 'name': 'MQTT Config successful', 'icon': 'mdi:check', 'color:': [0, 255, 0]}, {'entity': 'iText.', 'name': 'Continue adding', 'icon': 'mdi:arrow-right-bold'}, {'entity': 'iText.', 'name': 'cards to your', 'icon': 'mdi:card'}, {'entity': 'iText.', 'name': 'apps.yaml', 'icon': 'mdi:cog'}], 'title': 'Setup successful'}], 'screensaver': {'type': 'screensaver', 'entity': 'weather.k3ll3r', 'weatherUnit': 'celsius', 'forecastSkip': 0, 'weatherOverrideForecast1': None, 'weatherOverrideForecast2': None, 'weatherOverrideForecast3': None, 'weatherOverrideForecast4': {'entity': 'sensor.example_item', 'name': 'name', 'icon': 'lightbulb'}, 'doubleTapToUnlock': False, 'alternativeLayout': True, 'defaultCard': None, 'key': 'screensaver'}, 'hiddenCards': []} 2022-10-20 20:52:07.583614 WARNING nspanel-1: ------------------------------------------------------------ 2022-10-20 20:52:07.584656 WARNING nspanel-1: Unexpected error running initialize() for nspanel-1 2022-10-20 20:52:07.585791 WARNING nspanel-1: ------------------------------------------------------------ 2022-10-20 20:52:07.587204 WARNING nspanel-1: Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/appdaemon/app_management.py", line 165, in initialize_app await utils.run_in_executor(self, init) File "/usr/lib/python3.10/site-packages/appdaemon/utils.py", line 337, in run_in_executor response = future.result() File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, *self.kwargs) File "/config/appdaemon/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py", line 19, in initialize mqtt_api.mqtt_publish(topic_send.replace("CustomSend", "GetDriverVersion"), "x") AttributeError: 'NoneType' object has no attribute 'mqtt_publish' 2022-10-20 20:52:07.589618 WARNING nspanel-1: ------------------------------------------------------------ 2022-10-20 20:52:21.048772 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:52:26.068034 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:52:31.086538 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:52:36.106152 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:52:41.124723 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:52:46.140777 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:52:51.162390 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:52:56.183292 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:53:01.203305 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:53:06.228719 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:53:11.250172 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:53:16.268482 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:53:21.287672 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:53:26.307238 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:53:31.326786 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:53:36.344705 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:53:41.368678 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:53:46.390657 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:53:51.410731 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:53:56.427728 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:54:01.446046 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:54:06.463858 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:54:11.483462 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:54:16.503555 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:54:21.526231 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:54:26.548554 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:54:31.569717 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:54:36.589559 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:54:41.610179 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:54:46.628836 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:54:51.651369 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:54:56.676542 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:55:01.694693 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:55:06.711442 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:55:11.727878 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:55:17.703969 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:55:24.710079 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:55:31.347852 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:55:37.053021 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:55:53.223076 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:55:58.336787 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:56:03.363912 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:56:08.390476 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:56:13.417958 WARNING HASS: Disconnected from Home Assistant, retrying in 5 seconds 2022-10-20 20:56:19.043220 INFO HASS: Connected to Home Assistant 2022.10.3 2022-10-20 20:56:24.786863 INFO HASS: Evaluating startup conditions 2022-10-20 20:56:24.993479 INFO HASS: Startup condition met: hass state=RUNNING 2022-10-20 20:56:24.995955 INFO HASS: All startup conditions met 2022-10-20 20:56:25.732800 INFO AppDaemon: Processing restart for HASS 2022-10-20 20:56:25.734662 INFO AppDaemon: Terminating nspanel-1 2022-10-20 20:56:25.739751 INFO AppDaemon: Initializing app nspanel-1 using class NsPanelLovelaceUIManager from module nspanel-lovelace-ui 2022-10-20 20:56:25.766778 INFO nspanel-1: Starting 2022-10-20 20:56:25.770221 WARNING AppDaemon: Unknown Plugin Configuration in get_plugin_api() 2022-10-20 20:56:25.776686 INFO nspanel-1: Input config: {'panelRecvTopic': 'tele/tasmota_sov1nspanel/RESULT', 'panelSendTopic': 'cmnd/tasmota_sov1nspanel/CustomSend', 'screensaver': {'entity': 'weather.k3ll3r', 'weatherOverrideForecast4': {'entity': 'sensor.example_item', 'name': 'name', 'icon': 'lightbulb'}, 'alternativeLayout': True}} 2022-10-20 20:56:25.782085 INFO nspanel-1: Loaded config: {'panelRecvTopic': 'tele/tasmota_sov1nspanel/RESULT', 'panelSendTopic': 'cmnd/tasmota_sov1nspanel/CustomSend', 'updateMode': 'auto-notify', 'model': 'eu', 'sleepTimeout': 20, 'sleepBrightness': 20, 'screenBrightness': 100, 'defaultBackgroundColor': 'ha-dark', 'sleepTracking': None, 'sleepTrackingZones': ['not_home', 'off'], 'sleepOverride': None, 'locale': 'en_US', 'timeFormat': '%H:%M', 'dateFormatBabel': 'full', 'dateAdditionalTemplate': '', 'timeAdditionalTemplate': '', 'dateFormat': '%A, %d. %B %Y', 'cards': [{'type': 'cardEntities', 'entities': [{'entity': 'iText.', 'name': 'MQTT Config successful', 'icon': 'mdi:check', 'color:': [0, 255, 0]}, {'entity': 'iText.', 'name': 'Continue adding', 'icon': 'mdi:arrow-right-bold'}, {'entity': 'iText.', 'name': 'cards to your', 'icon': 'mdi:card'}, {'entity': 'iText.', 'name': 'apps.yaml', 'icon': 'mdi:cog'}], 'title': 'Setup successful'}], 'screensaver': {'type': 'screensaver', 'entity': 'weather.k3ll3r', 'weatherUnit': 'celsius', 'forecastSkip': 0, 'weatherOverrideForecast1': None, 'weatherOverrideForecast2': None, 'weatherOverrideForecast3': None, 'weatherOverrideForecast4': {'entity': 'sensor.example_item', 'name': 'name', 'icon': 'lightbulb'}, 'doubleTapToUnlock': False, 'alternativeLayout': True, 'defaultCard': None, 'key': 'screensaver'}, 'hiddenCards': []} 2022-10-20 20:56:25.786934 WARNING nspanel-1: ------------------------------------------------------------ 2022-10-20 20:56:25.788014 WARNING nspanel-1: Unexpected error running initialize() for nspanel-1 2022-10-20 20:56:25.789053 WARNING nspanel-1: ------------------------------------------------------------ 2022-10-20 20:56:25.790776 WARNING nspanel-1: Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/appdaemon/app_management.py", line 165, in initialize_app await utils.run_in_executor(self, init) File "/usr/lib/python3.10/site-packages/appdaemon/utils.py", line 337, in run_in_executor response = future.result() File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(self.args, **self.kwargs) File "/config/appdaemon/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py", line 19, in initialize mqtt_api.mqtt_publish(topic_send.replace("CustomSend", "GetDriverVersion"), "x") AttributeError: 'NoneType' object has no attribute 'mqtt_publish' 2022-10-20 20:56:25.792016 WARNING nspanel-1: ------------------------------------------------------------```

ADDITIONAL INFORMATION

Add information about your setup here, if any. (For example docker version of AppDaemon instead of the HomeAssistant Add-on)

joBr99 commented 2 years ago

AttributeError: 'NoneType' object has no attribute 'mqtt_publish'

This error is related to MQTT not being available. Can you restart the AppDeamon Add-on and add the startup log (that contains the MQTT init)?

Doser86 commented 2 years ago

s6-rc: info: service s6rc-oneshot-runner: starting s6-rc: info: service s6rc-oneshot-runner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service fix-attrs successfully started s6-rc: info: service legacy-cont-init: starting cont-init: info: running /etc/cont-init.d/00-banner.sh

Add-on: AppDaemon Python Apps and Dashboard using AppDaemon 4.x for Home Assistant

Add-on version: 0.9.3 You are running the latest version of this add-on. System: Home Assistant OS 9.2 (aarch64 / raspberrypi4-64) Home Assistant Core: 2022.10.3 Home Assistant Supervisor: 2022.10.0

Please, share the above information when looking for help or support in, e.g., GitHub, forums or the Discord chat.

cont-init: info: /etc/cont-init.d/00-banner.sh exited 0 cont-init: info: running /etc/cont-init.d/01-log-level.sh cont-init: info: /etc/cont-init.d/01-log-level.sh exited 0 cont-init: info: running /etc/cont-init.d/appdaemon.sh cont-init: info: /etc/cont-init.d/appdaemon.sh exited 0 s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service legacy-services: starting services-up: info: copying legacy longrun appdaemon (no readiness notification) s6-rc: info: service legacy-services successfully started [22:45:47] INFO: Starting AppDaemon... 2022-10-20 22:45:59.426677 INFO AppDaemon: AppDaemon Version 4.2.1 starting 2022-10-20 22:45:59.428303 INFO AppDaemon: Python version is 3.10.5 2022-10-20 22:45:59.428965 INFO AppDaemon: Configuration read from: /config/appdaemon/appdaemon.yaml 2022-10-20 22:45:59.429482 INFO AppDaemon: Added log: AppDaemon 2022-10-20 22:45:59.429968 INFO AppDaemon: Added log: Error 2022-10-20 22:45:59.430402 INFO AppDaemon: Added log: Access 2022-10-20 22:45:59.430932 INFO AppDaemon: Added log: Diag 2022-10-20 22:46:01.006922 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin 2022-10-20 22:46:01.554843 INFO HASS: HASS Plugin Initializing 2022-10-20 22:46:01.555531 INFO HASS: HASS Plugin initialization complete 2022-10-20 22:46:01.556702 INFO AppDaemon: Loading Plugin MQTT using class MqttPlugin from module mqttplugin 2022-10-20 22:46:01.886192 INFO MQTT: MQTT Plugin Initializing 2022-10-20 22:46:01.887141 INFO MQTT: Using 'appdaemon/status' as Will Topic 2022-10-20 22:46:01.888080 INFO MQTT: Using 'appdaemon/status' as Birth Topic 2022-10-20 22:46:01.890036 INFO AppDaemon: Initializing HTTP 2022-10-20 22:46:01.891766 INFO AppDaemon: Using 'ws' for event stream 2022-10-20 22:46:01.908956 INFO AppDaemon: Starting API 2022-10-20 22:46:01.918192 INFO AppDaemon: Starting Admin Interface 2022-10-20 22:46:01.919499 INFO AppDaemon: Starting Dashboards 2022-10-20 22:46:01.966337 CRITICAL MQTT: There was an error while trying to setup the Mqtt Service. Error was: '<=' not supported between instances of 'str' and 'int' 2022-10-20 22:46:01.974157 INFO HASS: Connected to Home Assistant 2022.10.3 2022-10-20 22:46:02.028543 INFO AppDaemon: App 'nspanel-1' added 2022-10-20 22:46:02.031388 INFO AppDaemon: Found 1 total apps 2022-10-20 22:46:02.033101 INFO AppDaemon: Starting Apps with 1 workers and 1 pins 2022-10-20 22:46:02.036664 INFO AppDaemon: Running on port 5050 2022-10-20 22:46:02.164097 INFO HASS: Evaluating startup conditions 2022-10-20 22:46:02.186774 INFO HASS: Startup condition met: hass state=RUNNING 2022-10-20 22:46:02.189005 INFO HASS: All startup conditions met 2022-10-20 22:46:02.320440 INFO AppDaemon: Got initial state from namespace default 2022-10-20 22:46:06.992306 CRITICAL MQTT: Could not Complete Connection to Broker, please Ensure Broker at URL 192.168.86.39:1883 is correct and broker is not down and restart Appdaemon 2022-10-20 22:46:06.993395 CRITICAL MQTT: Could not complete MQTT Plugin initialization, trying again in 5 seconds 2022-10-20 22:46:12.002898 CRITICAL MQTT: There was an error while trying to setup the Mqtt Service. Error was: '<=' not supported between instances of 'str' and 'int' 2022-10-20 22:46:17.010031 CRITICAL MQTT: Could not Complete Connection to Broker, please Ensure Broker at URL 192.168.86.39:1883 is correct and broker is not down and restart Appdaemon 2022-10-20 22:46:17.011227 CRITICAL MQTT: Could not complete MQTT Plugin initialization, trying again in 5 seconds 2022-10-20 22:46:22.015806 CRITICAL MQTT: There was an error while trying to setup the Mqtt Service. Error was: '<=' not supported between instances of 'str' and 'int' 2022-10-20 22:46:27.023781 CRITICAL MQTT: Could not Complete Connection to Broker, please Ensure Broker at URL 192.168.86.39:1883 is correct and broker is not down and restart Appdaemon 2022-10-20 22:46:27.025055 CRITICAL MQTT: Could not complete MQTT Plugin initialization, trying again in 5 seconds

joBr99 commented 2 years ago

Try to change client_port: "1883" to client_port: 1883

And restart AppDeamon afterwards

Doser86 commented 2 years ago

2022-10-20 22:52:16.821051 CRITICAL MQTT: Could not complete MQTT Plugin initialization, for Connection was refused due to Not Authorised 2022-10-20 22:52:16.822840 CRITICAL MQTT: MQTT Client Disconnected Abruptly. Will attempt reconnection 2022-10-20 22:52:17.219825 CRITICAL MQTT: Could not complete MQTT Plugin initialization, trying again in 5 seconds 2022-10-20 22:52:17.831322 CRITICAL MQTT: Could not complete MQTT Plugin initialization, for Connection was refused due to Not Authorised 2022-10-20 22:52:17.834247 CRITICAL MQTT: MQTT Client Disconnected Abruptly. Will attempt reconnection 2022-10-20 22:52:19.841850 CRITICAL MQTT: Could not complete MQTT Plugin initialization, for Connection was refused due to Not Authorised 2022-10-20 22:52:19.843835 CRITICAL MQTT: MQTT Client Disconnected Abruptly. Will attempt reconnection 2022-10-20 22:52:23.852086 CRITICAL MQTT: Could not complete MQTT Plugin initialization, for Connection was refused due to Not Authorised 2022-10-20 22:52:23.854911 CRITICAL MQTT: MQTT Client Disconnected Abruptly. Will attempt reconnection 2022-10-20 22:52:24.012323 CRITICAL MQTT: Could not complete MQTT Plugin initialization, trying again in 5 seconds 2022-10-20 22:52:31.863280 CRITICAL MQTT: Could not complete MQTT Plugin initialization, for Connection was refused due to Not Authorised 2022-10-20 22:52:31.866487 CRITICAL MQTT: MQTT Client Disconnected Abruptly. Will attempt reconnection 2022-10-20 22:52:32.274535 CRITICAL MQTT: Could not complete MQTT Plugin initialization, trying again in 5 seconds

Doser86 commented 2 years ago

This after doing what you wrote

joBr99 commented 2 years ago

This is good, now you have an issue with your username/password it needs to auth against your broker, so the username looks wrong. On the tasmota settings you've used "mqtt" as the username.

Doser86 commented 2 years ago

I made a user that have mqtt as user name, and password that I use in HA.

joBr99 commented 2 years ago

Yes, use this one in your AppDeamon config and not DVES_31FD40 as the username.

Doser86 commented 2 years ago
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/00-banner.sh
-----------------------------------------------------------
 Add-on: AppDaemon
 Python Apps and Dashboard using AppDaemon 4.x for Home Assistant
-----------------------------------------------------------
 Add-on version: 0.9.3
 You are running the latest version of this add-on.
 System: Home Assistant OS 9.2  (aarch64 / raspberrypi4-64)
 Home Assistant Core: 2022.10.3
 Home Assistant Supervisor: 2022.10.0
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
cont-init: info: /etc/cont-init.d/00-banner.sh exited 0
cont-init: info: running /etc/cont-init.d/01-log-level.sh
cont-init: info: /etc/cont-init.d/01-log-level.sh exited 0
cont-init: info: running /etc/cont-init.d/appdaemon.sh
cont-init: info: /etc/cont-init.d/appdaemon.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun appdaemon (no readiness notification)
s6-rc: info: service legacy-services successfully started
[23:00:21] INFO: Starting AppDaemon...
2022-10-20 23:00:30.669094 INFO AppDaemon: AppDaemon Version 4.2.1 starting
2022-10-20 23:00:30.669799 INFO AppDaemon: Python version is 3.10.5
2022-10-20 23:00:30.670371 INFO AppDaemon: Configuration read from: /config/appdaemon/appdaemon.yaml
2022-10-20 23:00:30.670950 INFO AppDaemon: Added log: AppDaemon
2022-10-20 23:00:30.671698 INFO AppDaemon: Added log: Error
2022-10-20 23:00:30.672300 INFO AppDaemon: Added log: Access
2022-10-20 23:00:30.672886 INFO AppDaemon: Added log: Diag
2022-10-20 23:00:31.064888 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2022-10-20 23:00:31.479699 INFO HASS: HASS Plugin Initializing
2022-10-20 23:00:31.480500 INFO HASS: HASS Plugin initialization complete
2022-10-20 23:00:31.481426 INFO AppDaemon: Loading Plugin MQTT using class MqttPlugin from module mqttplugin
2022-10-20 23:00:31.723377 INFO MQTT: MQTT Plugin Initializing
2022-10-20 23:00:31.724548 INFO MQTT: Using 'appdaemon/status' as Will Topic
2022-10-20 23:00:31.725233 INFO MQTT: Using 'appdaemon/status' as Birth Topic
2022-10-20 23:00:31.726978 INFO AppDaemon: Initializing HTTP
2022-10-20 23:00:31.728219 INFO AppDaemon: Using 'ws' for event stream
2022-10-20 23:00:31.739111 INFO AppDaemon: Starting API
2022-10-20 23:00:31.747573 INFO AppDaemon: Starting Admin Interface
2022-10-20 23:00:31.748979 INFO AppDaemon: Starting Dashboards
2022-10-20 23:00:31.792622 INFO HASS: Connected to Home Assistant 2022.10.3
2022-10-20 23:00:31.802660 INFO MQTT: Connected to Broker at URL 192.168.86.39:1883
2022-10-20 23:00:31.822046 INFO AppDaemon: Got initial state from namespace mqtt
2022-10-20 23:00:31.823456 INFO MQTT: MQTT Plugin initialization complete
2022-10-20 23:00:31.843189 INFO AppDaemon: App 'nspanel-1' added
2022-10-20 23:00:31.848413 INFO AppDaemon: Found 1 total apps
2022-10-20 23:00:31.850510 INFO AppDaemon: Starting Apps with 1 workers and 1 pins
2022-10-20 23:00:31.853893 INFO AppDaemon: Running on port 5050
2022-10-20 23:00:31.970545 INFO HASS: Evaluating startup conditions
2022-10-20 23:00:31.995661 INFO HASS: Startup condition met: hass state=RUNNING
2022-10-20 23:00:31.996722 INFO HASS: All startup conditions met
2022-10-20 23:00:32.098559 INFO AppDaemon: Got initial state from namespace default
2022-10-20 23:00:33.872956 INFO AppDaemon: Scheduler running in realtime
2022-10-20 23:00:33.884096 INFO AppDaemon: Adding /config/appdaemon/apps to module import path
2022-10-20 23:00:33.885630 INFO AppDaemon: Adding /config/appdaemon/apps/nspanel-lovelace-ui to module import path
2022-10-20 23:00:33.887230 INFO AppDaemon: Adding /config/appdaemon/apps/nspanel-lovelace-ui/luibackend to module import path
2022-10-20 23:00:33.888714 INFO AppDaemon: Adding /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/translations to module import path
2022-10-20 23:00:33.890309 INFO AppDaemon: Adding /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/translations/backend to module import path
2022-10-20 23:00:33.892098 INFO AppDaemon: Adding /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/translations/frontend to module import path
2022-10-20 23:00:33.916183 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/hello.py - ignoring
2022-10-20 23:00:33.918986 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py
2022-10-20 23:00:34.476276 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/pages.py - ignoring
2022-10-20 23:00:34.479397 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/mqtt.py - ignoring
2022-10-20 23:00:34.482415 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/apis.py - ignoring
2022-10-20 23:00:34.485499 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/theme.py - ignoring
2022-10-20 23:00:34.488669 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/config.py - ignoring
2022-10-20 23:00:34.491659 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/localization.py - ignoring
2022-10-20 23:00:34.494613 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/icon_mapping.py - ignoring
2022-10-20 23:00:34.497617 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/helper.py - ignoring
2022-10-20 23:00:34.502367 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/controller.py - ignoring
2022-10-20 23:00:34.505781 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/icons.py - ignoring
2022-10-20 23:00:34.509258 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/updater.py - ignoring
2022-10-20 23:00:34.511942 INFO AppDaemon: Initializing app nspanel-1 using class NsPanelLovelaceUIManager from module nspanel-lovelace-ui
2022-10-20 23:00:34.716852 INFO nspanel-1: Starting
2022-10-20 23:00:34.731896 INFO nspanel-1: Input config: {'panelRecvTopic': 'tele/tasmota_sov1nspanel/RESULT', 'panelSendTopic': 'cmnd/tasmota_sov1nspanel/CustomSend', 'screensaver': {'entity': 'weather.k3ll3r', 'weatherOverrideForecast4': {'entity': 'sensor.example_item', 'name': 'name', 'icon': 'lightbulb'}, 'alternativeLayout': True}}
2022-10-20 23:00:34.735744 INFO nspanel-1: Loaded config: {'panelRecvTopic': 'tele/tasmota_sov1nspanel/RESULT', 'panelSendTopic': 'cmnd/tasmota_sov1nspanel/CustomSend', 'updateMode': 'auto-notify', 'model': 'eu', 'sleepTimeout': 20, 'sleepBrightness': 20, 'screenBrightness': 100, 'defaultBackgroundColor': 'ha-dark', 'sleepTracking': None, 'sleepTrackingZones': ['not_home', 'off'], 'sleepOverride': None, 'locale': 'en_US', 'timeFormat': '%H:%M', 'dateFormatBabel': 'full', 'dateAdditionalTemplate': '', 'timeAdditionalTemplate': '', 'dateFormat': '%A, %d. %B %Y', 'cards': [{'type': 'cardEntities', 'entities': [{'entity': 'iText.', 'name': 'MQTT Config successful', 'icon': 'mdi:check', 'color:': [0, 255, 0]}, {'entity': 'iText.', 'name': 'Continue adding', 'icon': 'mdi:arrow-right-bold'}, {'entity': 'iText.', 'name': 'cards to your', 'icon': 'mdi:card'}, {'entity': 'iText.', 'name': 'apps.yaml', 'icon': 'mdi:cog'}], 'title': 'Setup successful'}], 'screensaver': {'type': 'screensaver', 'entity': 'weather.k3ll3r', 'weatherUnit': 'celsius', 'forecastSkip': 0, 'weatherOverrideForecast1': None, 'weatherOverrideForecast2': None, 'weatherOverrideForecast3': None, 'weatherOverrideForecast4': {'entity': 'sensor.example_item', 'name': 'name', 'icon': 'lightbulb'}, 'doubleTapToUnlock': False, 'alternativeLayout': True, 'defaultCard': None, 'key': 'screensaver'}, 'hiddenCards': []}
2022-10-20 23:00:34.749821 INFO nspanel-1: Sending MQTT Message: pageType~pageStartup
2022-10-20 23:00:34.768713 INFO nspanel-1: Registering callbacks for the following items: ['iText.', 'iText.', 'iText.', 'iText.', 'weather.k3ll3r', 'sensor.example_item']
2022-10-20 23:00:34.785162 INFO nspanel-1: Started
2022-10-20 23:00:34.789965 INFO AppDaemon: App initialization complete
2022-10-20 23:01:01.079925 INFO nspanel-1: Sending MQTT Message: time~23:01~
2022-10-20 23:02:01.091737 INFO nspanel-1: Sending MQTT Message: time~23:02~
Doser86 commented 2 years ago

no uppdate after this. Just waiting for content

Doser86 commented 2 years ago
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/00-banner.sh
-----------------------------------------------------------
 Add-on: AppDaemon
 Python Apps and Dashboard using AppDaemon 4.x for Home Assistant
-----------------------------------------------------------
 Add-on version: 0.9.3
 You are running the latest version of this add-on.
 System: Home Assistant OS 9.2  (aarch64 / raspberrypi4-64)
 Home Assistant Core: 2022.10.3
 Home Assistant Supervisor: 2022.10.0
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
cont-init: info: /etc/cont-init.d/00-banner.sh exited 0
cont-init: info: running /etc/cont-init.d/01-log-level.sh
cont-init: info: /etc/cont-init.d/01-log-level.sh exited 0
cont-init: info: running /etc/cont-init.d/appdaemon.sh
cont-init: info: /etc/cont-init.d/appdaemon.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun appdaemon (no readiness notification)
s6-rc: info: service legacy-services successfully started
[23:05:32] INFO: Starting AppDaemon...
2022-10-20 23:05:41.639905 INFO AppDaemon: AppDaemon Version 4.2.1 starting
2022-10-20 23:05:41.640768 INFO AppDaemon: Python version is 3.10.5
2022-10-20 23:05:41.641341 INFO AppDaemon: Configuration read from: /config/appdaemon/appdaemon.yaml
2022-10-20 23:05:41.641890 INFO AppDaemon: Added log: AppDaemon
2022-10-20 23:05:41.642474 INFO AppDaemon: Added log: Error
2022-10-20 23:05:41.643044 INFO AppDaemon: Added log: Access
2022-10-20 23:05:41.643574 INFO AppDaemon: Added log: Diag
2022-10-20 23:05:42.025378 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2022-10-20 23:05:42.449501 INFO HASS: HASS Plugin Initializing
2022-10-20 23:05:42.450363 INFO HASS: HASS Plugin initialization complete
2022-10-20 23:05:42.452260 INFO AppDaemon: Loading Plugin MQTT using class MqttPlugin from module mqttplugin
2022-10-20 23:05:42.724267 INFO MQTT: MQTT Plugin Initializing
2022-10-20 23:05:42.724997 INFO MQTT: Using 'appdaemon/status' as Will Topic
2022-10-20 23:05:42.725571 INFO MQTT: Using 'appdaemon/status' as Birth Topic
2022-10-20 23:05:42.727284 INFO AppDaemon: Initializing HTTP
2022-10-20 23:05:42.728437 INFO AppDaemon: Using 'ws' for event stream
2022-10-20 23:05:42.738990 INFO AppDaemon: Starting API
2022-10-20 23:05:42.746962 INFO AppDaemon: Starting Admin Interface
2022-10-20 23:05:42.748070 INFO AppDaemon: Starting Dashboards
2022-10-20 23:05:42.788328 INFO HASS: Connected to Home Assistant 2022.10.3
2022-10-20 23:05:42.802439 INFO MQTT: Connected to Broker at URL 192.168.86.39:1883
2022-10-20 23:05:42.822275 INFO AppDaemon: Got initial state from namespace mqtt
2022-10-20 23:05:42.834087 INFO MQTT: MQTT Plugin initialization complete
2022-10-20 23:05:42.850066 INFO AppDaemon: App 'sov1nspanel' added
2022-10-20 23:05:42.853096 INFO AppDaemon: Found 1 total apps
2022-10-20 23:05:42.855195 INFO AppDaemon: Starting Apps with 1 workers and 1 pins
2022-10-20 23:05:42.857785 INFO AppDaemon: Running on port 5050
2022-10-20 23:05:42.969521 INFO HASS: Evaluating startup conditions
2022-10-20 23:05:42.992514 INFO HASS: Startup condition met: hass state=RUNNING
2022-10-20 23:05:42.993679 INFO HASS: All startup conditions met
2022-10-20 23:05:43.097350 INFO AppDaemon: Got initial state from namespace default
2022-10-20 23:05:44.877684 INFO AppDaemon: Scheduler running in realtime
2022-10-20 23:05:44.887976 INFO AppDaemon: Adding /config/appdaemon/apps to module import path
2022-10-20 23:05:44.889257 INFO AppDaemon: Adding /config/appdaemon/apps/nspanel-lovelace-ui to module import path
2022-10-20 23:05:44.890760 INFO AppDaemon: Adding /config/appdaemon/apps/nspanel-lovelace-ui/luibackend to module import path
2022-10-20 23:05:44.891910 INFO AppDaemon: Adding /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/translations to module import path
2022-10-20 23:05:44.893506 INFO AppDaemon: Adding /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/translations/backend to module import path
2022-10-20 23:05:44.895265 INFO AppDaemon: Adding /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/translations/frontend to module import path
2022-10-20 23:05:44.919479 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/hello.py - ignoring
2022-10-20 23:05:44.921725 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py
2022-10-20 23:05:45.392607 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/pages.py - ignoring
2022-10-20 23:05:45.395222 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/mqtt.py - ignoring
2022-10-20 23:05:45.398067 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/apis.py - ignoring
2022-10-20 23:05:45.401357 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/theme.py - ignoring
2022-10-20 23:05:45.404739 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/config.py - ignoring
2022-10-20 23:05:45.407534 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/localization.py - ignoring
2022-10-20 23:05:45.411278 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/icon_mapping.py - ignoring
2022-10-20 23:05:45.414076 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/helper.py - ignoring
2022-10-20 23:05:45.417578 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/controller.py - ignoring
2022-10-20 23:05:45.420371 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/icons.py - ignoring
2022-10-20 23:05:45.424115 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/updater.py - ignoring
2022-10-20 23:05:45.426671 INFO AppDaemon: Initializing app sov1nspanel using class NsPanelLovelaceUIManager from module nspanel-lovelace-ui
2022-10-20 23:05:45.624196 INFO sov1nspanel: Starting
2022-10-20 23:05:45.635907 INFO sov1nspanel: Input config: {'panelRecvTopic': 'tele/tasmota_sov1nspanel/RESULT', 'panelSendTopic': 'cmnd/tasmota_sov1nspanel/CustomSend', 'screensaver': {'entity': 'weather.k3ll3r', 'weatherOverrideForecast4': {'entity': 'sensor.example_item', 'name': 'name', 'icon': 'lightbulb'}, 'alternativeLayout': True}}
2022-10-20 23:05:45.639771 INFO sov1nspanel: Loaded config: {'panelRecvTopic': 'tele/tasmota_sov1nspanel/RESULT', 'panelSendTopic': 'cmnd/tasmota_sov1nspanel/CustomSend', 'updateMode': 'auto-notify', 'model': 'eu', 'sleepTimeout': 20, 'sleepBrightness': 20, 'screenBrightness': 100, 'defaultBackgroundColor': 'ha-dark', 'sleepTracking': None, 'sleepTrackingZones': ['not_home', 'off'], 'sleepOverride': None, 'locale': 'en_US', 'timeFormat': '%H:%M', 'dateFormatBabel': 'full', 'dateAdditionalTemplate': '', 'timeAdditionalTemplate': '', 'dateFormat': '%A, %d. %B %Y', 'cards': [{'type': 'cardEntities', 'entities': [{'entity': 'iText.', 'name': 'MQTT Config successful', 'icon': 'mdi:check', 'color:': [0, 255, 0]}, {'entity': 'iText.', 'name': 'Continue adding', 'icon': 'mdi:arrow-right-bold'}, {'entity': 'iText.', 'name': 'cards to your', 'icon': 'mdi:card'}, {'entity': 'iText.', 'name': 'apps.yaml', 'icon': 'mdi:cog'}], 'title': 'Setup successful'}], 'screensaver': {'type': 'screensaver', 'entity': 'weather.k3ll3r', 'weatherUnit': 'celsius', 'forecastSkip': 0, 'weatherOverrideForecast1': None, 'weatherOverrideForecast2': None, 'weatherOverrideForecast3': None, 'weatherOverrideForecast4': {'entity': 'sensor.example_item', 'name': 'name', 'icon': 'lightbulb'}, 'doubleTapToUnlock': False, 'alternativeLayout': True, 'defaultCard': None, 'key': 'screensaver'}, 'hiddenCards': []}
2022-10-20 23:05:45.651660 INFO sov1nspanel: Sending MQTT Message: pageType~pageStartup
2022-10-20 23:05:45.668272 INFO sov1nspanel: Registering callbacks for the following items: ['iText.', 'iText.', 'iText.', 'iText.', 'weather.k3ll3r', 'sensor.example_item']
2022-10-20 23:05:45.687461 INFO sov1nspanel: Started
2022-10-20 23:05:45.691322 INFO AppDaemon: App initialization complete
2022-10-20 23:06:01.097458 INFO sov1nspanel: Sending MQTT Message: time~23:06~
Doser86 commented 2 years ago

This is my Apps.yaml by the way:


sov1nspanel: module: nspanel-lovelace-ui class: NsPanelLovelaceUIManager config: panelRecvTopic: "tele/tasmota_sov1nspanel/RESULT" panelSendTopic: "cmnd/tasmota_sov1nspanel/CustomSend" screensaver: entity: weather.k3ll3r weatherOverrideForecast4: entity: sensor.example_item name: name icon: lightbulb alternativeLayout: True

joBr99 commented 2 years ago

Can you run FlashNextion http://nspanel.pky.eu/lui.tft in your tasmota terminal, want to make sure that there isn't an issue with the file for the release on the server.

Doser86 commented 2 years ago

Getting command unknown

joBr99 commented 2 years ago

You must have used this command before o.O please add a screenshot.

Doser86 commented 2 years ago

I have, don't know why its not working now

Doser86 commented 2 years ago

https://1drv.ms/u/s!AnevBfzUGi77gtAKsFiU0W3zturYsw?e=iKqUcl

Doser86 commented 2 years ago

What is this? https://1drv.ms/u/s!AnevBfzUGi77gtALmDnsOyy-gOARtQ?e=NBVrXE

joBr99 commented 2 years ago

Delete autoexec.be and .bec, recreate that autoexec.be file and then restart tasmota

Doser86 commented 2 years ago

Can you sen me what it should be innside autoexec.be? Find two different

joBr99 commented 2 years ago

Two different?

https://docs.nspanel.pky.eu/prepare_nspanel/#upload-berry-driver-to-tasmota

This should be the content:

https://raw.githubusercontent.com/joBr99/nspanel-lovelace-ui/main/tasmota/autoexec.be

Doser86 commented 2 years ago

Flashing now

Doser86 commented 2 years ago

We got it! Thankyou so mutch!!!!!

Doser86 commented 2 years ago

Hi again :)

Is there an issue with the flashing file? Strugling to flash 2 panels. This is what I get under flashing:

23:36:05.725 CMD: FlashNextion http://nspanel.pky.eu/lui.tft 23:36:05.737 MQT: stat/tasmota_sov3nspanel/RESULT = {"FlashNextion":"Done"} 23:36:05.765 FLH: host: nspanel.pky.eu, port: 80, get: /lui.tft 23:36:06.900 FLH: Something has gone wrong flashing display firmware [bytes('1AFFFFFF')] 23:36:07.001 FLH: Send (High Speed) flash start

joBr99 commented 2 years ago

1AFFFFFF is Nextion's return code for "Invalid Variable name or attribute"

What is currently on thoose panels?

Doser86 commented 2 years ago

I flashed with the Tasmota32 Sonoff-NSpanel from here: https://tasmota.github.io/install/. Like I did with 3 other panels. My third I had some issues also, but it just worked at some time

Doser86 commented 2 years ago

Sometimes it starts, but just stops writing data

joBr99 commented 2 years ago

might be a bad wifi connection

can you try comment line 158&159 in the berry driver and uncomment 157?

image

Doser86 commented 2 years ago

Sorry, did not quite understand that

joBr99 commented 2 years ago

just replace your berry driver with this one and restart tasmota

# Sonoff NSPanel Tasmota Lovelace UI Berry Driver | code by joBr99
# based on;
# Sonoff NSPanel Tasmota (Nextion with Flashing) driver | code by peepshow-21
# based on;
# Sonoff NSPanel Tasmota driver v0.47 | code by blakadder and s-hadinger

# Example Flash
# FlashNextion http://ip-address-of-your-homeassistant:8123/local/nspanel.tft
# FlashNextion http://nspanel.pky.eu/lui.tft

class Nextion : Driver

    static header = bytes('55BB')

    static flash_block_size = 4096

    var flash_mode
    var flash_start_millis
    var flash_size
    var flash_written
    var flash_buff
    var flash_offset
    var awaiting_offset
    var tcp
    var ser
    var last_per
    var url

    def split_55(b)
      var ret = []
      var s = size(b)   
      var i = s-2   # start from last-1
      while i > 0
        if b[i] == 0x55 && b[i+1] == 0xBB           
          ret.push(b[i..s-1]) # push last msg to list
          b = b[(0..i-1)]   # write the rest back to b
        end
        i -= 1
      end
      ret.push(b)
      return ret
    end

    def crc16(data, poly)
      if !poly  poly = 0xA001 end
      # CRC-16 MODBUS HASHING ALGORITHM
      var crc = 0xFFFF
      for i:0..size(data)-1
        crc = crc ^ data[i]
        for j:0..7
          if crc & 1
            crc = (crc >> 1) ^ poly
          else
            crc = crc >> 1
          end
        end
      end
      return crc
    end

    # encode using custom protocol 55 BB [payload length] [payload length] [payload] [crc] [crc]
    def encode(payload)
      var b = bytes()
      b += self.header
      b.add(size(payload), 2)   # add size as 2 bytes, little endian
      b += bytes().fromstring(payload)
      var msg_crc = self.crc16(b)
      b.add(msg_crc, 2)       # crc 2 bytes, little endian
      return b
    end

    def encodenx(payload)
        var b = bytes().fromstring(payload)
        b += bytes('FFFFFF')
        return b
    end

    def sendnx(payload)
        import string
        var payload_bin = self.encodenx(payload)
        self.ser.write(payload_bin)
        log(string.format("NXP: Nextion command sent = %s",str(payload_bin)), 3)       
    end

    def send(payload)
        var payload_bin = self.encode(payload)
        if self.flash_mode==1
            log("NXP: skipped command becuase still flashing", 3)
        else 
            self.ser.write(payload_bin)
            log("NXP: payload sent = " + str(payload_bin), 3)
        end
    end

    def write_to_nextion(b)
        self.ser.write(b)
    end

    def screeninit()
        log("NXP: Screen Initialized")
        self.sendnx("recmod=1")     
    end

    def write_block()

        import string
        log("FLH: Read block",3)
        while size(self.flash_buff)<self.flash_block_size && self.tcp.connected()
            if self.tcp.available()>0
                self.flash_buff += self.tcp.readbytes()
            else
                tasmota.delay(50)
                log("FLH: Wait for available...",3)
            end
        end
        log("FLH: Buff size "+str(size(self.flash_buff)),3)
        var to_write
        if size(self.flash_buff)>self.flash_block_size
            to_write = self.flash_buff[0..self.flash_block_size-1]
            self.flash_buff = self.flash_buff[self.flash_block_size..]
        else
            to_write = self.flash_buff
            self.flash_buff = bytes()
        end
        log("FLH: Writing "+str(size(to_write)),3)
        var per = (self.flash_written*100)/self.flash_size
        if (self.last_per!=per) 
            self.last_per = per
            tasmota.publish_result(string.format("{\"Flashing\":{\"complete\": %d, \"time_elapsed\": %d}}",per , (tasmota.millis()-self.flash_start_millis)/1000), "RESULT") 
        end
        if size(to_write)>0
            self.flash_written += size(to_write)
            self.ser.write(to_write)
        end
        log("FLH: Total "+str(self.flash_written),3)
        if (self.flash_written==self.flash_size)
            log("FLH: Flashing complete - Time elapsed: %d", (tasmota.millis()-self.flash_start_millis)/1000)
            self.flash_mode = 0
            self.ser = nil
            tasmota.gc()
            self.ser = serial(17, 16, 115200, serial.SERIAL_8N1)
        end

    end

    def every_100ms()
        import string
        if self.ser.available() > 0
            var msg = self.ser.read()
            if size(msg) > 0
                log(string.format("NXP: Received Raw = %s",str(msg)), 3)
                if (self.flash_mode==1)
                    var strv = msg[0..-4].asstring()
                    if string.find(strv,"comok 2")>=0
                        log("FLH: Send (High Speed) flash start")
            self.flash_start_millis = tasmota.millis()
                        self.sendnx(string.format("whmi-wris %d,115200,res0",self.flash_size))
                    elif size(msg)==1 && msg[0]==0x08
                        log("FLH: Waiting offset...",3)
                        self.awaiting_offset = 1
                    elif size(msg)==4 && self.awaiting_offset==1
                        self.awaiting_offset = 0
                        self.flash_offset = msg.get(0,4)
                        log("FLH: Flash offset marker "+str(self.flash_offset),3)
                        if self.flash_offset != 0
                            self.open_url_at(self.url, self.flash_offset)
                            self.flash_written = self.flash_offset
                        end
                        self.write_block()
                    elif size(msg)==1 && msg[0]==0x05
                        self.write_block()
                    else
                        log("FLH: Something has gone wrong flashing display firmware ["+str(msg)+"]",2)
                    end
                else
                    var msg_list = self.split_55(msg)
                    for i:0..size(msg_list)-1
                        msg = msg_list[i]
                        if size(msg) > 0
                            if msg == bytes('000000FFFFFF88FFFFFF')
                                self.screeninit()
                            elif size(msg)>=2 && msg[0]==0x55 && msg[1]==0xBB
                                var jm = string.format("{\"CustomRecv\":\"%s\"}",msg[4..-3].asstring())
                                tasmota.publish_result(jm, "RESULT")        
                            elif msg[0]==0x07 && size(msg)==1 # BELL/Buzzer
                                tasmota.cmd("buzzer 1,1")
                            else
                                var jm = string.format("{\"nextion\":\"%s\"}",str(msg[0..-4]))
                                tasmota.publish_result(jm, "RESULT")        
                            end
                        end       
                    end
                end
            end
        end
    end      

    def begin_nextion_flash()
        self.flash_written = 0
        self.awaiting_offset = 0
        self.flash_offset = 0
        self.sendnx('DRAKJHSUYDGBNCJHGJKSHBDN')
        self.sendnx('recmod=0')
        self.sendnx('recmod=0')
        self.flash_mode = 1
        self.sendnx("connect")        
    end

    def open_url_at(url, pos)
        self.url = url
        import string
        var host
        var port
        var s1 = string.split(url,7)[1]
        var i = string.find(s1,":")
        var sa
        if i<0
            port = 80
            i = string.find(s1,"/")
            sa = string.split(s1,i)
            host = sa[0]
        else
            sa = string.split(s1,i)
            host = sa[0]
            s1 = string.split(sa[1],1)[1]
            i = string.find(s1,"/")
            sa = string.split(s1,i)
            port = int(sa[0])
        end
        var get = sa[1]
        log(string.format("FLH: host: %s, port: %s, get: %s",host,port,get))
        self.tcp = tcpclient()
        self.tcp.connect(host,port)
        log("FLH: Connected:"+str(self.tcp.connected()),3)
        var get_req = "GET "+get+" HTTP/1.0\r\n"
        get_req += string.format("Range: bytes=%d-\r\n", pos)
        get_req += string.format("HOST: %s:%s\r\n\r\n",host,port)
        self.tcp.write(get_req)
        var a = self.tcp.available()
        i = 1
        while a==0 && i<5
          tasmota.delay(100*i)
          tasmota.yield() 
          i += 1
          log("FLH: Retry "+str(i),3)
          a = self.tcp.available()
        end
        if a==0
            log("FLH: Nothing available to read!",3)
            return
        end
        var b = self.tcp.readbytes()
        i = 0
        var end_headers = false;
        var headers
        while i<size(b) && headers==nil
            if b[i..(i+3)]==bytes().fromstring("\r\n\r\n") 
                headers = b[0..(i+3)].asstring()
                self.flash_buff = b[(i+4)..]
            else
                i += 1
            end
        end
        #print(headers)
        # check http respose for code 200/206
        if string.find(headers,"200 OK")>0 || string.find(headers,"206 Partial Content")>0
            log("FLH: HTTP Respose is 200 OK or 206 Partial Content",3)
        else
            log("FLH: HTTP Respose is not 200 OK or 206 Partial Content",3)
            print(headers)
            return -1
        end
        # only set flash size if pos is zero
        if pos == 0
            # check http respose for content-length
            var tag = "Content-Length: "
            i = string.find(headers,tag)
            if (i>0) 
                var i2 = string.find(headers,"\r\n",i)
                var s = headers[i+size(tag)..i2-1]
                self.flash_size=int(s)
            end
            log("FLH: Flash file size: "+str(self.flash_size),3)
        end

    end

    def flash_nextion(url)
        self.flash_size = 0
        var res = self.open_url_at(url, 0)
        if res != -1
            self.begin_nextion_flash()
        end
    end

    def init()
        log("NXP: Initializing Driver")
        self.ser = serial(17, 16, 115200, serial.SERIAL_8N1)
        self.flash_mode = 0
    end

end

var nextion = Nextion()

tasmota.add_driver(nextion)

def get_current_version(cmd, idx, payload, payload_json)
    import string
    var version_of_this_script = 4
    var jm = string.format("{\"nlui_driver_version\":\"%s\"}", version_of_this_script)
    tasmota.publish_result(jm, "RESULT")
end

tasmota.add_cmd('GetDriverVersion', get_current_version)

def update_berry_driver(cmd, idx, payload, payload_json)
    def task()
        import string
        var cl = webclient()
        cl.begin(payload)
        var r = cl.GET()
        if r == 200
            print("Sucessfully downloaded nspanel-lovelace-ui berry driver")
        else
            print("Error while downloading nspanel-lovelace-ui berry driver")
        end
        r = cl.write_file("autoexec.be")
        if r < 0
            print("Error while writeing nspanel-lovelace-ui berry driver")
        else
            print("Sucessfully written nspanel-lovelace-ui berry driver")
            var s = load('autoexec.be')
            if s == true
                var jm = string.format("{\"nlui_driver_update\":\"%s\"}", "succeeded")
                tasmota.publish_result(jm, "RESULT")
            else 
                var jm = string.format("{\"nlui_driver_update\":\"%s\"}", "failed")
                tasmota.publish_result(jm, "RESULT")
            end

        end
    end
    tasmota.set_timer(0,task)
    tasmota.resp_cmnd_done()
end

tasmota.add_cmd('UpdateDriverVersion', update_berry_driver)

def flash_nextion(cmd, idx, payload, payload_json)
    def task()
        nextion.flash_nextion(payload)
    end
    tasmota.set_timer(0,task)
    tasmota.resp_cmnd_done()
end

def send_cmd(cmd, idx, payload, payload_json)
    nextion.sendnx(payload)
    tasmota.resp_cmnd_done()
end

def send_cmd2(cmd, idx, payload, payload_json)
    nextion.send(payload)
    tasmota.resp_cmnd_done()
end

tasmota.add_cmd('Nextion', send_cmd)
tasmota.add_cmd('CustomSend', send_cmd2)
tasmota.add_cmd('FlashNextion', flash_nextion)
Doser86 commented 2 years ago

That worked. Thankyou 😁👍

Doser86 commented 2 years ago

Well, almost. Stops at 99% and saying on screen that "update failed"

Doser86 commented 2 years ago

Sorry, stops at 100% on screen. But only writw 7864320 off 7866204 bytes

joBr99 commented 2 years ago

How far are you away from your access point? Can you try to upload the tft file to the webserver of your home assistant installation and flash it from there?

image

FlashNextion http://192.168.75.30:8123/local/nspanel.tft

Doser86 commented 2 years ago

I am close to my access point. Actually closer with the two I strugle with than the three first. I am in work now, but can try when I get home 👍

Doser86 commented 2 years ago

It is the same. What I really don't understand is that if I flash again, it is in the same place as before I flashed. Even if I choose to delete it before flashing.

joBr99 commented 2 years ago

not exactly sure what you mean by that is it starting from like 90%?

Try to remove the "s" from this line: self.sendnx(string.format("whmi-wris %d,115200,res0",self.flash_size)) so it looks like this: self.sendnx(string.format("whmi-wri %d,115200,res0",self.flash_size))

This is forceing it to the older nextion upload protocol, which always starts from the begining.

Doser86 commented 2 years ago

Thanks alot. Now it finaly worked

Doser86 commented 2 years ago

I have one panel left that refuses to upload the tft file 100%. Using all the stuff you've given me on this one too to get it to start uploading at all. If I try with a US tft it works, but not with an EU tft

Doser86 commented 1 year ago

You have any idea what this can be?

joBr99 commented 1 year ago

Replace the berry driver with the lastest version and retry.

Doser86 commented 1 year ago

Is there a new driver the last week?

Doser86 commented 1 year ago

Having the same nettwork problem I think.

joBr99 commented 1 year ago

Yes, there is a new berry driver, which fixing an issue with the latest tasmota version.

Doser86 commented 1 year ago

Could you help me to uncheck and check correct lines again?

joBr99 commented 1 year ago

what?

Doser86 commented 1 year ago

Sorry. Comment anf un comment the correct lines

joBr99 commented 1 year ago

Just replace the old driver with the new one and retry flashing and tell me what is happening.

Doser86 commented 1 year ago

17:02:31.449 MQT: stat/tasmota_anneksnspanel/RESULT = {"FlashNextion":"Done"} 17:02:31.492 FLH: host: nspanel.pky.eu, port: 80, get: /lovelace-ui/github/nspanel-v3.6.0.tft 17:02:31.994 FLH: Something has gone wrong flashing display firmware [bytes('1AFFFFFF')] 17:02:32.123 FLH: Send (High Speed) flash start

Doser86 commented 1 year ago

Then nothing at all