From f3f2cf15f29af84bf330a7bdab7732d3319daa6f Mon Sep 17 00:00:00 2001 From: Jeffrey Stone Date: Mon, 6 Apr 2020 19:12:51 -0400 Subject: [PATCH] Tweaking the weather sensors --- config/sensors/weather.yaml | 44 ++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/config/sensors/weather.yaml b/config/sensors/weather.yaml index 37b9133..0b97b09 100755 --- a/config/sensors/weather.yaml +++ b/config/sensors/weather.yaml @@ -38,9 +38,11 @@ - platform: mqtt name: "Accurite Back Porch Temperature" state_topic: "house/accurite-158/temperature" + device_class: temperature - platform: mqtt name: "Accurite Back Porch Humidity" state_topic: "house/accurite-158/humidity" + # - platform: mqtt # name: "Accurite Back Porch Status" # state_topic: "house/accurite-158/status" @@ -56,6 +58,7 @@ - platform: mqtt name: "Accurite Garage Temperature" state_topic: "house/accurite-10968/temperature" + device_class: temperature - platform: mqtt name: "Accurite Garage Humidity" state_topic: "house/accurite-10968/humidity" @@ -94,9 +97,14 @@ nws_current_forecast: friendly_name: 'Current Forecast' value_template: "{{ states.weather.klzu.attributes.forecast[0].detailed_description }}" + nws_current_rain_forecast: + friendly_name: 'Current Rain Forecast' + value_template: "{{ states.weather.klzu.attributes.forecast[0].precipitation_probability }}" + unit_of_measurement: '%' nws_current_temperature: friendly_name: 'Current Temperature' value_template: "{{ states.weather.klzu.attributes.temperature }}" + device_class: temperature nws_daytime_temperature: friendly_name: 'Daytime Temperature' value_template: >- @@ -105,7 +113,8 @@ {% elif states.weather.klzu.attributes.forecast[1].daytime == True %} {{ states.weather.klzu.attributes.forecast[1].temperature }} {% endif %} - nws_current_condition: + device_class: temperature + nws_current_condition: friendly_name: 'Current Condition' value_template: "{{ states.weather.klzu.state }}" nws_current_humidity: @@ -137,14 +146,39 @@ {% elif states.weather.klzu.attributes.forecast[2].daytime == False %} {{ states.weather.klzu.attributes.forecast[2].detailed_description }} {% endif %} - nws_future_forecast: - friendly_name: "Future Forecast" + nws_forecast_tomorrow: + friendly_name: "Forecast Tomorrow" unit_of_measurement: '' value_template: >- {%- if states.weather.klzu.attributes.forecast[1].daytime == True %} {{ states.weather.klzu.attributes.forecast[1].detailed_description }} - before becoming {{ states.weather.klzu.attributes.forecast[2].detailed_description }} tomorrow night {% elif states.weather.klzu.attributes.forecast[2].daytime == True %} {{ states.weather.klzu.attributes.forecast[2].detailed_description }} - before becoming {{ states.weather.klzu.attributes.forecast[3].detailed_description }} tomorrow night + {%- endif %} + nws_forecast_rain_tomorrow: + friendly_name: "Rain Chance Tomorrow" + unit_of_measurement: '%' + value_template: >- + {%- if states.weather.klzu.attributes.forecast[1].daytime == True %} + {{ states.weather.klzu.attributes.forecast[1].precipitation_probability }} + {% elif states.weather.klzu.attributes.forecast[2].daytime == True %} + {{ states.weather.klzu.attributes.forecast[2].precipitation_probability }} + {%- endif %} + nws_forecast_tomorrow_night: + friendly_name: "Forecast Tomorrow Night" + unit_of_measurement: '' + value_template: >- + {%- if states.weather.klzu.attributes.forecast[1].daytime == True %} + {{ states.weather.klzu.attributes.forecast[2].detailed_description }} + {% elif states.weather.klzu.attributes.forecast[2].daytime == True %} + {{ states.weather.klzu.attributes.forecast[3].detailed_description }} + {%- endif %} + nws_forecast_rain_tomorrow_night: + friendly_name: "Rain Chance Tomorrow Night" + unit_of_measurement: '%' + value_template: >- + {%- if states.weather.klzu.attributes.forecast[1].daytime == True %} + {{ states.weather.klzu.attributes.forecast[2].precipitation_probability }} + {% elif states.weather.klzu.attributes.forecast[2].daytime == True %} + {{ states.weather.klzu.attributes.forecast[3].precipitation_probability }} {%- endif %} \ No newline at end of file