Salut,
J’ai reçu ton post. je viens d’essayer le script et l’automatisation mais j’ai une erreur de script.
Logger: homeassistant.components.script.netro_synchro_meteo_france
Source: helpers/script.py:410
Integration: Script (documentation, issues)
First occurred: 21:55:46 (1 occurrences)
Last logged: 21:55:46
Netro Synchro Météo France: Error executing script. Invalid data for call_service at pos 1: required key not provided @ data['humidity']
Je ne comprend pas d’où vient l’erreur.
alias: Netro Synchro Météo France
mode: single
icon: mdi:weather-sunny
variables:
weather_id: weather.villebon_sur_yvette
today_rain_prob_entity: sensor.villebon_sur_yvette_rain_chance
today_temperature_entity: sensor.villebon_sur_yvette_temperature_2
today_wind_speed_entity: sensor.villebon_sur_yvette_wind_speed
today_pressure_entity: sensor.villebon_sur_yvette_pressure_2
sequence:
- alias: report today weather in detail
service: netro_watering.report_weather
data:
config_entry_id: "{{ config_entry_controller }}"
date: >
{{ as_timestamp(state_attr(weather_id,'forecast')[0].datetime, now()) |
timestamp_custom("%Y-%m-%d") }}
condition: >
{% set mapped_conditions = {'clear-night': 'clear', 'cloudy': 'cloudy',
'exceptional': 'clear', 'fog': 'cloudy', 'hail': 'rain', 'lightning':
'clear', 'lightning-rainy': 'rain', 'partlycloudy': 'cloudy', 'pouring':
'rain', 'rainy': 'rain', 'snowy': 'snow', 'snowy-rainy': 'snow',
'sunny': 'clear', 'windy': 'wind', 'windy-variant': 'wind'} %}
{% set current_condition =
state_attr(weather_id,'forecast')[0].condition %}
{{ mapped_conditions[current_condition] }}
rain: |
{{ state_attr(weather_id,'forecast')[0].precipitation }}
t_min: |
{{ state_attr(weather_id,'forecast')[0].templow }}
t_max: |
{{ state_attr(weather_id,'forecast')[0].temperature }}
rain_prob: |
{{ states(today_rain_prob_entity) }}
temp: |
{{ states(today_temperature_entity) }}
wind_speed: |
{{ (states(today_wind_speed_entity) | float / 3.6) | round(1) }}
pressure: |
{{ states(today_pressure_entity) }}
- alias: report the next n days weather forecast
repeat:
count: "{{ number_of_days_forecast }}"
sequence:
- service: netro_watering.report_weather
data:
config_entry_id: "{{ config_entry_controller }}"
date: >
{{
as_timestamp(state_attr(weather_id,'forecast')[repeat.index].datetime,
now()) | timestamp_custom("%Y-%m-%d") }}
condition: >
{% set mapped_conditions = {'clear-night': 'clear', 'cloudy':
'cloudy', 'exceptional': 'clear', 'fog': 'cloudy', 'hail': 'rain',
'lightning': 'clear', 'lightning-rainy': 'rain', 'partlycloudy':
'cloudy', 'pouring': 'rain', 'rainy': 'rain', 'snowy': 'snow',
'snowy-rainy': 'snow', 'sunny': 'clear', 'windy': 'wind',
'windy-variant': 'wind'} %}
{% set current_condition =
state_attr(weather_id,'forecast')[repeat.index].condition %}
{{ mapped_conditions[current_condition] }}
rain: >
{{ state_attr(weather_id,'forecast')[repeat.index].precipitation
}}
t_min: |
{{ state_attr(weather_id,'forecast')[repeat.index].templow }}
t_max: |
{{ state_attr(weather_id,'forecast')[repeat.index].temperature }}