Swaping out Darksky for NWS....
This commit is contained in:
parent
0e3f774d43
commit
a494704e36
|
@ -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
|
||||
|
|
|
@ -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,9 +450,12 @@ script:
|
|||
|
||||
{% endif %}
|
||||
|
||||
|
||||
|
||||
{% endmacro %}
|
||||
|
||||
{% macro weather_alerts() %}
|
||||
{% 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 %}
|
||||
|
@ -459,6 +471,7 @@ script:
|
|||
{% else %}
|
||||
a {{ states.sensor.nws_alerts.attributes.spoken_desc.split('\n\n-\n\n')[0] }}.
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro todays_events() %}
|
||||
|
@ -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 <emphasis>you</emphasis>',
|
||||
|
@ -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,12 +1062,17 @@ 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 ******** #}
|
||||
{# ********************************************* #}
|
||||
|
||||
{# a macro to call all macros :) #}
|
||||
{%- macro mother_of_all_macros() -%}
|
||||
{% if call_greeting == 1 %}
|
||||
{{ greeting() }}
|
||||
{% endif %}
|
||||
|
@ -1221,7 +1252,9 @@ script:
|
|||
{% 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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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}}"
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -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 %}
|
Loading…
Reference in New Issue