#Rain condition
1 messages · Page 1 of 1 (latest)
` - service: weather.get_forecasts
target:
entity_id: weather.tomorrow_io_home_daily
data:
type: daily
response_variable: weather_forecast
- variables:
precipitation: >-
{{
weather_forecast["weather.tomorrow_io_home_daily"]["forecast"][0]["precipitation"]
}}
precipitation_probability: >-
{{
weather_forecast["weather.tomorrow_io_home_daily"]["forecast"][0]["precipitation_probability"]
}} - condition: template
value_template: "{{ (precipitation|float) * (precipitation_probability|float) < 25 }}"`
hope this helps the next person
you don't need float there
you can alsomake it easier on yourself by making use of dictionaries
- service: weather.get_forecasts
target:
entity_id: weather.tomorrow_io_home_daily
data:
type: daily
response_variable: weather_forecast
- variables:
today: "{{ weather_forecast["weather.tomorrow_io_home_daily"]["forecast"][0] }}"
- condition: template
value_template: "{{ today.precipitation * today.precipitation_probability < 25 }}"