diff --git a/config/configuration.yaml b/config/configuration.yaml index 128eebe..d1a3d00 100644 --- a/config/configuration.yaml +++ b/config/configuration.yaml @@ -45,9 +45,12 @@ wemo: - 192.168.7.99 weather: - - platform: darksky - api_key: !secret darksky_api - name: Grayson + # REMOVING darksky integration since API is EOL in 18 months. Migrated to NWS + # - platform: darksky + # api_key: !secret darksky_api + # name: Grayson + - platform: nws + api_key: !secret nws_api_key conversation: @@ -177,6 +180,7 @@ tplink: - host: 192.168.7.116 - host: 192.168.7.120 - host: 192.168.7.136 + - host: 192.168.7.137 ifttt: key: !secret IFTTT_API_KEY diff --git a/config/packages/notify.yaml b/config/packages/notify.yaml index c0b4713..6fd1c6b 100755 --- a/config/packages/notify.yaml +++ b/config/packages/notify.yaml @@ -64,8 +64,12 @@ automation: initial_state: true trigger: - platform: state - entity_id: media_player.theater + entity_id: media_player.ha_speaker to: 'unavailable' + condition: + - condition: state + entity_id: binary_sensor.day + state: 'on' action: - service: input_boolean.turn_off entity_id: input_boolean.audible_notifications @@ -80,15 +84,20 @@ automation: initial_state: true trigger: - platform: state - entity_id: media_player.theater + entity_id: media_player.ha_speaker from: 'unavailable' to: 'off' + condition: + - condition: state + entity_id: binary_sensor.day + state: 'on' action: - service: script.text_notify data_template: who: "jeff" title: "Audio Issue Cleared" message: "Main hromecast is back on" + - service: script.turn_on_ha_speaker @@ -213,10 +222,10 @@ script: payload: 'This message is from {{ now().strftime("%-I") }}:{{ now().strftime("%M") }} {{ now().strftime("%p") }}. {{ message | truncate(220)}}' retain: true - service: media_player.turn_on - entity_id: media_player.theater + entity_id: media_player.ha_speaker - service: media_player.volume_set data_template: - entity_id: media_player.theater + entity_id: media_player.ha_speaker volume_level: > {% if states.input_boolean.audible_notifications.state == 'on' %} .50 @@ -228,7 +237,7 @@ script: data_template: entity_id: > {% if states.input_boolean.audible_notifications.state == 'on' %} - media_player.theater + media_player.ha_speaker {% else %} media_player.house {% endif %} @@ -292,10 +301,10 @@ script: # - service: switch.turn_on # entity_id: switch.ha_speaker - service: media_player.turn_on - entity_id: media_player.theater + entity_id: media_player.ha_speaker - service: media_player.volume_set data_template: - entity_id: media_player.theater + entity_id: media_player.ha_speaker volume_level: > {% if states.input_boolean.audible_notifications.state == 'on' %} .65 @@ -307,7 +316,7 @@ script: data_template: entity_id: > {% if states.input_boolean.audible_notifications.state == 'on' %} - media_player.theater + media_player.ha_speaker {% else %} media_player.house {% endif %} @@ -441,23 +450,27 @@ script: {% endif %} + + {% endmacro %} {% macro weather_alerts() %} - There are currently {{states.sensor.nws_alerts.state }} active weather alerts for our area. - The National Weather Service Has issued, - {% if states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[5] is defined %} - a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[5] }}. - {% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[4] is defined %} - a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[4] }}. - {% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[3] is defined %} - a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[3] }}. - {% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[2] is defined %} - a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[2] }}. - {% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[1] is defined %} - a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[1] }}. - {% else %} - a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[0] }}. + {% if states.sensor.nws_alerts.state | int > 0 %} + There are currently {{states.sensor.nws_alerts.state }} active weather alerts for our area. + The National Weather Service Has issued, + {% if states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[5] is defined %} + a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[5] }}. + {% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[4] is defined %} + a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[4] }}. + {% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[3] is defined %} + a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[3] }}. + {% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[2] is defined %} + a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[2] }}. + {% elif states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[1] is defined %} + a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[1] }}. + {% else %} + a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[0] }}. + {% endif %} {% endif %} {% endmacro %} @@ -469,7 +482,7 @@ script: Merry Christmas Everyone! {% endif %} {% if is_state('sensor.anniversary_our_wedding','0') %} - Happy Anniversary! It has been an amazing {{ states.sensor.anniversary_our_wedding.attributes.years }} years! + Happy Anniversary! It been an amazing {{ states.sensor.anniversary_our_wedding.attributes.years }} years! {% endif %} {% if is_state('calendar.holidays_in_united_states', 'on') %} Today is {{states.calendar.holidays_in_united_states.attributes.message}}. @@ -492,7 +505,7 @@ script: 'You should tell someone it is ', 'Everyday can be a holiday. So today is ' ]|random }} - {{states.calendar.national_holidays.attributes.message}}. + {{states.calendar.national_holidays.attributes.message | replace("&"," and ") }}. {{ [ 'We should celebrate.', 'I will leave the party planning up to you', @@ -515,8 +528,13 @@ script: ]|random }} {%- endmacro -%} - {% macro current_conditions_outisde() %} - It is currently {{states.sensor.dark_sky_summary.state}} and {{states.sensor.dark_sky_temperature.state|round}} degrees in Grayson. + {% macro current_conditions_outside() %} + {{ [ + 'According to the National Weather Service,', + 'Checking my weather sensors,', + 'Looking outside,' + ]|random }} + It is currently {{states.weather.home_2.state}} and {{states.nws_current_temperature.state|round}} degrees in Grayson. The back porch is {{states.sensor.accurite_back_porch_temperature.state|round}} degrees. {% endmacro %} @@ -536,20 +554,28 @@ script: {% endmacro %} {% macro daily_forecast() %} - The rest of the day should be {{states.sensor.dark_sky_summary_0d.state}} with a high of {{states.sensor.dark_sky_daytime_high_temperature_0d.state|round}} degrees. There is a {{states.sensor.dark_sky_precip_probability_0d.state|round}} percent chance of rain. + {{ [ + 'The National Weather Service says,', + 'According to the latest forecast,' + ]|random }} + The rest of the day should be {{ states.sensor.nws_current_forecast.state }} {% endmacro %} {% macro overnight_forecast() %} - The low tonight will be {{states.sensor.dark_sky_overnight_low_temperature_0d.state | round}} degrees and there is a {{states.sensor.dark_sky_precip_probability_0d.state|round}} percent chance of rain. + {{ [ + 'Tonight we can expect,', + 'According to tonights forecast we can expect,' + ]|random }} + {{ states.sensor.nws_overnight_forecast.state }} {% endmacro %} {% macro future_forecast() %} - {{ [ 'Looking into the future you can expect, ', - ' According to the forecast, there might be ', - 'If you have not seen the forecast, you might want to plan for ' + {{ [ 'Looking into the future plan for tomorrow to be, ', + ' According to tomorrows forecast we can expect it to be, ', + 'If you have not seen tomorrows forecast it is expected to be, ' ] | random }} - {{states.sensor.dark_sky_daily_summary.state}}. + {{states.sensor.nws_future_forecast.state}}. {% endmacro %} {% macro freeze_warning() %} @@ -1036,192 +1062,199 @@ script: ] | random }} {%- endmacro -%} - + {# a macro that removes all newline characters, empty spaces, and returns formatted text #} + {%- macro cleanup(data) -%} + {%- for item in data.split("\n") if item | trim != "" -%} + {{ item | trim }} {% endfor -%} + {%- endmacro -%} {# ********************************************* #} {# ******** Start the Speech routines ******** #} {# ********************************************* #} - - {% if call_greeting == 1 %} - {{ greeting() }} - {% endif %} - - {% if call_confirmation == 1 %} - {{ confirmation() }} - {% endif %} - - {% if call_interuption == 1 %} - {{ interuption() }} - {% endif %} - - {% if call_issue == 1 %} - {{ issue() }} - {% endif %} - - {% if call_morning_greeting == 1 %} - {{ morning_greeting() }} - {% endif %} - - {% if call_evening_greeting == 1 %} - {{ evening_greeting() }} - {% endif %} - - {% if call_time_annc == 1 %} - {{ time_annc() }} - {% endif %} - - {% if states.sensor.nws_alerts.state | int > 0 and call_weather_alerts == 1 %} - {{ weather_alerts() }} - {% endif %} - - {% if call_todays_events == 1 %} - {{ todays_events() }} - {% endif %} - - {% if call_dark_outside == 1 %} - {{ dark_outside() }} - {% endif %} - - {% if call_current_conditions_outside == 1 %} - {{ current_conditions_outside() }} - {% endif %} - - {% if call_current_conditions_inside == 1 %} - {{ current_conditions_inside() }} - {% endif %} - - {% if call_current_conditions_garage == 1 %} - {{ current_conditions_garage() }} - {% endif %} - - {% if call_daily_forecast == 1 %} - {{ daily_forecast() }} - {% endif %} - - {% if call_overnight_forecast == 1 %} - {{ overnight_forecast() }} - {% endif %} - - {% if call_future_forecast == 1 %} - {{ future_forecast() }} - {% endif %} - - {% if call_freeze_warning == 1 %} - {{ freeze_warning() }} - {% endif %} - - {% if call_upcoming_birthdays == 1 %} - {{ upcoming_birthdays() }} - {% endif %} - - {% if call_upcoming_holidays == 1 %} - {{ upcoming_holidays() }} - {% endif %} - - {% if call_upcoming_events == 1 %} - {{ upcoming_events() }} - {% endif %} - - {% if call_skylar_dressed == 1 %} - {{ skylar_dressed() }} - {% endif %} - - {% if call_prebed_routine == 1 %} - {{ prebed_routine() }} - {% endif %} - - {% if call_school_today == 1 %} - {{ school_today() }} - {% endif %} - - {% if call_skylar_events == 1 %} - {{ skylar_events() }} - {% endif %} - - {% if call_clothes_suggestion == 1 %} - {{ clothes_suggestion() }} - {% endif %} - - {% if call_school_holiday == 1 %} - {{ school_holiday() }} - {% endif %} - - {% if call_reminders == 1 %} - {{ reminders() }} - {% endif %} - - {% if call_chores == 1 %} - {{ chores() }} - {% endif %} - - {% if call_door_status == 1 %} - {{ door_status() }} - {% endif %} - - {% if call_garage_door_status == 1 %} - {{ garage_door_status() }} - {% endif %} - - {% if call_jeff_location == 1 %} - {{ jeff_location() }} - {% endif %} - - {% if call_kat_location == 1 %} - {{ kat_location() }} - {% endif %} - - {% if call_jeff_headed_home == 1 %} - {{ jeff_headed_home() }} - {% endif %} - - {% if call_kat_headed_home == 1 %} - {{ kat_headed_home() }} - {% endif %} - - {% if call_traffic_conditions == 1 %} - {{ traffic_conditions() }} - {% endif %} - - {{ usps }} - - {% if call_iss == 1 %} - {{ iss() }} - {% endif %} - - {% if call_full_moon == 1 %} - {% if is_state('sensor.moon', 'full_moon') %} - {{ full_moon() }} + {# a macro to call all macros :) #} + {%- macro mother_of_all_macros() -%} + {% if call_greeting == 1 %} + {{ greeting() }} {% endif %} - {% endif %} - {% if call_security_report == 1 %} - {{ security_report() }} - {% endif %} + {% if call_confirmation == 1 %} + {{ confirmation() }} + {% endif %} - {% if call_washer_needs_emptying == 1 %} - {{ washer_needs_emptying() }} - {% endif %} + {% if call_interuption == 1 %} + {{ interuption() }} + {% endif %} - {% if call_house_party_protocol_enabled == 1 %} - {{ house_party_protocol_enabled() }} - {% endif %} + {% if call_issue == 1 %} + {{ issue() }} + {% endif %} - {% if call_house_party_protocol_disabled == 1 %} - {{ house_party_protocol_disabled() }} - {% endif %} + {% if call_morning_greeting == 1 %} + {{ morning_greeting() }} + {% endif %} - {{ welcome_home }} + {% if call_evening_greeting == 1 %} + {{ evening_greeting() }} + {% endif %} - {{ speech_message }} + {% if call_time_annc == 1 %} + {{ time_annc() }} + {% endif %} - {% if call_snark_door_motion == 1 %} - {{ snark_door_motion() }} - {% endif %} + {% if states.sensor.nws_alerts.state | int > 0 and call_weather_alerts == 1 %} + {{ weather_alerts() }} + {% endif %} - {% if call_snark_door_open == 1 %} - {{ snark_door_open() }} - {% endif %} - + {% if call_todays_events == 1 %} + {{ todays_events() }} + {% endif %} + + {% if call_dark_outside == 1 %} + {{ dark_outside() }} + {% endif %} + + {% if call_current_conditions_outside == 1 %} + {{ current_conditions_outside() }} + {% endif %} + + {% if call_current_conditions_inside == 1 %} + {{ current_conditions_inside() }} + {% endif %} + + {% if call_current_conditions_garage == 1 %} + {{ current_conditions_garage() }} + {% endif %} + + {% if call_daily_forecast == 1 %} + {{ daily_forecast() }} + {% endif %} + + {% if call_overnight_forecast == 1 %} + {{ overnight_forecast() }} + {% endif %} + + {% if call_future_forecast == 1 %} + {{ future_forecast() }} + {% endif %} + + {% if call_freeze_warning == 1 %} + {{ freeze_warning() }} + {% endif %} + + {% if call_upcoming_birthdays == 1 %} + {{ upcoming_birthdays() }} + {% endif %} + + {% if call_upcoming_holidays == 1 %} + {{ upcoming_holidays() }} + {% endif %} + + {% if call_upcoming_events == 1 %} + {{ upcoming_events() }} + {% endif %} + + {% if call_skylar_dressed == 1 %} + {{ skylar_dressed() }} + {% endif %} + + {% if call_prebed_routine == 1 %} + {{ prebed_routine() }} + {% endif %} + + {% if call_school_today == 1 %} + {{ school_today() }} + {% endif %} + + {% if call_skylar_events == 1 %} + {{ skylar_events() }} + {% endif %} + + {% if call_clothes_suggestion == 1 %} + {{ clothes_suggestion() }} + {% endif %} + + {% if call_school_holiday == 1 %} + {{ school_holiday() }} + {% endif %} + + {% if call_reminders == 1 %} + {{ reminders() }} + {% endif %} + + {% if call_chores == 1 %} + {{ chores() }} + {% endif %} + + {% if call_door_status == 1 %} + {{ door_status() }} + {% endif %} + + {% if call_garage_door_status == 1 %} + {{ garage_door_status() }} + {% endif %} + + {% if call_jeff_location == 1 %} + {{ jeff_location() }} + {% endif %} + + {% if call_kat_location == 1 %} + {{ kat_location() }} + {% endif %} + + {% if call_jeff_headed_home == 1 %} + {{ jeff_headed_home() }} + {% endif %} + + {% if call_kat_headed_home == 1 %} + {{ kat_headed_home() }} + {% endif %} + + {% if call_traffic_conditions == 1 %} + {{ traffic_conditions() }} + {% endif %} + + {{ usps }} + + {% if call_iss == 1 %} + {{ iss() }} + {% endif %} + + {% if call_full_moon == 1 %} + {% if is_state('sensor.moon', 'full_moon') %} + {{ full_moon() }} + {% endif %} + {% endif %} + + {% if call_security_report == 1 %} + {{ security_report() }} + {% endif %} + + {% if call_washer_needs_emptying == 1 %} + {{ washer_needs_emptying() }} + {% endif %} + + {% if call_house_party_protocol_enabled == 1 %} + {{ house_party_protocol_enabled() }} + {% endif %} + + {% if call_house_party_protocol_disabled == 1 %} + {{ house_party_protocol_disabled() }} + {% endif %} + + {{ welcome_home }} + + {{ speech_message }} + + {% if call_snark_door_motion == 1 %} + {{ snark_door_motion() }} + {% endif %} + + {% if call_snark_door_open == 1 %} + {{ snark_door_open() }} + {% endif %} + {%- endmacro -%} + + {{- cleanup(mother_of_all_macros()) -}} ############################################################################### # Twitter @@ -1281,7 +1314,7 @@ script: - service: script.ah_report data: call_weather_alerts: 1 - call_current_conditions_outisde: 1 + call_current_conditions_outside: 1 call_current_conditions_inside: 1 call_current_conditions_garage: 1 call_daily_forecast: 1 diff --git a/config/packages/weather_alerts_nws.yaml b/config/packages/weather_alerts_nws.yaml index 259daa1..34e5f2d 100755 --- a/config/packages/weather_alerts_nws.yaml +++ b/config/packages/weather_alerts_nws.yaml @@ -227,7 +227,10 @@ automation: initial_state: 'on' trigger: - platform: numeric_state - entity_id: sensor.dark_sky_overnight_low_temperature_0d + entity_id: sensor.nws_overnight_low + below: 35 + - platform: numeric_state + entity_id: sensor.nws_current_temperature below: 35 condition: - condition: state @@ -241,14 +244,14 @@ automation: initial_state: 'on' trigger: - platform: numeric_state - entity_id: sensor.accurite_back_porch_temperature + entity_id: sensor.nws_overnight_low above: 33 condition: - condition: state entity_id: input_boolean.freeze_warning state: 'on' - condition: numeric_state - entity_id: sensor.dark_sky_overnight_low_temperature_0d + entity_id: sensor.nws_overnight_low above: 35 action: - service: input_boolean.turn_off @@ -276,7 +279,7 @@ automation: - service: script.turn_off entity_id: script.tornado_alarm - service: media_player.media_stop - entity_id: media_player.theater + entity_id: media_player.ha_speaker script: @@ -304,14 +307,14 @@ script: - delay: seconds: 15 - service: media_player.play_media - entity_id: media_player.theater + entity_id: media_player.ha_speaker data: media_content_id: http://192.168.7.40/audio/tornado_alarm.mp3 media_content_type: "music" - delay: seconds: 110 - service: media_player.play_media - entity_id: media_player.theater + entity_id: media_player.ha_speaker data: media_content_id: http://192.168.7.40/audio/tornado_alarm.mp3 media_content_type: "music" diff --git a/config/sensors/house.yaml b/config/sensors/house.yaml index 9cbb35c..636697c 100755 --- a/config/sensors/house.yaml +++ b/config/sensors/house.yaml @@ -1,6 +1,13 @@ +# Sensor to get Flu near you: https://www.home-assistant.io/integrations/flunearyou/ +- platform: flunearyou + +# MQTT Sensor for Washing Machine Status. - platform: mqtt name: "Washer Status" state_topic: "house/washer/status" + +# MQTT Sensor for getting Various COVID-19 Stats. Data is sourced from pythonn scripts scaping +# various COVID data sites running on a secondary machine. - platform: mqtt name: "COVID19 Confirmed" state_topic: "covid/sensor/confirmed" @@ -173,12 +180,24 @@ duration: hours: 24 - platform: statistics - name: Cloud Coverage Stats - entity_id: sensor.dark_sky_cloud_coverage + name: Wind Speed Stats + entity_id: sensor.nws_current_windspeed sampling_size: 500 - platform: statistics name: Visibility Stats - entity_id: sensor.dark_sky_visibility + entity_id: sensor.nws_current_visibility + sampling_size: 500 +- platform: statistics + name: Temperature Stats + entity_id: sensor.nws_current_temperature + sampling_size: 500 +- platform: statistics + name: Humidity Stats + entity_id: sensor.nws_current_humidity + sampling_size: 500 +- platform: statistics + name: Washer Power Stats + entity_id: sensor.washer_power sampling_size: 500 - platform: history_stats name: Cooling Last Month @@ -272,4 +291,3 @@ value_template: "{{states.climate.home.attributes.hvac_action}}" - diff --git a/config/sensors/weather.yaml b/config/sensors/weather.yaml index cc25c4b..37b9133 100755 --- a/config/sensors/weather.yaml +++ b/config/sensors/weather.yaml @@ -1,38 +1,39 @@ -- platform: darksky - api_key: !secret FORCAST_API_KEY - forecast: - - 0 - monitored_conditions: - - summary - - icon - - nearest_storm_distance - - nearest_storm_bearing - - precip_type - - precip_intensity - - precip_probability - - temperature - - temperature_high - - temperature_low - - apparent_temperature - - dew_point - - wind_speed - - wind_bearing - - cloud_cover - - humidity - - pressure - - visibility - - ozone - - minutely_summary - - hourly_summary - - daily_summary - - precip_intensity_max - scan_interval: - # At least one of these must be specified: - days: 0 - hours: 0 - minutes: 5 - seconds: 0 - milliseconds: 0 +# REMOVING Darksky - Commented out to disable. +# - platform: darksky +# api_key: !secret FORCAST_API_KEY +# forecast: +# - 0 +# monitored_conditions: +# - summary +# - icon +# - nearest_storm_distance +# - nearest_storm_bearing +# - precip_type +# - precip_intensity +# - precip_probability +# - temperature +# - temperature_high +# - temperature_low +# - apparent_temperature +# - dew_point +# - wind_speed +# - wind_bearing +# - cloud_cover +# - humidity +# - pressure +# - visibility +# - ozone +# - minutely_summary +# - hourly_summary +# - daily_summary +# - precip_intensity_max +# scan_interval: +# # At least one of these must be specified: +# days: 0 +# hours: 0 +# minutes: 5 +# seconds: 0 +# milliseconds: 0 ## Accurite 158 - Back Porch - platform: mqtt name: "Accurite Back Porch Temperature" @@ -71,18 +72,18 @@ friendly_name: "Clothing Forecast" unit_of_measurement: '' value_template: >- - {%- if states('sensor.dark_sky_daytime_high_temperature_0d')|float > 63 %} - {%- if states('sensor.dark_sky_daytime_high_temperature_0d')|float < 80 %} + {%- if states('sensor.nws_daytime_temperature')|float > 63 %} + {%- if states('sensor.nws_daytime_temperature')|float < 80 %} Nice - {% elif states('sensor.dark_sky_daytime_high_temperature_0d')|float > 95 %} + {% elif states('sensor.nws_daytime_temperature')|float > 95 %} Hot {% else %} Toasty {%- endif %} - {% elif states('sensor.dark_sky_daytime_high_temperature_0d')|float < 64 %} - {%- if states('sensor.dark_sky_daytime_high_temperature_0d')|float < 32 %} + {% elif states('sensor.nws_daytime_temperature')|float < 64 %} + {%- if states('sensor.nws_daytime_temperature')|float < 32 %} Freezing - {% elif states('sensor.dark_sky_daytime_high_temperature_0d')|float > 50 %} + {% elif states('sensor.nws_daytime_temperature')|float > 50 %} Chilly {% else %} Cold @@ -90,3 +91,60 @@ {% else %} Unknown {%- endif %} + nws_current_forecast: + friendly_name: 'Current Forecast' + value_template: "{{ states.weather.klzu.attributes.forecast[0].detailed_description }}" + nws_current_temperature: + friendly_name: 'Current Temperature' + value_template: "{{ states.weather.klzu.attributes.temperature }}" + nws_daytime_temperature: + friendly_name: 'Daytime Temperature' + value_template: >- + {% if states.weather.klzu.attributes.forecast[0].daytime == True %} + {{ states.weather.klzu.attributes.forecast[0].temperature }} + {% elif states.weather.klzu.attributes.forecast[1].daytime == True %} + {{ states.weather.klzu.attributes.forecast[1].temperature }} + {% endif %} + nws_current_condition: + friendly_name: 'Current Condition' + value_template: "{{ states.weather.klzu.state }}" + nws_current_humidity: + friendly_name: 'Current Humidity' + value_template: "{{ states.weather.klzu.attributes.humidity }}" + nws_current_visibility: + friendly_name: "Current Visability" + value_template: "{{ states.weather.klzu.attributes.visibility }}" + nws_current_windspeed: + friendly_name: "Current Windspeed" + value_template: "{{ states.weather.klzu.attributes.wind_speed }}" + nws_overnight_low: + friendly_name: "Overnight Low" + unit_of_measurement: '' + value_template: >- + {% if states.weather.klzu.attributes.forecast[0].daytime == False %} + {{ states.weather.klzu.attributes.forecast[0].temperature }} + {% elif states.weather.klzu.attributes.forecast[1].daytime == False %} + {{ states.weather.klzu.attributes.forecast[1].temperature }} + {% endif %} + nws_overnight_forecast: + friendly_name: "Overnight Forecast" + unit_of_measurement: '' + value_template: >- + {% if states.weather.klzu.attributes.forecast[0].daytime == False %} + {{ states.weather.klzu.attributes.forecast[0].detailed_description }} + {% elif states.weather.klzu.attributes.forecast[1].daytime == False %} + {{ states.weather.klzu.attributes.forecast[1].detailed_description }} + {% 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" + 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 %} \ No newline at end of file