Right, thanks.
So I have this template sensor.
- trigger:
- platform: time_pattern
minutes: /5
action:
- service: weather.get_forecasts
data:
type: hourly
target:
entity_id: weather.openweathermap
response_variable: hourly
sensor:
- name: Precipitation forecast next hour
unique_id: precipitation_forecast_next_hour
state: "{{ hourly['weather.openweathermap'].forecast[0].precipitation_probability }}"
unit_of_measurement: '%'
attributes:
forecast: "{{ hourly['weather.openweathermap'].forecast }}"
If I place in developer tools/template
{{ state_attr('sensor.precipitation_forecast_next_hour','forecast') }}
I get
[
{
"condition": "rainy",
"precipitation_probability": 100,
"datetime": "2024-05-21T18:00:00+00:00",
"wind_bearing": 74,
"cloud_coverage": 100,
"temperature": 16.7,
"pressure": 1009,
"wind_speed": 1.04,
"precipitation": 2.04,
"humidity": 56
},
{
"condition": "rainy",
"precipitation_probability": 100,
"datetime": "2024-05-21T21:00:00+00:00",
"wind_bearing": 268,
"cloud_coverage": 100,
"temperature": 14,
"pressure": 1009,
"wind_speed": 2.02,
"precipitation": 2.82,
"humidity": 78
},
{
"condition": "rainy",
"precipitation_probability": 100,
"datetime": "2024-05-22T00:00:00+00:00",
"wind_bearing": 341,
"cloud_coverage": 100,
"temperature": 12.1,
"pressure": 1008,
"wind_speed": 8.5,
"precipitation": 2.52,
"humidity": 97
},
{
"condition": "rainy",
"precipitation_probability": 100,
"datetime": "2024-05-22T03:00:00+00:00",
"wind_bearing": 358,
"cloud_coverage": 100,
"temperature": 11.8,
"pressure": 1006,
"wind_speed": 6.16,
"precipitation": 1.63,
"humidity": 98
},
{
"condition": "rainy",
"precipitation_probability": 100,
"datetime": "2024-05-22T06:00:00+00:00",
"wind_bearing": 323,
"cloud_coverage": 100,
"temperature": 11.7,
"pressure": 1006,
"wind_speed": 10.37,
"precipitation": 3.89,
"humidity": 99
},
{
"condition": "rainy",
"precipitation_probability": 100,
"datetime": "2024-05-22T09:00:00+00:00",
"wind_bearing": 303,
"cloud_coverage": 100,
"temperature": 11.3,
"pressure": 1005,
"wind_speed": 15.8,
"precipitation": 3.94,
"humidity": 98
},
{
"condition": "rainy",
"precipitation_probability": 100,
"datetime": "2024-05-22T12:00:00+00:00",
"wind_bearing": 299,
"cloud_coverage": 100,
"temperature": 11.5,
"pressure": 1004,
"wind_speed": 25.02,
"precipitation": 7.64,
"humidity": 98
},
{
"condition": "rainy",
"precipitation_probability": 100,
"datetime": "2024-05-22T15:00:00+00:00",
"wind_bearing": 291,
"cloud_coverage": 100,
"temperature": 11.8,
"pressure": 1004,
"wind_speed": 20.56,
"precipitation": 5.17,
"humidity": 98
},
{
"condition": "rainy",
"precipitation_probability": 100,
"datetime": "2024-05-22T18:00:00+00:00",
"wind_bearing": 281,
"cloud_coverage": 100,
"temperature": 11,
"pressure": 1004,
"wind_speed": 25.16,
"precipitation": 5.51,
"humidity": 98
},
{
"condition": "rainy",
"precipitation_probability": 100,
"datetime": "2024-05-22T21:00:00+00:00",
"wind_bearing": 291,
"cloud_coverage": 100,
"temperature": 10.8,
"pressure": 1005,
"wind_speed": 27.58,
"precipitation": 5.57,
"humidity": 98
},
{
"condition": "rainy",
"precipitation_probability": 100,
"datetime": "2024-05-23T00:00:00+00:00",
"wind_bearing": 272,
"cloud_coverage": 100,
"temperature": 9.8,
"pressure": 1006,
"wind_speed": 27.97,
"precipitation": 3.83,
"humidity": 98
},
{
"condition": "rainy",
"precipitation_probability": 100,
"datetime": "2024-05-23T03:00:00+00:00",
"wind_bearing": 271,
"cloud_coverage": 100,
"temperature": 8.9,
"pressure": 1007,
"wind_speed": 30.89,
"precipitation": 1.77,
"humidity": 97
},
{
"condition": "rainy",
"precipitation_probability": 100,
"datetime": "2024-05-23T06:00:00+00:00",
"wind_bearing": 271,
"cloud_coverage": 100,
"temperature": 8.1,
"pressure": 1009,
"wind_speed": 30.6,
"precipitation": 0.14,
"humidity": 96
},
{
"condition": "rainy",
"precipitation_probability": 38,
"datetime": "2024-05-23T09:00:00+00:00",
"wind_bearing": 274,
"cloud_coverage": 100,
"temperature": 8,
"pressure": 1011,
"wind_speed": 31.1,
"precipitation": 0.23,
"humidity": 95
},
{
"condition": "cloudy",
"precipitation_probability": 22,
"datetime": "2024-05-23T12:00:00+00:00",
"wind_bearing": 276,
"cloud_coverage": 100,
"temperature": 8.1,
"pressure": 1013,
"wind_speed": 30.89,
"precipitation": 0,
"humidity": 93
},
{
"condition": "cloudy",
"precipitation_probability": 0,
"datetime": "2024-05-23T15:00:00+00:00",
"wind_bearing": 275,
"cloud_coverage": 100,
"temperature": 8.6,
"pressure": 1014,
"wind_speed": 31.46,
"precipitation": 0,
"humidity": 89
},
{
"condition": "cloudy",
"precipitation_probability": 0,
"datetime": "2024-05-23T18:00:00+00:00",
"wind_bearing": 284,
"cloud_coverage": 100,
"temperature": 8.5,
"pressure": 1015,
"wind_speed": 28.12,
"precipitation": 0,
"humidity": 86
},
{
"condition": "cloudy",
"precipitation_probability": 0,
"datetime": "2024-05-23T21:00:00+00:00",
"wind_bearing": 277,
"cloud_coverage": 98,
"temperature": 8.9,
"pressure": 1017,
"wind_speed": 23.26,
"precipitation": 0,
"humidity": 81
},
{
"condition": "cloudy",
"precipitation_probability": 0,
"datetime": "2024-05-24T00:00:00+00:00",
"wind_bearing": 268,
"cloud_coverage": 99,
"temperature": 8.4,
"pressure": 1017,
"wind_speed": 20.38,
"precipitation": 0,
"humidity": 81
},
{
"condition": "cloudy",
"precipitation_probability": 0,
"datetime": "2024-05-24T03:00:00+00:00",
"wind_bearing": 267,
"cloud_coverage": 99,
"temperature": 7.9,
"pressure": 1017,
"wind_speed": 19.94,
"precipitation": 0,
"humidity": 82
},
{
"condition": "cloudy",
"precipitation_probability": 0,
"datetime": "2024-05-24T06:00:00+00:00",
"wind_bearing": 252,
"cloud_coverage": 100,
"temperature": 7.5,
"pressure": 1018,
"wind_speed": 14.44,
"precipitation": 0,
"humidity": 86
},
{
"condition": "cloudy",
"precipitation_probability": 0,
"datetime": "2024-05-24T09:00:00+00:00",
"wind_bearing": 256,
"cloud_coverage": 98,
"temperature": 8.7,
"pressure": 1019,
"wind_speed": 13.21,
"precipitation": 0,
"humidity": 84
},
{
"condition": "cloudy",
"precipitation_probability": 0,
"datetime": "2024-05-24T12:00:00+00:00",
"wind_bearing": 264,
"cloud_coverage": 99,
"temperature": 10.9,
"pressure": 1019,
"wind_speed": 10.62,
"precipitation": 0,
"humidity": 81
},
{
"condition": "cloudy",
"precipitation_probability": 0,
"datetime": "2024-05-24T15:00:00+00:00",
"wind_bearing": 289,
"cloud_coverage": 100,
"temperature": 11.3,
"pressure": 1019,
"wind_speed": 6.98,
"precipitation": 0,
"humidity": 80
},
{
"condition": "cloudy",
"precipitation_probability": 0,
"datetime": "2024-05-24T18:00:00+00:00",
"wind_bearing": 318,
"cloud_coverage": 100,
"temperature": 11.6,
"pressure": 1020,
"wind_speed": 3.06,
"precipitation": 0,
"humidity": 83
},
{
"condition": "cloudy",
"precipitation_probability": 0,
"datetime": "2024-05-24T21:00:00+00:00",
"wind_bearing": 5,
"cloud_coverage": 99,
"temperature": 9.8,
"pressure": 1020,
"wind_speed": 5.04,
"precipitation": 0,
"humidity": 89
},
{
"condition": "cloudy",
"precipitation_probability": 0,
"datetime": "2024-05-25T00:00:00+00:00",
"wind_bearing": 102,
"cloud_coverage": 97,
"temperature": 8.8,
"pressure": 1020,
"wind_speed": 3.06,
"precipitation": 0,
"humidity": 91
},
{
"condition": "cloudy",
"precipitation_probability": 0,
"datetime": "2024-05-25T03:00:00+00:00",
"wind_bearing": 166,
"cloud_coverage": 100,
"temperature": 9.3,
"pressure": 1020,
"wind_speed": 4.61,
"precipitation": 0,
"humidity": 90
},
{
"condition": "cloudy",
"precipitation_probability": 0,
"datetime": "2024-05-25T06:00:00+00:00",
"wind_bearing": 158,
"cloud_coverage": 66,
"temperature": 9.3,
"pressure": 1020,
"wind_speed": 5.83,
"precipitation": 0,
"humidity": 92
},
{
"condition": "cloudy",
"precipitation_probability": 0,
"datetime": "2024-05-25T09:00:00+00:00",
"wind_bearing": 168,
"cloud_coverage": 58,
"temperature": 12.4,
"pressure": 1020,
"wind_speed": 14.26,
"precipitation": 0,
"humidity": 74
},
{
"condition": "cloudy",
"precipitation_probability": 0,
"datetime": "2024-05-25T12:00:00+00:00",
"wind_bearing": 192,
"cloud_coverage": 79,
"temperature": 14.2,
"pressure": 1021,
"wind_speed": 18.65,
"precipitation": 0,
"humidity": 64
},
{
"condition": "cloudy",
"precipitation_probability": 0,
"datetime": "2024-05-25T15:00:00+00:00",
"wind_bearing": 217,
"cloud_coverage": 100,
"temperature": 14.5,
"pressure": 1020,
"wind_speed": 17.53,
"precipitation": 0,
"humidity": 68
},
{
"condition": "cloudy",
"precipitation_probability": 0,
"datetime": "2024-05-25T18:00:00+00:00",
"wind_bearing": 200,
"cloud_coverage": 100,
"temperature": 13.6,
"pressure": 1021,
"wind_speed": 12.35,
"precipitation": 0,
"humidity": 82
},
{
"condition": "rainy",
"precipitation_probability": 20,
"datetime": "2024-05-25T21:00:00+00:00",
"wind_bearing": 191,
"cloud_coverage": 78,
"temperature": 11.1,
"pressure": 1022,
"wind_speed": 9.47,
"precipitation": 0.12,
"humidity": 91
},
{
"condition": "cloudy",
"precipitation_probability": 0,
"datetime": "2024-05-26T00:00:00+00:00",
"wind_bearing": 177,
"cloud_coverage": 89,
"temperature": 10.5,
"pressure": 1022,
"wind_speed": 8.57,
"precipitation": 0,
"humidity": 89
},
{
"condition": "cloudy",
"precipitation_probability": 0,
"datetime": "2024-05-26T03:00:00+00:00",
"wind_bearing": 173,
"cloud_coverage": 100,
"temperature": 9.9,
"pressure": 1022,
"wind_speed": 8.14,
"precipitation": 0,
"humidity": 91
},
{
"condition": "cloudy",
"precipitation_probability": 0,
"datetime": "2024-05-26T06:00:00+00:00",
"wind_bearing": 174,
"cloud_coverage": 89,
"temperature": 10.9,
"pressure": 1023,
"wind_speed": 8.39,
"precipitation": 0,
"humidity": 90
},
{
"condition": "cloudy",
"precipitation_probability": 0,
"datetime": "2024-05-26T09:00:00+00:00",
"wind_bearing": 188,
"cloud_coverage": 81,
"temperature": 12.9,
"pressure": 1024,
"wind_speed": 13.32,
"precipitation": 0,
"humidity": 82
},
{
"condition": "cloudy",
"precipitation_probability": 0,
"datetime": "2024-05-26T12:00:00+00:00",
"wind_bearing": 190,
"cloud_coverage": 59,
"temperature": 17.2,
"pressure": 1024,
"wind_speed": 15.88,
"precipitation": 0,
"humidity": 69
},
{
"condition": "rainy",
"precipitation_probability": 69,
"datetime": "2024-05-26T15:00:00+00:00",
"wind_bearing": 209,
"cloud_coverage": 65,
"temperature": 18,
"pressure": 1023,
"wind_speed": 15.19,
"precipitation": 0.42,
"humidity": 71
}
]
So I seem to have data on a 3 hourly basis from that provider, perhaps I can get it elsewhere for each hour. But assume can work on these data points anyway