Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting 301 redirect for API #3

Open
jeffkibuule opened this issue Aug 8, 2022 · 4 comments
Open

Getting 301 redirect for API #3

jeffkibuule opened this issue Aug 8, 2022 · 4 comments

Comments

@jeffkibuule
Copy link
Contributor

jeffkibuule commented Aug 8, 2022

I tried installing this integration but it looks like they changed the API location?

Traceback (most recent call last):
File "/config/custom_components/span_panel/init.py", line 53, in async_update_data
await span_panel.spaces.getData()
File "/config/custom_components/span_panel/span_panel.py", line 231, in getData
results.raise_for_status()
File "/usr/local/lib/python3.10/site-packages/httpx/_models.py", line 736, in raise_for_status
raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: Redirect response '301 Moved Permanently' for url 'http://192.168.0.170/api/v1/spaces'
For more information check: https://httpstatuses.com/301

@galak
Copy link
Owner

galak commented Aug 8, 2022

What firmware version do you have?
Are you able to go to http://192.168.0.170?

@jeffkibuule
Copy link
Contributor Author

jeffkibuule commented Aug 10, 2022

My firmware is spanos2/r202223/03. I ended up fixing that issue in a fork. I want to send you a PR when I have something: https://github.com/jeffkibuule/span-hacs

So far I've added:

  • Renaming spaces to circuits in codebase
  • Seeing circuits in the energy tab

Still stumped on:

  • Seeing total energy consumption of the panel in the energy tab.
  • History of individual circuits shows total usage since install in detail view, not over the period of time specified.

Screen Shot 2022-08-10 at 10 15 52 AM

Screen Shot 2022-08-10 at 10 16 13 AM

@galak
Copy link
Owner

galak commented Aug 10, 2022

Interesting, I wonder if that is a newer or older firmware compared to spanos2/r202216/04. How recent is your actual span panel?

  • On the history, I wasnt sure if I'm reporting the proper data to HA. Need to chat w/some HA developers on that to better understand what we should be doing.
  • For total consumption - not sure if in the API adding something, vs having just HA do the calculation.

@jeffkibuule
Copy link
Contributor Author

jeffkibuule commented Aug 10, 2022

My Span panel installation is from March 2022. I feel like the API on my device is newer, as accessing api/v1/spaces leaves the following message:

{"detail":"'spaces' endpoint has been deprecated, switch to 'circuits'"}

My model is 00200 if that matters.

galak added a commit that referenced this issue Jan 30, 2023
Fix issue #3 from updated API, add Energy tab support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants