eifinger/hass-here-weather

Error on setup when here_travel_time is also in use

b-0s opened this issue · 11 comments

b-0s commented

I followed the procedure but I have the following message:

HERE reported an invalid request. This indicates the supplied location is not valid.

I left the name as here_weather

Latitude is
48.xxxxxxxxx
Longitude is
2.yyyyyyyyy

I live in Paris FRANCE

Here is the log:

This error originated from a custom integration.

Logger: aiohttp.server
Source: custom_components/here_weather/config_flow.py:17
Integration: HERE Destination Weather (documentation, issues)
First occurred: 11:07:59 PM (1 occurrences)
Last logged: 11:07:59 PM

Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
resp = await self._request_handler(request)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 499, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 119, in impl
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 211, in forwarded_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 24, in request_context_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 78, in ban_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 144, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 135, in handle
result = await result
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 155, in post
return await super().post(request, flow_id)
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 63, in wrapper
result = await method(view, request, *args, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 109, in post
result = await self._flow_mgr.async_configure(flow_id, data)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 202, in async_configure
result = await self._async_handle_step(flow, cur_step["step_id"], user_input)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 260, in _async_handle_step
result: FlowResult = await getattr(flow, method)(user_input)
File "/config/custom_components/here_weather/config_flow.py", line 37, in async_step_user
await async_validate_user_input(self.hass, user_input)
File "/config/custom_components/here_weather/config_flow.py", line 17, in async_validate_user_input
await hass.async_add_executor_job(
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.9/site-packages/herepy/destination_weather_api.py", line 154, in weather_for_coordinates
Use the metric system.
File "/usr/local/lib/python3.9/site-packages/herepy/destination_weather_api.py", line 39, in _get
error = self._get_error_from_response(json_data)
herepy.error.HEREError: Error occured on _get

Thank you for reporting the error I will investgate this and get back to you as soon as possible.

Are you using the here_travel_time integration?

Is your homeassistant instance configured to use the metric or imperial system?

b-0s commented

Yes I am using the here_travel_time and I am using metric

b-0s commented

Looks like I had to edit my configuration.yaml and remove the here_travel_time settings to make it work :)

Ah *****. They are both using the same library but in different versions. Seems like the version of the official here_travel_time integration wins and this old version does not work anymore for here weather.
I can fix this but it will take me a day or two

b-0s commented

For your info: I added back the here_travel_time settings in my configuration.yaml afterward and both work.

This is very interesting. Thank you!

@b-0s I just released version 1.0.2 which should fix this issue.

@b-0s I tested the new version with a test setup of mine.
Can I close this issue?

b-0s commented

Yes i have tested again and it worked. Even pushed version 3.All is fixed and run fine.