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
856 stars 187 forks source link

[BUG] - Latest HA Addon Release 'mqtt_port' error #1165

Open leacho73 opened 4 months ago

leacho73 commented 4 months ago

PROBLEM DESCRIPTION

Since upgrading the Lovelace UI Addon In Home Assistant, I now get an error in the log regarding mqtt_port mqtt_port = int(settings["mqtt_port"])

REQUESTED INFORMATION

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

- [ ] Go to Settings>Add-ons>AppDaemon>Log (or the output of your TS script) and then, provide the output of the log during your issue/bug occurs:

s6-rc: info: service base-addon-banner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service base-addon-log-level: starting s6-rc: info: service fix-attrs successfully started s6-rc: info: service base-addon-log-level successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service mqtt-manager: starting s6-rc: info: service mqtt-manager successfully started s6-rc: info: service legacy-services: starting s6-rc: info: service legacy-services successfully started [16:12:38] ERROR: Got unexpected response from the API: Service not enabled /config/panels.yaml exists. INFO:root:Watching for changes in config file Traceback (most recent call last): File "/usr/bin/mqtt-manager/main.py", line 189, in <module> connect() File "/usr/bin/mqtt-manager/main.py", line 63, in connect MqttManager(settings, panel_out_queue, panel_in_queues) File "/usr/bin/mqtt-manager/mqtt.py", line 24, in __init__ mqtt_port = int(settings["mqtt_port"]) ^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''



### TO REPRODUCE
Just upgraded the addon to 4.7.77 

### EXPECTED BEHAVIOUR
Work as previously

### SCREENSHOTS
_If applicable, add screenshots/pictures to help explain your problem._

### ADDITIONAL CONTEXT
_Add any other context about the problem here._
_Please note here in case you are using ioBroker_

### PANEL / FIRMWARE VERION
_Please add the Panel/Firmware Version you are using (EU, US-L or US-P)_
joBr99 commented 4 months ago

it's working on my homeassistant installation so idk

@stleusc can you check on your homeassisant

stleusc commented 4 months ago

Don't see an issue here....


From: Johannes @.> Sent: Wednesday, February 7, 2024 12:52:54 PM To: joBr99/nspanel-lovelace-ui @.> Cc: Stephan Leuschner @.>; Mention @.> Subject: Re: [joBr99/nspanel-lovelace-ui] [BUG] - Latest HA Addon Release 'mqtt_port' error (Issue #1165)

it's working on my homeassistant installation so idk

@stleuschttps://github.com/stleusc can you check on your homeassisant

— Reply to this email directly, view it on GitHubhttps://github.com/joBr99/nspanel-lovelace-ui/issues/1165#issuecomment-1932577767, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAIUMSXO7WBCHASP6VHUJ6TYSO5PNAVCNFSM6AAAAABC6GW4VKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZSGU3TONZWG4. You are receiving this because you were mentioned.Message ID: @.***>

joBr99 commented 4 months ago

@stleusc are you using the esphome api? this way it might not reach the path where it is connecting to mqtt, can you try without use_ha_api configured? shound't need a real panel to trigger this

leacho73 commented 4 months ago

Have reverted back to 4.7.74 and now seeing the following in the log if it helps:

s6-rc: info: service base-addon-banner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service base-addon-log-level: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service base-addon-log-level successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service mqtt-manager: starting
s6-rc: info: service mqtt-manager successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
[10:13:07] ERROR: Got unexpected response from the API: Service not enabled
/config/panels.yaml exists.
Traceback (most recent call last):
  File "/usr/bin/mqtt-manager/main.py", line 8, in <module>
    from panel import LovelaceUIPanel
  File "/usr/bin/mqtt-manager/panel.py", line 11, in <module>
    import ha_control
  File "/usr/bin/mqtt-manager/ha_control.py", line 32
    print "dimmode invalid"
    ^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
[10:13:09] INFO: Service NsPanel Lovelace UI MQTT Manager exited with code 1 (by signal 0)
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service mqtt-manager: stopping
s6-rc: info: service mqtt-manager successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service base-addon-log-level: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service base-addon-log-level successfully stopped
s6-rc: info: service base-addon-banner: stopping
s6-rc: info: service base-addon-banner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
joBr99 commented 4 months ago

No, this is also an image build in the last few days. Try updating again to the newest version or downgrade to 4.7.73

leacho73 commented 4 months ago

Hi @joBr99 - I uninstalled 4.7.74 and reinstalled from scratch v 4.7.78 and all seems to be working now!

kamsvag commented 4 months ago

I'm running the Addon 4.7.78

Since this morning when I updated HomeAssistant Core to 2024.2.1 and NSPanel Lovelace UI Addon to 4.7.78 my NSPanel stoped getting updates. The relay buttons work and I get MQTT updates from them as well.

I'm submitting my logg from the Addon below.

` s6-rc: info: service s6rc-oneshot-runner: starting s6-rc: info: service s6rc-oneshot-runner successfully started s6-rc: info: service base-addon-banner: starting


Add-on: NSPanel Lovelace UI Addon NSPanel Lovelace UI Addon

Add-on version: 4.7.78 You are running the latest version of this add-on. System: Home Assistant OS 11.5 (amd64 / generic-x86-64) Home Assistant Core: 2024.2.1 Home Assistant Supervisor: 2024.01.1

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

s6-rc: info: service base-addon-banner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service base-addon-log-level: starting s6-rc: info: service fix-attrs successfully started s6-rc: info: service base-addon-log-level successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service mqtt-manager: starting s6-rc: info: service mqtt-manager successfully started s6-rc: info: service legacy-services: starting s6-rc: info: service legacy-services successfully started [16:10:20] ERROR: Got unexpected response from the API: Service not enabled /config/panels.yaml exists. INFO:root:Watching for changes in config file Traceback (most recent call last): File "/usr/bin/mqtt-manager/main.py", line 189, in connect() File "/usr/bin/mqtt-manager/main.py", line 63, in connect MqttManager(settings, panel_out_queue, panel_in_queues) File "/usr/bin/mqtt-manager/mqtt.py", line 24, in init mqtt_port = int(settings["mqtt_port"]) ^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: '' `

joBr99 commented 4 months ago

try uninstalling the addon and reinstalling it afterwards

leacho73 commented 4 months ago

@kamsvag - same issue I had - take a copy of your panels.yml and uninstall and reinstall the add on - appeared to fix it for me.

kamsvag commented 4 months ago

@leacho73 - nope .. it does not play nicely now. I still get the same errors. :/

kamsvag commented 4 months ago

Ok, so I've un-installed and installed the addOn. I've reverted my panels.yaml to the sample from the documentation.

My panel is stuck in trying to get config and the loggs indicate that services shuts down right after I try and start it up.


`NSPanel Lovelace UI Addon s6-rc: info: service s6rc-oneshot-runner: starting s6-rc: info: service s6rc-oneshot-runner successfully started s6-rc: info: service base-addon-banner: starting


[20:46:26] ERROR: Unable to access the API, forbidden Add-on:


Add-on version: You are running the latest version of this add-on. [20:46:27] ERROR: Unable to access the API, forbidden System: ( / ) Home Assistant Core: Home Assistant Supervisor:

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

s6-rc: info: service base-addon-banner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service base-addon-log-level: starting s6-rc: info: service fix-attrs successfully started [20:46:27] ERROR: Unable to access the API, forbidden s6-rc: info: service base-addon-log-level successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service mqtt-manager: starting s6-rc: info: service mqtt-manager successfully started s6-rc: info: service legacy-services: starting s6-rc: info: service legacy-services successfully started [20:46:27] ERROR: Unable to access the API, forbidden /config/panels.yaml exists. INFO:root:Watching for changes in config file Traceback (most recent call last): File "/usr/bin/mqtt-manager/main.py", line 189, in connect() File "/usr/bin/mqtt-manager/main.py", line 63, in connect MqttManager(settings, panel_out_queue, panel_in_queues) File "/usr/bin/mqtt-manager/mqtt.py", line 24, in init mqtt_port = int(settings["mqtt_port"]) ^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: '' Exception in thread Thread-1 (config_watch): Traceback (most recent call last): File "/usr/local/lib/python3.12/threading.py", line 1052, in _bootstrap_inner self.run() File "/usr/local/lib/python3.12/threading.py", line 989, in run self._target(*self._args, **self._kwargs) File "/usr/bin/mqtt-manager/main.py", line 176, in config_watch observer.start() File "/usr/local/lib/python3.12/site-packages/watchdog/observers/api.py", line 259, in start emitter.start() File "/usr/local/lib/python3.12/site-packages/watchdog/utils/init.py", line 92, in start self.on_thread_start() File "/usr/local/lib/python3.12/site-packages/watchdog/observers/inotify.py", line 117, in on_thread_start self._inotify = InotifyBuffer(path, self.watch.is_recursive) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/watchdog/observers/inotify_buffer.py", line 34, in init self.start() File "/usr/local/lib/python3.12/site-packages/watchdog/utils/init.py", line 93, in start threading.Thread.start(self) File "/usr/local/lib/python3.12/threading.py", line 971, in start _start_new_thread(self._bootstrap, ()) RuntimeError: can't create new thread at interpreter shutdown [20:46:29] INFO: Service NsPanel Lovelace UI MQTT Manager exited with code 1 (by signal 0) s6-rc: info: service legacy-services: stopping s6-rc: info: service legacy-services successfully stopped s6-rc: info: service mqtt-manager: stopping s6-rc: info: service mqtt-manager successfully stopped s6-rc: info: service legacy-cont-init: stopping s6-rc: info: service legacy-cont-init successfully stopped s6-rc: info: service fix-attrs: stopping s6-rc: info: service base-addon-log-level: stopping s6-rc: info: service fix-attrs successfully stopped s6-rc: info: service base-addon-log-level successfully stopped s6-rc: info: service base-addon-banner: stopping s6-rc: info: service base-addon-banner successfully stopped s6-rc: info: service s6rc-oneshot-runner: stopping s6-rc: info: service s6rc-oneshot-runner successfully stopped`

joBr99 commented 4 months ago

The mqtt credentials are not passed though to the application - no clue why and I also cannot do anything to debug this as I don't have the issue. (never tested this in the addon, but this is how you run the app outside of the addon)

You could configure your mqtt credentials manually in panels.yaml at the top level.

mqtt_server: "192.168.75.28"
mqtt_port: 1883
mqtt_username: "mqttuser"
mqtt_password: "password"
kamsvag commented 4 months ago

@joBr99 .. Thanks, I'll give it a go. I stayed up last night and configured via NodeRed, wich also works but it's more of a struggle.