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

Climatempo error #2

Open
Joberr opened this issue Oct 29, 2020 · 12 comments
Open

Climatempo error #2

Joberr opened this issue Oct 29, 2020 · 12 comments

Comments

@Joberr
Copy link

Joberr commented Oct 29, 2020

I followed all your instructions, but when I check the configuration I get the
error: Platform error weather.climatempo - Integration 'climatempo' not found.
what am I doing wrong?

Home Assistant 0.116.4
Version 2020.10.0

@clyra
Copy link
Owner

clyra commented Oct 29, 2020

This is a old component that I no longer use, so it didnt get the updates to work on the newer versions of home-assistant. But the fix was easy as it just need the manifest.json file. May you clone and try again the component? Did you got the climatempo api key?

@Joberr
Copy link
Author

Joberr commented Oct 30, 2020 via email

@Joberr
Copy link
Author

Joberr commented Oct 30, 2020

Hi Clyra, I tried again and now the error is: Cannot read property 'setConfig' of undefined.

@clyra
Copy link
Owner

clyra commented Oct 30, 2020

Hi,

Hm... it seems a configuration problem. Here is a config for Belo Horizonte:

  • platform: climatempo
    name: 'Tempo em Belo Horizonte'
    api_key: <your_api_id>
    city: 6879

@Joberr
Copy link
Author

Joberr commented Oct 30, 2020

It’s more or less like this, what happens is that the entity weather.climatempo doesn’t appear, it should appear, right?

platform: climatempo
name: "Agora em B H"
api_key: <myr_api_id>
city: 6879

@clyra
Copy link
Owner

clyra commented Oct 30, 2020 via email

@Joberr
Copy link
Author

Joberr commented Oct 30, 2020

Ok, But I have no other weather.xxx than weather.openweathermap

@clyra
Copy link
Owner

clyra commented Oct 30, 2020

is there something in logs? may you enable debug on home-assistant?

@Joberr
Copy link
Author

Joberr commented Oct 30, 2020

I have :
Logger: homeassistant.components.weather
Source: custom_components/climatempo/weather.py:221
Integration: Weather (documentation, issues)
First occurred: 10:34:00 AM (1 occurrences)
Last logged: 10:34:00 AM

climatempo: Error on device update!
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 346, in _async_add_entity
await entity.async_device_update(warning=False)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 471, in async_device_update
await self.hass.async_add_executor_job(self.update) # type: ignore
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/climatempo/weather.py", line 181, in update
self._ct.update()
File "/usr/src/homeassistant/homeassistant/util/init.py", line 239, in wrapper
result = method(*args, **kwargs)
File "/config/custom_components/climatempo/weather.py", line 221, in update
for i in self.daily:
TypeError: 'NoneType' object is not iterable

Logger: homeassistant.loader
Source: loader.py:440
First occurred: 10:33:57 AM (1 occurrences)
Last logged: 10:33:57 AM

You are using a custom integration for climatempo 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.

and

Logger: custom_components.climatempo.weather
Source: custom_components/climatempo/weather.py:215
Integration: climatempo
First occurred: 10:34:00 AM (1 occurrences)
Last logged: 10:34:00 AM

Unable to connect to climatempo, http://apiadvisor.climatempo.com.br/api/v1/weather/locale/6879/current?token=9488c66223568903d95bXXXXX....

And when I try to use the http directly in my browser I have:

{"error":true,"detail":"Access forbidden, you have no acces for this locale: 6879,\n check our docs to register the city you want to consult"}

Thanks for your patience :)

@clyra
Copy link
Owner

clyra commented Oct 30, 2020

ah.. some progress. it seems a problem with your token. The free api from climatempo is very restricted (for instance you can only have one token, which makes testing a little more difficult)! Maybe you could try to cancel your token and create a new one?

@Joberr
Copy link
Author

Joberr commented Oct 30, 2020

I did 5 times and I got the same error. I will wait until tomorrow to try again.

@clyra
Copy link
Owner

clyra commented Oct 30, 2020

I just found the problem!

It seems that the API has become even more restricted and you have to register your token to the city you want to retrieve data (only 2 cities allowed!). Here is the documentation about that: http://apiadvisor.climatempo.com.br/doc/index.html#api-UserTokenManagement-UserTokenGetLocales

You can just run this on the command line to make the registration for BH:

curl -X PUT 'http://apiadvisor.climatempo.com.br/api-manager/user-token/put-your-token-here/locales' -H 'Content-Type: application/x-www-form-urlencoded' -d 'localeId[]=6879'

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