diff --git a/packages/custom_weather.yaml b/packages/custom_weather.yaml index a1e74fc..397d427 100644 --- a/packages/custom_weather.yaml +++ b/packages/custom_weather.yaml @@ -75,6 +75,19 @@ template: device_class: safety attributes: current_strikes: "{{ states('sensor.blitzortung_lightning_counter') | int }}" + - name: Precipitation + unique_id: 2423f8c6-f9ce-4063-a7f8-30dc260d1376 + state: "{{ states('weather.iron_nerd_weather_station') in ['rainy','thunderstorm','lightning','sleet','snow','snowy','hail','tornado'] }}" + attributes: + type_of_precipitation: > + {% if states('weather.iron_nerd_weather_station') in ['rainy','thunderstorm','lightning','hail','tornado'] %} + Rain + {% elif states('weather.iron_nerd_weather_station') in ['sleet','snow','snowy'] %} + Snow + {% else %} + N/A + {% endif %} + icon: mdi:water sensor: - platform: weatheralerts diff --git a/template.yaml b/template.yaml index c983b96..b768f1e 100644 --- a/template.yaml +++ b/template.yaml @@ -1,13 +1,4 @@ binary_sensor: - name: People Present state: > - {{ is_state('person.tony_stork', 'home') or is_state('person.christina_stork', 'home') }} - - - name: Precipitation - state: >- - {% if states.weather.iron_nerd_weather_station.state in ['rainy','thunderstorm','lightning','sleet','snow','snowy','hail'] %} - true - {% else %} - false - {% endif %} - icon: mdi:water \ No newline at end of file + {{ is_state('person.tony_stork', 'home') or is_state('person.christina_stork', 'home') }} \ No newline at end of file