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

Waiting for content - CRITICAL MQTT: Could not Complete Connection to Broker #8

Closed derartlars closed 2 years ago

derartlars commented 2 years ago

Hey,

I now tried to install multiple times, refreshed tasmota, reinstalled appdeamon but I can't get it to work.

Here is my tasmota MQTT Setting:

Bildschirmfoto 2022-05-29 um 17 49 49

Here is the config of my appdeamon yaml:

---
secrets: /config/secrets.yaml
appdaemon:
  latitude: 52.379189
  longitude: 4.899431
  elevation: 2
  time_zone: Europe/Amsterdam
  plugins:
    HASS:
      type: hass
    MQTT:
      type: mqtt
      namespace: mqtt
      client_id: "appdaemon"
      client_host: 192.168.178.777
      client_port: 1883
      client_user: "mqttuser"
      client_password: "******"
      client_topics: NONE
http:
  url: http://127.0.0.1:5050
admin:
api:
hadashboard:

And the config of the apps.yaml

nspanel-1:
  module: nspanel-lovelance-ui
  class: NsPanelLovelanceUIManager
  config:
    panelRecvTopic: "tele/nspanel-1/RESULT"
    panelSendTopic: "cmnd/nspanel-1/CustomSend"
    timeoutScreensaver: 20 #in seconds, values between 5 and 60 are allowed
    #brightnessScreensaver: 10
    brightnessScreensaver:
      - time: "7:00:00"
        value: 1
      - time: "23:00:00"
        value: 0
    locale: "de_DE"
    timeFormat: "%H:%M"
    dateFormat: "%A, %d. %B %Y"
    weatherEntity: weather.k3ll3r
    pages:
      - type: cardEntities
        heading: Test 1
        items:
          - delete
          - delete
          - delete
          - delete
      - type: cardEntities
        heading: Test 2
        items:
          - delete
          - delete
          - delete
          - delete

And this is what I get when I look into the log of the appdeamon in home assistant:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 

 Add-on: AppDaemon
 Python Apps and Dashboard using AppDaemon 4.x for Home Assistant
 Add-on version: 0.8.2
 You are running the latest version of this add-on.
 System: Home Assistant OS 8.1  (aarch64 / raspberrypi3-64)
 Home Assistant Core: 2022.5.5
 Home Assistant Supervisor: 2022.05.3
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] appdaemon.sh: executing... 
Looking in links: https://wheels.home-assistant.io/alpine-3.14/aarch64/
Collecting babel
  Downloading https://wheels.home-assistant.io/alpine-3.14/aarch64/Babel-2.10.1-py3-none-any.whl (9.5 MB)
Requirement already satisfied: pytz>=2015.7 in /usr/lib/python3.9/site-packages (from babel) (2021.3)
Installing collected packages: babel
Successfully installed babel-2.10.1
[cont-init.d] appdaemon.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[17:49:32] INFO: Starting AppDaemon...
2022-05-29 17:49:39.924173 INFO AppDaemon: AppDaemon Version 4.2.1 starting
2022-05-29 17:49:39.925829 INFO AppDaemon: Python version is 3.9.7
2022-05-29 17:49:39.927553 INFO AppDaemon: Configuration read from: /config/appdaemon/appdaemon.yaml
2022-05-29 17:49:39.929574 INFO AppDaemon: Added log: AppDaemon
2022-05-29 17:49:39.931128 INFO AppDaemon: Added log: Error
2022-05-29 17:49:39.932491 INFO AppDaemon: Added log: Access
2022-05-29 17:49:39.933856 INFO AppDaemon: Added log: Diag
2022-05-29 17:49:40.147432 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
2022-05-29 17:49:40.438068 INFO HASS: HASS Plugin Initializing
2022-05-29 17:49:40.439404 INFO HASS: HASS Plugin initialization complete
2022-05-29 17:49:40.441135 INFO AppDaemon: Loading Plugin MQTT using class MqttPlugin from module mqttplugin
2022-05-29 17:49:40.523934 INFO MQTT: MQTT Plugin Initializing
2022-05-29 17:49:40.525132 INFO MQTT: Using 'appdaemon/status' as Will Topic
2022-05-29 17:49:40.526348 INFO MQTT: Using 'appdaemon/status' as Birth Topic
2022-05-29 17:49:40.529468 INFO AppDaemon: Initializing HTTP
2022-05-29 17:49:40.531413 INFO AppDaemon: Using 'ws' for event stream
2022-05-29 17:49:40.560475 INFO AppDaemon: Starting API
2022-05-29 17:49:40.576225 INFO AppDaemon: Starting Admin Interface
2022-05-29 17:49:40.578149 INFO AppDaemon: Starting Dashboards
2022-05-29 17:49:40.729302 INFO HASS: Connected to Home Assistant 2022.5.5
2022-05-29 17:49:40.906035 INFO AppDaemon: App 'hello_world' added
2022-05-29 17:49:40.914816 INFO AppDaemon: App 'nspanel-1' added
2022-05-29 17:49:40.919475 INFO AppDaemon: Found 2 total apps
2022-05-29 17:49:40.922149 INFO AppDaemon: Starting Apps with 2 workers and 2 pins
2022-05-29 17:49:40.927813 INFO AppDaemon: Running on port 5050
2022-05-29 17:49:41.210854 INFO HASS: Evaluating startup conditions
2022-05-29 17:49:41.254260 INFO HASS: Startup condition met: hass state=RUNNING
2022-05-29 17:49:41.256138 INFO HASS: All startup conditions met
2022-05-29 17:49:41.357987 INFO AppDaemon: Got initial state from namespace default
2022-05-29 17:49:45.756452 CRITICAL MQTT: Could not Complete Connection to Broker, please Ensure Broker at URL 192.168.178.777:1883 is correct and broker is not down and restart Appdaemon
2022-05-29 17:49:45.968348 CRITICAL MQTT: Could not complete MQTT Plugin initialization, trying again in 5 seconds
2022-05-29 17:49:55.983135 CRITICAL MQTT: Could not Complete Connection to Broker, please Ensure Broker at URL 192.168.178.777:1883 is correct and broker is not down and restart Appdaemon
2022-05-29 17:49:55.990468 CRITICAL MQTT: Could not complete MQTT Plugin initialization, trying again in 5 seconds

And finally the log of the tasmota console:

16:49:57.282 MQT: Attempting connection...
16:49:57.293 MQT: Connect failed to 192.168.178.777:1883, rc -2. Retry in 70 sec
16:50:00.526 RSL: RESULT = {"CustomRecv":"event,startup,36,eu"}
16:50:06.526 RSL: RESULT = {"CustomRecv":"event,startup,36,eu"}
16:50:12.425 RSL: RESULT = {"CustomRecv":"event,startup,36,eu"}
16:50:18.424 RSL: RESULT = {"CustomRecv":"event,startup,36,eu"}
16:50:24.326 RSL: RESULT = {"CustomRecv":"event,startup,36,eu"}
16:50:30.326 RSL: RESULT = {"CustomRecv":"event,startup,36,eu"}
16:50:36.250 RSL: RESULT = {"CustomRecv":"event,startup,36,eu"}
16:50:42.240 RSL: RESULT = {"CustomRecv":"event,startup,36,eu"}
16:50:48.125 RSL: RESULT = {"CustomRecv":"event,startup,36,eu"}
16:50:54.128 RSL: RESULT = {"CustomRecv":"event,startup,36,eu"}
16:51:00.125 RSL: RESULT = {"CustomRecv":"event,startup,36,eu"}
16:51:06.027 RSL: RESULT = {"CustomRecv":"event,startup,36,eu"}
16:51:08.282 MQT: Attempting connection...
16:51:08.295 MQT: Connect failed to 192.168.178.777:1883, rc -2. Retry in 80 sec
16:51:12.026 RSL: RESULT = {"CustomRecv":"event,startup,36,eu"}
16:51:17.926 RSL: RESULT = {"CustomRecv":"event,startup,36,eu"}
16:51:19.694 RSL: STATE = {"Time":"2022-05-29T16:51:19","Uptime":"0T00:05:04","UptimeSec":304,"Heap":161,"SleepMode":"Dynamic","Sleep":0,"LoadAvg":999,"MqttCount":0,"Berry":{"HeapUsed":13,"Objects":214},"POWER1":"OFF","POWER2":"OFF","Wifi":{"AP":1,"SSId":"BUMedia","BSSId":"1C:ED:6F:07:E2:20","Channel":1,"Mode":"11n","RSSI":76,"Signal":-62,"LinkCount":1,"Downtime":"0T00:00:04"}}
16:51:19.744 RSL: SENSOR = {"Time":"2022-05-29T16:51:19","ANALOG":{"Temperature1":29.4},"ESP32":{"Temperature":53.9},"TempUnit":"C"}
16:51:23.926 RSL: RESULT = {"CustomRecv":"event,startup,36,eu"}
illuzn commented 2 years ago
2022-05-29 17:49:45.756452 CRITICAL MQTT: Could not Complete Connection to Broker, please Ensure Broker at URL 192.168.178.777:1883 is correct and broker is not down and restart Appdaemon
2022-05-29 17:49:45.968348 CRITICAL MQTT: Could not complete MQTT Plugin initialization, trying again in 5 seconds
2022-05-29 17:49:55.983135 CRITICAL MQTT: Could not Complete Connection to Broker, please Ensure Broker at URL 192.168.178.777:1883 is correct and broker is not down and restart Appdaemon
2022-05-29 17:49:55.990468 CRITICAL MQTT: Could not complete MQTT Plugin initialization, trying again in 5 seconds

These are obviously the critical lines.

Are you using HA's mqtt broker (i.e. the mosquitto addon)? Check the logs of that addon for more information. A simple mistake to make is not configuring the same username and password in that addon.

joBr99 commented 2 years ago

yes, in general double check this part of the appdaemon.yaml and check the log of your mqtt broker

    MQTT:
      type: mqtt
      namespace: mqtt
      client_id: "appdaemon"
      client_host: 192.168.178.777
      client_port: 1883
      client_user: "mqttuser"
      client_password: "******"
      client_topics: NONE

but in your case, your client_host is an invalid ip address (192.168.178.777), the numbers of the octets of an ipv4 address are in the range between 0-255

so 777 cannot be right, check this in appdaemon.yaml and on tasmota

derartlars commented 2 years ago

So after some fixing of Ip and Mqtt mosquito I still get no content displayed but at least I see the following in the logs:

Mosquitto:

1653846089: New client connected from 192.168.178.80:56538 as nspanel-1 (p2, c1, k30, u'Lars').

Appdeamon:

`2022-05-29 19:46:42.594256 INFO MQTT: Connected to Broker at URL 192.168.178.134:1883
2022-05-29 19:46:42.741037 INFO AppDaemon: Got initial state from namespace mqtt
2022-05-29 19:46:42.743589 INFO MQTT: MQTT Plugin initialization complete
2022-05-29 19:46:44.743698 INFO AppDaemon: Scheduler running in realtime
2022-05-29 19:46:44.791360 INFO AppDaemon: Adding /config/appdaemon/apps to module import path
2022-05-29 19:46:44.794428 INFO AppDaemon: Adding /config/appdaemon/apps/nspanel-lovelace-ui to module import path
2022-05-29 19:46:44.797018 INFO AppDaemon: Adding /config/appdaemon/apps/nspanel-lovelace-ui/luibackend to module import path
2022-05-29 19:46:44.880181 INFO AppDaemon: Loading App Module: /config/appdaemon/apps/hello.py
2022-05-29 19:46:45.028499 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/nspanel-lovelace-ui.py - ignoring
2022-05-29 19:46:45.034388 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/helper.py - ignoring
2022-05-29 19:46:45.039830 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/mqttListener.py - ignoring
2022-05-29 19:46:45.044450 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/icon_mapping.py - ignoring
2022-05-29 19:46:45.049937 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/theme.py - ignoring
2022-05-29 19:46:45.055056 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/controller.py - ignoring
2022-05-29 19:46:45.061518 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/localization.py - ignoring
2022-05-29 19:46:45.067242 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/config.py - ignoring
2022-05-29 19:46:45.072894 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/pages.py - ignoring
2022-05-29 19:46:45.078608 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/updater.py - ignoring
2022-05-29 19:46:45.084112 WARNING AppDaemon: No app description found for: /config/appdaemon/apps/nspanel-lovelace-ui/luibackend/icons.py - ignoring
2022-05-29 19:46:45.088473 INFO AppDaemon: Initializing app hello_world using class HelloWorld from module hello
2022-05-29 19:46:47.001571 INFO hello_world: Hello from AppDaemon
2022-05-29 19:46:47.009368 INFO hello_world: You are now ready to run Apps!
2022-05-29 19:46:47.111474 INFO AppDaemon: App initialization complete
2022-05-29 19:48:13.556134 WARNING AppDaemon: Excessive time spent in utility loop: 2568.0ms, 2566.0ms in check_app_updates(), 2.0ms in other
2022-05-29 19:48:19.078311 WARNING AppDaemon: Excessive time spent in utility loop: 2115.0ms, 2114.0ms in check_app_updates(), 1.0ms in other
2022-05-29 19:48:49.368059 WARNING AppDaemon: Excessive time spent in utility loop: 4779.0ms, 4778.0ms in check_app_updates(), 1.0ms in other`

And then

18:48:27.067 MQT: Connected
18:48:27.078 MQT: tele/nspanel-1/LWT = Online (retained)
18:48:27.085 MQT: cmnd/nspanel-1/POWER = 
18:48:27.097 MQT: tele/nspanel-1/INFO1 = {"Info1":{"Module":"NSPanel","Version":"11.1.0.3(tasmota)","FallbackTopic":"cmnd/nspanel-1_fb/","GroupTopic":"cmnd/tasmotas/"}}
18:48:27.117 MQT: tele/nspanel-1/INFO2 = {"Info2":{"WebServerMode":"Admin","Hostname":"nspanel-1-2376","IPAddress":"192.168.178.80"}}
18:48:27.135 MQT: tele/nspanel-1/INFO3 = {"Info3":{"RestartReason":"Vbat power on reset","BootCount":12}}
18:48:27.145 MQT: stat/nspanel-1/RESULT = {"POWER1":"OFF"}
18:48:27.149 MQT: stat/nspanel-1/POWER1 = OFF
18:48:27.153 MQT: stat/nspanel-1/RESULT = {"POWER2":"OFF"}
18:48:27.160 MQT: stat/nspanel-1/POWER2 = OFF
18:48:28.145 MQT: stat/nspanel-1/STATUS1 = {"StatusPRM":{"Baudrate":115200,"SerialConfig":"8N1","GroupTopic":"tasmotas","OtaUrl":"https://github.com/tasmota/install/raw/main/firmware/unofficial/tasmota32-fullrules.bin","RestartReason":"Vbat power on reset","Uptime":"0T00:00:23","StartupUTC":"2022-05-29T17:48:05","Sleep":0,"CfgHolder":4617,"BootCount":11,"BCResetTime":"2022-05-29T16:39:56","SaveCount":25}}
18:48:28.197 MQT: tele/nspanel-1/RESULT = {"CustomRecv":"event,startup,36,eu"}
18:48:28.245 MQT: stat/nspanel-1/STATUS11 = {"StatusSTS":{"Time":"2022-05-29T18:48:28","Uptime":"0T00:00:23","UptimeSec":23,"Heap":160,"SleepMode":"Dynamic","Sleep":0,"LoadAvg":1007,"MqttCount":1,"Berry":{"HeapUsed":14,"Objects":219},"POWER1":"OFF","POWER2":"OFF","Wifi":{"AP":1,"SSId":"BUMedia","BSSId":"1C:ED:6F:07:E2:20","Channel":1,"Mode":"11n","RSSI":68,"Signal":-66,"LinkCount":1,"Downtime":"0T00:00:04"}}}
18:48:28.314 MQT: stat/nspanel-1/RESULT = {"Time":"2022-05-29T18:48:28","Uptime":"0T00:00:23","UptimeSec":23,"Heap":160,"SleepMode":"Dynamic","Sleep":0,"LoadAvg":1013,"MqttCount":1,"Berry":{"HeapUsed":14,"Objects":219},"POWER1":"OFF","POWER2":"OFF","Wifi":{"AP":1,"SSId":"BUMedia","BSSId":"1C:ED:6F:07:E2:20","Channel":1,"Mode":"11n","RSSI":68,"Signal":-66,"LinkCount":1,"Downtime":"0T00:00:04"}}
18:48:28.379 MQT: stat/nspanel-1/STATUS10 = {"StatusSNS":{"Time":"2022-05-29T18:48:28","ANALOG":{"Temperature1":28.0},"ESP32":{"Temperature":53.3},"TempUnit":"C"}}
18:48:31.198 MQT: tele/nspanel-1/STATE = {"Time":"2022-05-29T18:48:31","Uptime":"0T00:00:26","UptimeSec":26,"Heap":160,"SleepMode":"Dynamic","Sleep":0,"LoadAvg":999,"MqttCount":1,"Berry":{"HeapUsed":14,"Objects":219},"POWER1":"OFF","POWER2":"OFF","Wifi":{"AP":1,"SSId":"BUMedia","BSSId":"1C:ED:6F:07:E2:20","Channel":1,"Mode":"11n","RSSI":68,"Signal":-66,"LinkCount":1,"Downtime":"0T00:00:04"}}
18:48:31.248 MQT: tele/nspanel-1/SENSOR = {"Time":"2022-05-29T18:48:31","ANALOG":{"Temperature1":27.9},"ESP32":{"Temperature":53.3},"TempUnit":"C"}
18:48:34.085 MQT: tele/nspanel-1/RESULT = {"CustomRecv":"event,startup,36,eu"}
18:48:40.085 MQT: tele/nspanel-1/RESULT = {"CustomRecv":"event,startup,36,eu"}

So now only have to find out why it is not loading the frontend

joBr99 commented 2 years ago

Tasmota looks good now and mqtt of appdamen too, however there is something wrong with your apps.yaml, in which folder do you have that file located? It looks like it's only loading the example hello world app

derartlars commented 2 years ago

Yaml is here: /config/appdaemon/apps/apps.yaml

And the following is in the apps.yaml

---
hello_world:
  module: hello
  class: HelloWorld

nspanel-1:
  module: nspanel-lovelance-ui
  class: NsPanelLovelanceUIManager
  config:
    panelRecvTopic: "tele/nspanel-1/RESULT"
    panelSendTopic: "cmnd/nspanel-1/CustomSend"
    timeoutScreensaver: 20 #in seconds, values between 5 and 60 are allowed
    #brightnessScreensaver: 10
    brightnessScreensaver:
      - time: "7:00:00"
        value: 1
      - time: "23:00:00"
        value: 0
    locale: "de_DE"
    timeFormat: "%H:%M"
    dateFormat: "%A, %d. %B %Y"
    weatherEntity: weather.k3ll3r
    pages:
      - type: cardEntities
        heading: Test 1
        items:
          - delete
          - delete
          - delete
          - delete
      - type: cardEntities
        heading: Test 2
        items:
          - delete
          - delete
          - delete
          - delete
derartlars commented 2 years ago

fixed it. I copied a code from here that you provided as a sample in another thread and there was a typo. this was the same error in another thread and now everything works fine thank you

module: nspanel-lovelance-ui class: NsPanelLovelanceUIManager

with:

module: nspanel-lovelace-ui class: NsPanelLovelaceUIManager

joBr99 commented 2 years ago

Yes, that's was correct a long time ago and the config format also changed slightly :)

You can use the content of the example config in the readme or in this file

https://raw.githubusercontent.com/joBr99/nspanel-lovelace-ui/main/appdaemon/apps-simple.yaml