Comments (6)
Look like API have changed, see home-assistant/core#92197 (comment)
It also breaks météo France Home Assistant integration.
from meteofrance-api.
The Meteo France archives site can also be used to get vigilances:
http://storage.gra.cloud.ovh.net/v1/AUTH_555bdc85997f4552914346d4550c421e/gra-vigi6-archive_public/2023/07/08/
for today. Data is in the API format.
It was announced here : https://donneespubliques.meteofrance.fr/?fond=produit&id_produit=305&id_rubrique=50
from meteofrance-api.
Here is my script in Bash :
- Go there :https://portail-api.meteofrance.fr/devportal --> Application to make a OAuth2 Key token
- Use your OAuth2 key :
key="put_your_OAUth2_key_here"
get_token=$(curl -k -X POST https://portail-api.meteofrance.fr/token -d "grant_type=client_credentials" -H "Authorization: Basic $key") - Read token :
IFS='"' read -ra token <<< "$get_token"
${token[3]} - Get vigilance :
curl -X GET "https://public-api.meteofrance.fr/public/DPVigilance/v1/textesvigilance/encours" -H "accept: /" -H "Authorization: Bearer ${token[3]}"
Example for "Eure-et-loir" :
department=28
key="put_your_OAUth2_key_here"
get_token=$(curl -k -X POST https://portail-api.meteofrance.fr/token -d "grant_type=client_credentials" -H "Authorization: Basic $key")
IFS='"' read -ra token <<< "$get_token"
${token[3]}
title=$(curl -X GET "https://public-api.meteofrance.fr/public/DPVigilance/v1/textesvigilance/encours" -H "accept: */*" -H "Authorization: Bearer ${token[3]}" | jq --arg dep "$department" '.product.text_bloc_items[] | select(.domain_id==$dep).bloc_title')
dpt=$(curl -X GET "https://public-api.meteofrance.fr/public/DPVigilance/v1/textesvigilance/encours" -H "accept: */*" -H "Authorization: Bearer ${token[3]}" | jq --arg dep "$department" '.product.text_bloc_items[] | select(.domain_id==$dep).domain_name')
Risk :
a=$(curl -X GET "https://public-api.meteofrance.fr/public/DPVigilance/v1/textesvigilance/encours" -H "accept: */*" -H "Authorization: Bearer ${token[3]}" | jq --arg dep "$department" '.product.text_bloc_items[] | select(.domain_id==$dep) | .bloc_items[].text_items[].term_items[].risk_name')
Text :
b=$(curl -X GET "https://public-api.meteofrance.fr/public/DPVigilance/v1/textesvigilance/encours" -H "accept: */*" -H "Authorization: Bearer ${token[3]}" | jq --arg dep "$department" '.product.text_bloc_items[] | select(.domain_id==$dep) | .bloc_items[].text_items[].term_items[].subdivision_text[].text[]')
Get a notification
#!/bin/bash
department=28
key="xxxxxxxxxxxxxxxxxxxxxxxxxx"
get_token=$(curl -k -X POST https://portail-api.meteofrance.fr/token -d "grant_type=client_credentials" -H "Authorization: Basic $key")
IFS='"' read -ra token <<< "$get_token"
title=$(curl -X GET "https://public-api.meteofrance.fr/public/DPVigilance/v1/textesvigilance/encours" -H "accept: */*" -H "Authorization: Bearer ${token[3]}" | jq --arg dep "$department" '.product.text_bloc_items[] | select(.domain_id==$dep).bloc_title')
dpt=$(curl -X GET "https://public-api.meteofrance.fr/public/DPVigilance/v1/textesvigilance/encours" -H "accept: */*" -H "Authorization: Bearer ${token[3]}" | jq --arg dep "$department" '.product.text_bloc_items[] | select(.domain_id==$dep).domain_name')
a=$(curl -X GET "https://public-api.meteofrance.fr/public/DPVigilance/v1/textesvigilance/encours" -H "accept: */*" -H "Authorization: Bearer ${token[3]}" | jq --arg dep "$department" '.product.text_bloc_items[] | select(.domain_id==$dep) | .bloc_items[].text_items[].term_items[].risk_name')
b=$(curl -X GET "https://public-api.meteofrance.fr/public/DPVigilance/v1/textesvigilance/encours" -H "accept: */*" -H "Authorization: Bearer ${token[3]}" | jq --arg dep "$department" '.product.text_bloc_items[] | select(.domain_id==$dep) | .bloc_items[].text_items[].term_items[].subdivision_text[].text[]')
#c=$(curl -X GET "https://public-api.meteofrance.fr/public/DPVigilance/v1/textesvigilance/encours" -H "accept: */*" -H "Authorization: Bearer ${token[3]}"| jq '.product.text_bloc_items[25].bloc_items[1].text_items[0].term_items[0].subdivision_text[0].text')
#d=$(curl -X GET "https://public-api.meteofrance.fr/public/DPVigilance/v1/textesvigilance/encours" -H "accept: */*" -H "Authorization: Bearer ${token[3]}"| jq '.product.text_bloc_items[25].bloc_items[2].text_items[0].term_items[0].subdivision_text[0].text')
IFS=',' str="$(echo -e "\nVIGILANCE POUR AUJOURD'HUI : \n\nRisque : "${a[@]} '\n'${b[@]})"
str=${str//[/}
str=${str//]/}
str=${str/ / /}
str=${str//'"'/}
str=${str//null/}
str=${str//$'\n\n\n'/}
str=${str//$'. '/$'.\n\n'}
titre="$(echo $title en $dpt)"
titre=${titre//'"'/}
titre=${titre//'*'/}
titre=${titre//$'\n'/}
if [[ ( -z "${a[@]}" || "${a[@]}" == "null" ) && ( -z "${b[@]}" || "${b[@]}" == "null" ) ]]; then
str="Pas de vigilance aujourd'hui"
fi
zenity --info --title "$titre" --text $str --icon-name weather-severe-alert-symbolic --ok-label "C'est bon, merci :-)"
from meteofrance-api.
I have the same problem :
alert=client.get_warning_full(domain="75")
alert.end_validity_time
1680667200 --> Wednesday, April 5, 2023 4:00:00 GMT
alert.update_time
1680595200 --> Tuesday, April 4, 2023 8:00:00 GMT
And today is June 12, 2023
from meteofrance-api.
I'd be willing to take a look at using the API v2 if no one is actually working on it.
I'll update this thread once I start to have something. Let me know if you have any other info or suggestions.
For now, I guess the first question is how to properly handle the token generation if it needs an account to be regularly re-generated...
I don't think that's an issue to request user credential from this library/API. But I don't know about the HA integration, I've never done it, so it would take me a while...
from meteofrance-api.
Does using API v3 is solving the issue ?
#680
from meteofrance-api.
Related Issues (20)
- Hypermodern python setup HOT 2
- Improve tests
- Where did you get the API token? HOT 1
- Les vitesses de vent ne correspondent pas HOT 4
- Add description, format and unit of the parameter in the API
- Add Python 3.9 support
- Class constructor docstrings are not in the generated documentation
- Link to HACF Discord and forums.
- Rename Python module name with meteofrance_api
- Requirement is pinned for meteofrance-api 1.0.1: pytz<2021.0,>=2020.4
- Meteo France Cloud Cover between 10% and 90% - Octas ?
- Générer son propre token ? HOT 2
- Incompatibility with pytz 2022.1
- Use the v2/observation API endpoint HOT 1
- API return 502 HTTP error when trying to get full warning HOT 2
- Possible values of meteofrance-api nextrain
- Weather icons reference ? HOT 2
- Example to get historical data
- get_rain not working HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meteofrance-api.