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

API doesn’t seem to work anymore #12

Open
dickwolff opened this issue Jan 1, 2023 · 1 comment
Open

API doesn’t seem to work anymore #12

dickwolff opened this issue Jan 1, 2023 · 1 comment

Comments

@dickwolff
Copy link

Hi,

First of all, happy new year!

I just added this sensor to my HA setup and after setting it up and rebooting I get this message in my logs:

Logger: homeassistant.components.sensor
Source: helpers/aiohttp_client.py:52 
Integration: Sensor (documentation, issues) 
First occurred: 11:32:08 (1 occurrences) 
Last logged: 11:32:08

Error while setting up greenchoice_variable_tariffs platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 281, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/greenchoice_variable_tariffs/sensor.py", line 80, in async_setup_platform
    await greenchoice_api.async_update()
  File "/config/custom_components/greenchoice_variable_tariffs/sensor.py", line 142, in async_update
    json = await response.json()
  File "/usr/src/homeassistant/homeassistant/helpers/aiohttp_client.py", line 52, in json
    return await super().json(*args, loads=loads, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1103, in json
    raise ContentTypeError(
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', url=URL('https://www.greenchoice.nl/umbraco/surface/quotation/GetQuotation')

After looking on here if there were similar issues I found the API URL in another issue. However that now returns a 404 page, which then seems to correspond with the error from HA.

Is it possible the API has been moved? Is there something else I’m missing what could be the reason this now pops up?

@toaomatis
Copy link
Owner

This is most likely due to the fact that Green Choice changed their API and / or not providing any tariffs for the quotation.

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