Compare commits
2 Commits
c94cf5d75a
...
b61bfb588e
Author | SHA1 | Date |
---|---|---|
CCOSTAN | b61bfb588e | |
CCOSTAN | 7c1023ad15 |
|
@ -0,0 +1,47 @@
|
||||||
|
#-------------------------------------------
|
||||||
|
# @CCOSTAN
|
||||||
|
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
|
||||||
|
#-------------------------------------------
|
||||||
|
# Waze Travel Time Sensor
|
||||||
|
# https://github.com/CCOSTAN/Home-AssistantConfig/issues/1463
|
||||||
|
#-------------------------------------------
|
||||||
|
# Mag Safe Phone Holders - https://amzn.to/4bDBBJf
|
||||||
|
#-------------------------------------------
|
||||||
|
##############################################################################
|
||||||
|
### Automations - Warn us when there is traffic to/from work.
|
||||||
|
### There is also a Speech Macro with this.
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
automation:
|
||||||
|
|
||||||
|
- alias: "Check on Traffic to Spectrum"
|
||||||
|
id: 7dcfc6aa-5abc-460b-b783-609748ed56d7
|
||||||
|
trigger:
|
||||||
|
- platform: numeric_state
|
||||||
|
entity_id: sensor.waze_travel_time
|
||||||
|
above: 34
|
||||||
|
|
||||||
|
condition:
|
||||||
|
- condition: or
|
||||||
|
conditions:
|
||||||
|
- condition: time
|
||||||
|
after: '08:00:00'
|
||||||
|
before: '09:30:00'
|
||||||
|
- condition: time
|
||||||
|
after: '17:30:00'
|
||||||
|
before: '18:30:00'
|
||||||
|
|
||||||
|
action:
|
||||||
|
- service: script.notify_engine
|
||||||
|
data:
|
||||||
|
value1: 'There is traffic on the Spectrum Route'
|
||||||
|
value2: "Reported Time is : {{ states.sensor.waze_travel_time.state }} minutes"
|
||||||
|
who: 'family'
|
||||||
|
|
||||||
|
- service: input_boolean.turn_on
|
||||||
|
entity_id: input_boolean.alert_mode
|
||||||
|
|
||||||
|
- service: script.speech_engine
|
||||||
|
data:
|
||||||
|
value1: "Attention! Traffic on the Spectrum Route for Justins job. Estimated travel time right now is {{ states.sensor.waze_travel_time.state }} minutes. Beep beep! [If you think this could be weather related, mention that as well]"
|
||||||
|
call_outside_weather: 1
|
|
@ -168,18 +168,6 @@
|
||||||
[Include an inspirational quote relevant to the day or situation at the end of the message. "]
|
[Include an inspirational quote relevant to the day or situation at the end of the message. "]
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
{% macro justin_work() %}
|
|
||||||
{% set current_hour = now().hour %}
|
|
||||||
{% set current_minute = now().minute %}
|
|
||||||
{% set waze_travel_time = states('sensor.waze_travel_time') | int %}
|
|
||||||
|
|
||||||
{% if (8 <= current_hour <= 9 and current_minute <= 30) or (17 <= current_hour <= 18 and current_minute <= 30) %}
|
|
||||||
{% if waze_travel_time => 35 %}
|
|
||||||
[This message is IMPORTANT] There is traffic on the route to take justin to work. The current travel time is {{ waze_travel_time }} minutes.
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
{% endmacro %}
|
|
||||||
|
|
||||||
{% macro fact_of_the_day() %}
|
{% macro fact_of_the_day() %}
|
||||||
[Include a fact about something that happened in the past on this day at the end of the message]
|
[Include a fact about something that happened in the past on this day at the end of the message]
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
@ -268,7 +256,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{# call a Random fact about the house or inspiration quote #}
|
{# call a Random fact about the house or inspiration quote #}
|
||||||
{{ ([justin_work, iss, moon, uv, holiday, days_until, outside_weather, outside_weather, inspirational_quote, fact_of_the_day]|random)() }}
|
{{ ([iss, moon, uv, holiday, days_until, outside_weather, outside_weather, inspirational_quote, fact_of_the_day]|random)() }}
|
||||||
|
|
||||||
{%- endmacro -%}
|
{%- endmacro -%}
|
||||||
{{- cleanup(mother_of_all_macros()) -}}
|
{{- cleanup(mother_of_all_macros()) -}}
|
||||||
|
|
Loading…
Reference in New Issue