Why do you need the user-agent? This URL works without too
EDIT and you may want to use lat/lon that are not your address (if these are indeed your address )
EDIT, checked the API and I now understand, it requires a unique identifier, likely to block when too many requests come in, this works for me (obfuscated a few things). Based on the output, you would likely need a bit more fiddling with jq or templates to get usefull data in HA
There was a change in the API yes with the need of the user-agent.
Unfortunatly it still does not show any data. I use the old YR platform and that showed data until the change in the API.
How to make it work now I don´t know.
I get this error in the logs.
[homeassistant.components.yr.sensor] Retrying in 15 minutes: https://api.met.no/weatherapi/locationforecast/2.0/classic?lat=55.4370338&lon=10.3822298&altitude=7 returned 403
EDIT: and why do you need this approach if there is already an existing integration with met.no ? For me/others it is easier to support if you ask direct questions, vagueness will continue to lead in vague answers or no answers at all
Okay I will try to be more specific.
It actaully shows “OK” and “Feature” with the “value_json.type”
I used the YR platform before the change in API and it showed values fine.
I guess it should fetch the data.
- platform: yr
forecast: 2
monitored_conditions:
- symbol
- windSpeed
I have not changed anything. I just read that due to the changes I had to use the user-agent to identify myself.
The met.no integration in the HA version I use is too old. I am on version 0.103.6 (I know I know )
OK, I was not aware of yr platform’s existance till now. Integrations are built based on the json/response but not sure how it would map to your own pulled json.
Can’t help you as abroad … but also afterwards, I donot know yr platform nor this workaround…was just searching for it.
From a HACS pov, I have not yet seen one that brings down HA so check logs a.o.
The log file is not updated when HA won´t restart.
I will try out different things but I had honestly hoped that using the user-agent was enough to solve the problem.
The rest sensor you showed in the first post is just-that, it does not do a thing more than to download the json from the url provided and trat the content along the value_template you used. The yr platform (whatever it does) has no idea of a local json or rest sensor unless there is a way to connect these 2, which I doubt it does.
You seem to have no choice but to use the workaround and get that working