denysdovhan / ha-check-weather

🌤️ A simple binary sensor for Home Assistant that checks the weather for the next hours and turns on when it fits certain conditions
MIT License
40 stars 3 forks source link

I'm not clear on how to create this sensor only on upcoming rain forecast. #21

Open deepcoder opened 1 month ago

deepcoder commented 1 month ago

I'm not clear on how to create this sensor only on upcoming rain forecast.

☔️ Will it Rain – check if it will rain today.

The configuration screen for the integration includes temperature and wind in addition to rain. How to I create a sensor for only rain forecast?

Thank you for your work on this project!

denysdovhan commented 1 month ago

The sensor automatically checks current conditions agains this list of bad conditions:

https://github.com/denysdovhan/ha-check-weather/blob/main/custom_components/check_weather/binary_sensor.py#L66-L74

I can work on feature for manual selection of desired conditions. I should be hard to implement.

deepcoder commented 1 month ago

Thanks again for you work on this project!

Just to make sure I am clear, I would like to be able to get a binary sensor for a subset of the conditions you show, in my use case, just rain above a given level, no check of temperature or wind. Perhaps picture below will give you some ideas of my interest :

subset-check
TheoAstro commented 1 month ago

@deepcoder

You can make a template like:

{% set rain = state_attr('binary_sensor.check_weather', 'precipitation') %} {% if rain == true%} {% set neerslag= 'Het gaat vandaag regenen' %} {% else %} {% set neerslag= "Als het goed is blijft het vandaag droog!" %} {% endif %} {{neerslag}}