2018-02-18 00:58:45 +00:00
#-------------------------------------------
# # @CCOSTAN
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
2020-07-02 18:50:39 +00:00
## Garadget_Stuff - [Garadget](https://amzn.to/2jQLpVQ) - Garage Door opener/sensor
2019-03-05 21:26:54 +00:00
# Video and Write Up - https://www.vcloudinfo.com/2019/03/how-to-add-garadget-to-home-assistant.html
2020-05-03 22:12:24 +00:00
# Switch to Access_Tokens - https://www.vcloudinfo.com/2020/05/fixing-garadget-in-home-assistant.html
2018-02-18 00:58:45 +00:00
#-------------------------------------------
cover :
2020-07-05 17:12:31 +00:00
- platform : mqtt
name : "Small Garage Door"
2020-07-05 17:24:27 +00:00
device_class : 'garage'
2020-07-05 17:38:52 +00:00
command_topic : "garadget/GSmall/command"
state_topic : "garadget/GSmall/status"
2020-07-05 17:49:46 +00:00
value_template : >-
{% if value_json.status == 'closed' %}
closed
{% else %}
open
{% endif %}
2020-07-05 17:12:31 +00:00
payload_open : "open"
payload_close : "close"
payload_stop : "stop"
- platform : mqtt
name : "Large Garage Door"
2020-07-05 17:24:27 +00:00
device_class : 'garage'
2020-07-05 17:38:52 +00:00
command_topic : "garadget/GLarge/command"
state_topic : "garadget/GLarge/status"
2020-07-05 17:49:46 +00:00
value_template : >-
{% if value_json.status == 'closed' %}
closed
{% else %}
open
{% endif %}
2020-07-05 17:12:31 +00:00
payload_open : "open"
payload_close : "close"
payload_stop : "stop"
2020-07-05 18:33:50 +00:00
sensor :
- platform : mqtt
name : "Large Garage Door Since"
state_topic : "garadget/GLarge/status"
value_template : '{{ value_json.time }}'
2020-07-16 17:08:35 +00:00
2020-07-18 22:11:18 +00:00
- platform : mqtt
name : "Large Garage Door Brightness"
state_topic : "garadget/GLarge/status"
unit_of_measurement : '%'
value_template : '{{ value_json.bright }}'
2020-07-05 18:33:50 +00:00
- platform : mqtt
name : "Small Garage Door Since"
state_topic : "garadget/GSmall/status"
value_template : '{{ value_json.time }}'
2020-07-18 22:11:18 +00:00
- platform : mqtt
name : "Small Garage Door Brightness"
state_topic : "garadget/GSmall/status"
unit_of_measurement : '%'
value_template : '{{ value_json.bright }}'
2018-02-18 00:58:45 +00:00
group :
2020-07-03 23:19:35 +00:00
garage_doors : # This group is used to check if doors are open or Closed.
2020-02-25 00:52:57 +00:00
name : Garage Doors
entities :
2020-07-05 17:24:27 +00:00
- cover.large_garage_door
- cover.small_garage_door
2018-02-18 00:58:45 +00:00
2020-06-08 15:27:11 +00:00
######################################################################
## Garage Status Announcements - Only during normal hours.
######################################################################
2018-02-18 00:58:45 +00:00
automation :
2020-07-05 18:09:10 +00:00
- alias : 'Update Garage Get-Status'
2020-07-20 18:33:03 +00:00
id : 2b9e8359-c189-4399-b415-50107513fe90
2018-02-18 00:58:45 +00:00
trigger :
2019-02-23 23:03:43 +00:00
- platform : time_pattern
2020-07-05 17:12:31 +00:00
minutes : '/1'
2018-02-18 00:58:45 +00:00
action :
- service : mqtt.publish
data :
2020-07-05 17:38:52 +00:00
topic : "garadget/GSmall/command"
2018-02-18 00:58:45 +00:00
payload : "get-status"
2020-07-18 22:39:55 +00:00
2018-02-18 00:58:45 +00:00
- service : mqtt.publish
data :
2020-07-05 17:38:52 +00:00
topic : "garadget/GLarge/command"
2018-02-18 00:58:45 +00:00
payload : "get-status"
2020-06-08 15:27:11 +00:00
- alias : 'Garage Door State Change'
2020-07-20 18:33:03 +00:00
id : afec0987-edb1-4341-a524-a00ae4df9fb7
2020-06-08 15:27:11 +00:00
trigger :
- platform : state
entity_id :
2020-07-05 18:09:10 +00:00
- cover.large_garage_door
- cover.small_garage_door
2020-06-08 15:27:11 +00:00
from : 'open'
to : 'closed'
for : '00:02:00'
- platform : state
entity_id :
2020-07-05 18:09:10 +00:00
- cover.large_garage_door
- cover.small_garage_door
2020-06-08 15:27:11 +00:00
from : 'closed'
to : 'open'
for : '00:02:30'
action :
2020-09-26 14:52:45 +00:00
# - service: >
2020-06-08 15:27:11 +00:00
# {% set hour=states("sensor.time").split(':')[0] | int %}
# {% if hour >= 7 and hour <= 9 and states.input_boolean.school_mode.state == 'on'%}
# input_boolean.turn_off
# {% else %}
# input_boolean.turn_on
# {% endif %}
# entity_id: input_boolean.alert_mode
- service : script.speech_engine
2020-09-26 14:52:45 +00:00
data :
2020-06-08 15:27:11 +00:00
DoorClosed : "The {{ trigger.entity_id.split('.')[1]|replace('_', ' ') }} is now {{ (trigger.to_state.state)|replace('_', ' ') }}."
call_garage_check : 1
###################################
## Garadget Wind Door Checks - [Garadget](https://amzn.to/2jQLpVQ)
###################################
- alias : 'Wind Speed Garage Door Check'
2020-07-20 18:33:03 +00:00
id : 2819207a-1716-4552-be34-a8e0f7af004e
2020-06-08 15:27:11 +00:00
trigger :
- platform : numeric_state
entity_id : sensor.dark_sky_wind_speed
above : 20
condition :
- condition : or
conditions :
2020-07-05 18:09:10 +00:00
- condition : state
entity_id : cover.large_garage_door
state : 'opened'
- condition : state
entity_id : cover.small_garage_door
state : 'opened'
2020-06-08 15:27:11 +00:00
action :
- service : input_boolean.turn_on
entity_id : input_boolean.alert_mode
- service : script.notify_engine
2020-09-26 14:52:45 +00:00
data :
2020-06-08 15:27:11 +00:00
title : 'Check/Close Garage Doors - High Speed Wind Alert:'
2020-07-05 18:09:10 +00:00
value1 : "Small: {{ states('cover.small_garage_door')}}"
value2 : "Large: {{ states('cover.large_garage_door')}}"
2020-06-08 15:27:11 +00:00
apns_id : 'information'
who : 'parents'
- service : script.speech_engine
2020-09-26 14:52:45 +00:00
data :
2020-06-08 15:27:11 +00:00
value1 : >
"The winds are picking up outside. The wind speed is {{ states('sensor.dark_sky_wind_speed')|round}} miles per hour. For safety, please close the garage doors.
2020-07-05 18:09:10 +00:00
{% if is_state('cover.large_garage_door', 'open') -%}
2020-06-08 15:27:11 +00:00
The Large Garage Door is open
{% endif -%}
2020-07-05 18:09:10 +00:00
{% if is_state('cover.small_garage_door', 'open') -%}
{% if is_state('cover.large_garage_door', 'open') -%}and
2020-06-08 15:27:11 +00:00
{%- endif %} The small Garage Door is open.
{% endif %}"
- service : script.tweet_engine_image
2020-09-26 14:52:45 +00:00
data :
2020-06-08 15:27:11 +00:00
tweet : >
{{ [
"Wind speed is {{ states('sensor.dark_sky_wind_speed')|round}} miles per hour. For safety, I'm going to close the @garadget doors." ,
"Getting pretty windy! {{ states('sensor.dark_sky_wind_speed')|round}}MPH. Time to ask @Garadget to close the garage doors."
2020-07-02 18:50:39 +00:00
] | random + "(https://amzn.to/2jQLpVQ)"}}
2020-06-08 15:27:11 +00:00
image : >-
{{ [
"/config/www/custom_ui/floorplan/images/branding/windy.png"
] | random }}
2020-07-03 23:19:35 +00:00
##############################################################################
- alias : Is the Garage door Open at night - Checks every 30 minutes or 5 minutes after we drive away.
2020-07-20 18:33:03 +00:00
id : 4eb3e83e-4484-4102-a4ca-6bacd5b3cbdd
2020-07-03 23:19:35 +00:00
trigger :
- platform : time_pattern
minutes : '/45'
- platform : state
entity_id : group.family
to : not_home
for : 00 : 05 : 00
- platform : state
entity_id : input_boolean.tv_time
to : 'on'
from : 'off'
condition :
condition : or
conditions :
- condition : and
conditions :
- condition : state
entity_id : group.family
state : not_home
for : 00 : 05 : 00
- condition : or
conditions :
- condition : template
2020-07-05 18:09:10 +00:00
value_template : "{{ states('cover.large_garage_door') == 'opened' }}"
2020-07-03 23:19:35 +00:00
- condition : template
2020-07-05 18:09:10 +00:00
value_template : "{{ states('cover.small_garage_door') == 'opened' }}"
2020-07-03 23:19:35 +00:00
- condition : and
conditions :
- condition : state
entity_id : sun.sun
state : 'below_horizon'
- condition : or
conditions :
- condition : template
2020-07-05 18:09:10 +00:00
value_template : "{{ states('cover.large_garage_door') == 'opened' }}"
2020-07-03 23:19:35 +00:00
- condition : template
2020-07-05 18:09:10 +00:00
value_template : "{{ states('cover.small_garage_door') == 'opened'}}"
2020-07-03 23:19:35 +00:00
action :
- service : script.notify_engine
2020-09-26 14:52:45 +00:00
data :
2020-07-03 23:19:35 +00:00
title : 'Check Garage Doors:'
2020-07-05 18:09:10 +00:00
value1 : "Small: {{ states('cover.small_garage_door')}}"
value2 : "Large: {{ states('cover.large_garage_door')}}"
2020-07-03 23:19:35 +00:00
who : "family"
camera_entity : "camera.camera2"
apns_id : 'information'
- service : script.speech_engine
2020-09-26 14:52:45 +00:00
data :
2020-07-05 18:09:10 +00:00
value1 : "Please check the garage doors. The Small garage is {{ states('cover.small_garage_door')}} and the large garage is {{ states('cover.large_garage_door')}}"