Makai
Décembre 5, 2020, 2:00
21
J’ai ouvert, comme demandé sur Discord, une issue expliquant les ajouts dont je parle. Avant de faire ça, j’ai étudié le code de meteofrance-api et codé un petit script me permettant de récupérer toutes les infos disponibles par l’API
opened 09:59AM - 04 Dec 20 UTC
closed 08:12PM - 30 Mar 21 UTC
enhancement
integration: meteo_france
stale
## Context
The meteofrance-api returns a lot of information that is currently… not available in the meteo france integration. Some are available but in the weather "part". To get them, one should create template sensors which is not that easy...
## Proposal
I suggest to add nearly all information provided by the API to the metro france integration by adding sensors (disabled by default).
I also suggest to name these sensors according the forecast: current, today, daily:
Sensors for the current forecast should be named as-is. Example: `temperature`, `humidity`, `wind_direction`, `wind_gust`, `condition`, etc.
Sensors for today's forecast and the daily forecast should be named differently (these are examples):
- for today's forecast: `today_high_temperature`, `today_low_temperature`, `today_uv`, `today_xxxx`, `today_condition`, etc.
- for daily forecast: `daily_high_temperature_1d` (or `high_temperature_1d`?), `daily_high_humidity_1d`, etc.
Here are sensors that I would like to see added:
- Current Forecast:
- Current condition:
- Name: `condition`
- Path: current_forecast:weather:desc
- Example: "Très nuageux"
- Current humidity:
- Name: `humidity`
- Path: current_forecast:humidity
- Example: "90%"
- Current Wind Gust:
- Name: `wind_gust`
- Path: current_forecast:wind:gust
- Example: 0 km/h
- Current Wind Direction:
- Name: `wind_direction`
- Path: current_forecast:wind:direction
- Example: 235°
- Today's forecast:
- Condition:
- Name: `today_condition`
- Path: today_forecast:weather:desc
- Example: "Très nuageux"
- Min humidity:
- Name: `today_low_humidity`
- Path: today_forecast:humidity:min
- Example: "70%"
- Max humidity:
- Name: `today_high_humidity`
- Path: today_forecast:humidity:max
- Example: "90%"
- Min temperature:
- Name: `today_low_temperature`
- Path: today_forecast:T:min
- Example: "4°"
- Max temperature:
- Name: `today_high_temperature`
- Path: today_forecast:T:max
- Example: "6°"
- UV:
- Name: `today_uv`
- Path: today_forecast:uv
- Example: "70%"
- Precipitation:
- Name: `today_precipitation`
- Path: today_forecast:precipitation:24h
- Example: "0.3mm"
- Daily forecast (for the next 3 or 4 days only?):
- Condition:
- Name: `daily_condition_1d`
- Path: daily_forecast:weather12H:desc
- Example: "Très nuageux"
- Min humidity:
- Name: `daily_low_humidity_1d`
- Path: daily_forecast:humidity:min
- Example: "70%"
- Max humidity:
- Name: `daily_high_humidity_1d`
- Path: daily_forecast:humidity:max
- Example: "90%"
- Min temperature:
- Name: `daily_low_temperature_1d`
- Path: daily_forecast:T:min
- Example: "4°"
- Max temperature:
- Name: `daily_high_temperature_1d`
- Path: daily_forecast:T:max
- Example: "6°"
- UV:
- Name: `daily_uv_1d`
- Path: daily_forecast:uv
- Example: "70%"
- Precipitation:
- Name: `daily_precipitation_1d`
- Path: daily_forecast:precipitation:24h
- Example: "0.3mm"
Note that the UV sensor should be renamed `today_uv` instead of `uv` as it is not the current UV index but today's forecast UV index.
Current and today's forecast sensors could be added very easily as only the const.py file needs to be modified (well wind has to be converted to km/h in sensor.py). For daily forecast we will need to do an iteration.
## Consequences
A better metro france integration, with more data. No DB overload if these sensors are disabled by default. I see one breaking change in renaming the UV sensor.
Je suis dispo pour en parler. En espérant que ça vous paraisse pertinent.
Je suis prêt à faire une PR pour les 3/4 de ce que je propose. Pour le 1/4 restant (ajout du daily forecast pour 3 ou 4 jours), je m’y pencherais par la suite.
Donc en fait il y a une solution de contournement mais pas de moyen d’avoir les 2 sur la même ville.
Je pensais faire ceci mais j’imaginais qu’il y avait un moyen.
Merci pour ta réponse @Clemalex