Home Assistant Integration Error with API URL

I just updated to 0.3.0-beta2. I’m seeing the following in my Home Assistant logs (it might have happened before and I didn’t notice, was just checking post update):

2023-10-30 12:44:22.636 ERROR (MainThread) [homeassistant.components.media_player] Error while setting up amplipi platform for media_player
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 359, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/amplipi/media_player.py", line 85, in async_setup_entry
    status = await amplipi.get_status()
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyamplipi/amplipi.py", line 29, in get_status
    response = await self._client.get('')
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyamplipi/client.py", line 168, in get
    return await self._process_response(response)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyamplipi/client.py", line 94, in _process_response
    await self._handle_error(response)
  File "/usr/local/lib/python3.11/site-packages/pyamplipi/client.py", line 56, in _handle_error
    raise APIError(
pyamplipi.error.APIError: AmpliPi api error: The url http://192.168.2.20:80/api/ returned error 404

This line: The url http://192.168.2.20:80/api/ - if i hit that address on my local network, I get{"detail":"Not Found"}, but if I alter it to http://192.168.2.20:80/api, I see the full amplipi API output.

The same is true if I use wget via Terminal on my HA instance:

I removed the integration in an attempt to troubleshoot it and Home Assistant discovers the amplipi, but will not save:

image

I attempted to edit the address in __init__.py and config_flow.py to just /api, but I must be missing a required step because I’m still seeing the /api/ returned 404 error.

Sorry about that, we found that and corrected it in an upcoming release, keep an eye out for that one

For now, I’d suggest just rolling back your software using the updater.

Steven Engelbert
AmpliPi / AmpliPro Support Coordinator

1 Like

Thanks. Looks like both the beta-1 and beta-2 of 0.3.0 have the issue, so I’d need to rollback to 0.2.1?

Is there an expected timeframe for the upcoming release?

I don’t necessarily know when that issue was added to the codebase, the only suggestion I can immediately give is to keep rolling back version by version until that’s fixed unless further rollbacks remove other features or bugfixes that you personally rely on

For the timetable on the new release, we’re aiming for the next few days and ideally by the end of the week, we’re awaiting @klay2000 updating the linked PR so that it can pass our review

Steven Engelbert
AmpliPi / AmpliPro Support Coordinator

1 Like

We’ve just merged that PR and are now working on making a new release that includes it, sometime tomorrow you’ll be able to get all functionality back and have the most up to date software

Steven Engelbert
AmpliPi / AmpliPro Support Coordinator

Great! Appreciate the update and am looking forward to 0.3.0 to see if the issues I have been having with Spotify have been addressed.

Just a heads up the beta (now 0.3.0-beta3) was updated late last week to fix that issue. We will see if we can make an update to the Spotify integration (spotifyd) soon as well but that is unlikely to make it into this 0.3.0 release.

Thanks! I installed it last week and have been playing around. Somehow I just deleted the player tab (not sure how I did that):

And none of the Spotify metadata is coming through now (though it did last week after updating). Perhaps I need to reboot the device…

Yeah we haven’t made any changes on that side, so this will probably be fixed by a reboot.

I rebooted it a few times today, but still not getting any metadata to show from Spotify.

I think this is the service that reads the metadata?

EDIT: I paused spotify and then I noticed the metadata read. Now when songs are advancing, it’s updating correctly.

I’m a little behind on this thread, but I believe that the player tab doesn’t exist until you select a player on the home screen, it won’t be on the bottom bar and it’ll show this message if you manage to get there regardless via bookmarks or url navigation

Steven Engelbert
AmpliPi / AmpliPro Support Coordinator

Ooooh, I had no idea that selecting something on the on the Home tab, then “activated” it on the Player tab. I’m not sure how to make that more obvious, but that went way over my head. I had clicked on the name of the stream, the name of the zone, but not the blank space around it…

I’ve just made a github issue referencing this specific comment, I think that’s some good feedback and we’ll definitely want to improve that shortcoming

Steven Engelbert
AmpliPi / AmpliPro Support Coordinator

1 Like