music-assistant / hass-music-assistant

Turn your Home Assistant instance into a jukebox, hassle free streaming of your favorite media to Home Assistant media players.
Apache License 2.0
1.32k stars 48 forks source link

Config flow could not be loaded: undefined #97

Closed antonyslater closed 2 years ago

antonyslater commented 2 years ago

Having installed the Music Assistant I get no errors on installation and it finds numerous devices and entities... However, I am unable to adjust the configuration without removing and reinstalling as I get the following error message:

Error Config flow could not be loaded: undefined

Any help would be gratefully received.

marcelveldt commented 2 years ago

Hmmm, do you spot the full error in your log perhaps ?

antonyslater commented 2 years ago

Not that I can see unfortunately... The full log mentions MASS but nothing beyond the fact that it is untested by HomeAssistant, which seems more like a warning than an issue.

antonyslater commented 2 years ago

OK, I've restarted HomeAssistant and I now get an error, might be linked...

Logger: homeassistant.components.websocket_api.http.connection Source: components/websocket_api/connection.py:96 Integration: Home Assistant WebSocket API (documentation, issues) First occurred: 13:04:21 (14 occurrences) Last logged: 13:04:21

[140602177126560] Received invalid command: mass/subscribe

14 individual entries the same as this... 2022-05-09 12:04:21 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140602177126560] Received invalid command: mass/subscribe

marcelveldt commented 2 years ago

Nope, thats a so called "race condition". The frontend of MA tries to connect to the backend just before its loaded. Happens when you restart HA with the MA panel open

marcelveldt commented 2 years ago

I have just published version 1.0.12 to HACS can you have a look if that resolves your issue ?

antonyslater commented 2 years ago

Updated to the latest version and restarted HA - no change Removed and reinstalled Music Assistant, restarted HA - no change

Sorry! :-(

marcelveldt commented 2 years ago

Strange, what do you see when you open the full log file in HA ? In the settings menu where you can view the log, there's a button below to view the full file.

antonyslater commented 2 years ago

These are the only entries I get this time referencing MASS I'm afraid... Down from 14 instances of the ERROR now only 2 but you already advised what they were.

2022-05-09 12:15:41 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration mass which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2022-05-09 12:16:05 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140146199946384] Received invalid command: mass/subscribe 2022-05-09 12:16:05 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140146199946384] Received invalid command: mass/subscribe

antonyslater commented 2 years ago

Interestingly however my favourite in InTune DOES now appear in the browser.

That said I may have another issue as it fails to play on any Alexa device saying "Sorry TTS can only be called with the notify.alexa_media service please see the alexa_media wiki for details."

marcelveldt commented 2 years ago

Yeah, playback is a different story... I'm working on that right now. Track progress here: https://github.com/music-assistant/hass-music-assistant/issues/72

In short I need to implement a workaround for each mediaplayer platform. So far working:

antonyslater commented 2 years ago

No probs, will leave both issues with you for a time, but I must say kudos to you for the prompt replies, very much appreciated! :-)

EDIT - Sorry meant to say if I can help with logs or other testing please feel free to ask, happy to help where I can! :-)

antonyslater commented 2 years ago

UPDATE: Despite not being able to load the configuration, I HAVE managed to get Music Assistant to play an InTune Radio favourite station via a Google ChromeCast, the interface is smooth and easy to navigate. Just looking at the folder path needed to get either my SMB direct or HomeAssistant mounted folders to show in the assistant. Will report back when I get that setup right.

Is there a config file I could edit directly rather than having to remove and reinstall every time I test a new path?

marcelveldt commented 2 years ago

Well, you shouldn't have to remove and reinstall to make configuration changes in the first place ;-) That said, you can edit the file "/config/.storage/config_entries" --> look for the music assistant config entry

Be aware that you treat that file with care or you loose access to your HA instance

antonyslater commented 2 years ago

Touché, that wasn't a "dig" though... just wanting to keep trying stuff with it, really excited to see this fully working!

marcelveldt commented 2 years ago

Just tried to reproduce your issue on my dev machine and I couldn't. Can you describe step-by-step what you do to introduce this error ?

antonyslater commented 2 years ago

Today is the first time I've tried to use Music Assistant, so I've not had any previous versions installed prior to today...

Background I run Home Assistant in Docker on a Synology NAS with 6gb RAM, HACS installed for community repositories. I am running version 2022.3.5 presently.

Procedure to arrive here 1) Downloaded the Music Assistant repository from HACS 2) Restarted HA 3) Installed Music Assistant through Configuration->Integrations->Add Integration 4) Ticked use InTune and added InTune userID 5) Tried adding home server too first time, obviously wrong path so failed to add 6) Tried again with ONLY InTune and it worked showing me the entities it had found etc All the while the Configuration button has not worked.

marcelveldt commented 2 years ago

I think I know what is going on... The local files music provider currently only supports a local path (e.g. /music) Maybe the configure only breaks if you enter some invalid path ?

antonyslater commented 2 years ago

Possible, however since it wouldn't work I stopped trying to get the local files bit to work until I knew I could get the InTune bit working, which it is now...

antonyslater commented 2 years ago

Just had another thought, I've never really understood where the files SHOULD go when I download from HACS... The ones I downloaded went into "\custom_components" however I note that some go into "www\community" not sure why they would be different? Could that have anything to do with it? As there is also no entry in my dashboard "references" list??

marcelveldt commented 2 years ago

You don't have to download any files manually, Just use HACS and that will do that for you.

antonyslater commented 2 years ago

I think I know what is going on... The local files music provider currently only supports a local path (e.g. /music) Maybe the configure only breaks if you enter some invalid path ?

Here is my current config: { "entry_id": "768a62948a4e650f132edbba70eab728", "version": 1, "domain": "mass", "title": "Music Assistant", "data": {}, "options": { "spotify_enabled": false, "qobuz_enabled": false, "tunein_enabled": true, "filesystem_enabled": false, "tunein_username": "sl*****an", "filesystem_directory": "" }, "pref_disable_new_entities": false, "pref_disable_polling": false, "source": "user", "unique_id": null, "disabled_by": null },

antonyslater commented 2 years ago

You don't have to download any files manually, Just use HACS and that will do that for you.

Which is how I did it... Was just a though??

marcelveldt commented 2 years ago

OK, so you're all set. So, with the config you have now (without local folders) you still can not use the configure button? Very strange! Are you on Home Assistant 2022.5.x ?

Can you make a screenshot of the issue ?

Sorry for all the questions but I simply can't reproduce nor understand why it's happening to you.

Your local files collection should work if the files are accessible from the Home Assistant container (mounted). At this time there's no support for remote folders like SMB or cloud drives.

antonyslater commented 2 years ago

Please, no apology necessary, I REALLY appreciate you taking the time to work through this with me.

I am using HA 2022.3.5 loaded in a docker container. Without local folders I can use the Music Assistant to "cast" radio stations to my ChromeCast using InTune saved Radio Favourites. This was configured/set at the point I installed the integration. The "CONFIGURE" button on the integration panel does not work for me.

Loaded integration panel image

Error message received when I click on "CONFIGURE" image

Hope this helps, anything else please just shout.

marcelveldt commented 2 years ago

Uhm, I'm not sure if I'm compatible with HA versions below 2022.5 because this project has just launched last weekend so its really new. There's a very big chance that we simply have an incompatibility issue

antonyslater commented 2 years ago

OK, in which case I'll take a look at upgrading my HA version, that way we know for sure. Should have some time to do that this evening.

When you say "Your local files collection should work if the files are accessible from the Home Assistant container (mounted). At this time there's no support for remote folders like SMB or cloud drives."

Given the following mounted Media sources... image

What would you expect the path to need to be for me to use the "Local Media\Diskstation" files? image

marcelveldt commented 2 years ago

Your second screenshot is the proof that your local files are accessible from the Home Assistant container. So if you use that path it should work. I guess: /media/Diskstation

antonyslater commented 2 years ago

UPDATE : I can confirm that following my upgrade to Home Assistant Core 2022.5.3 this evening that the "CONFIGURE" button does now work as intended in that I can set all my player entities, configure the sources and control the use of MUTE for power control.

Once again I can't thank you enough @marcelveldt for all your precious time today and patience with what turned out to be an issue at my end rather than yours.

marcelveldt commented 2 years ago

Great to hear that resolved it! Thank you for your patience testing my little pet project :-) I will close this issue now because the initial issue is now resolved. Please let me know if you find anything else!

antonyslater commented 2 years ago

No thanks necessary, this is exactly what the Home Assistant community should be about! If I can be of ANY further help please do not hesitate to shout. :-)

baj24 commented 2 years ago

I'm on 2022.5.3 and I'm still getting the same message "Config flow could not be loaded: undefined"

marcelveldt commented 2 years ago

I'm on 2022.5.3 and I'm still getting the same message "Config flow could not be loaded: undefined"

please attach your homeassistant.log file here so I can have a look

wasyl00 commented 2 years ago

Hello I too struggle with "Config flow could not be loaded: undefined" when trying to add Music assistant integration

Here is the log

Logger: homeassistant.util.package Source: util/package.py:99 First occurred: 22:18:01 (3 occurrences) Last logged: 22:18:08

Unable to install package music-assistant==1.4.3: Traceback (most recent call last): File "/usr/local/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/local/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/usr/local/lib/python3.9/site-packages/pip/main.py", line 29, in from pip._internal.cli.main import main as _main File "/usr/local/lib/python3.9/site-packages/pip/_internal/cli/main.py", line 9, in from pip._internal.cli.autocompletion import autocomplete File "/usr/local/lib/python3.9/site-packages/pip/_internal/cli/autocompletion.py", line 10, in from pip._internal.cli.main_parser import create_main_parser File "/usr/local/lib/python3.9/site-packages/pip/_internal/cli/main_parser.py", line 8, in from pip._internal.cli import cmdoptions File "/usr/local/lib/python3.9/site-packages/pip/_internal/cli/cmdoptions.py", line 23, in from pip._internal.cli.parser import ConfigOptionParser File "/usr/local/lib/python3.9/site-packages/pip/_internal/cli/parser.py", line 12, in from pip._internal.configuration import Configuration, ConfigurationError File "/usr/local/lib/python3.9/site-packages/pip/_internal/configuration.py", line 26, in from pip._internal.utils.logging import getLogger File "/usr/local/lib/python3.9/site-packages/pip/_internal/utils/logging.py", line 19, in from pip._vendor.rich.logging import RichHandler File "/usr/local/lib/python3.9/site-packages/pip/_vendor/rich/logging.py", line 12, in from .traceback import Traceback File "/usr/local/lib/python3.9/site-packages/pip/_vendor/rich/traceback.py", line 18, in from .columns import Columns File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 680, in _load_unlocked File "", line 846, in exec_module File "", line 978, in get_code File "", line 647, in _compile_bytecode ValueError: bad marshal data (unknown type code)