Updated to 0.107.3 and minor changes.

This commit is contained in:
Mahasri Kalavala
2020-03-20 21:25:56 -04:00
parent 2f63af22c8
commit 59375f1665
8 changed files with 134 additions and 149 deletions

View File

@@ -403,6 +403,9 @@ automation:
- service: script.voice_notify
data_template:
message: "{{ trigger.to_state.attributes.friendly_name.split(' ')[1] }}'s phone battery is : {{ trigger.to_state.attributes.battery }}%."
- service: script.led_message
data_template:
message: "{{ trigger.to_state.attributes.friendly_name.split(' ')[1] }}'s phone battery is : {{ trigger.to_state.attributes.battery }}%."
- alias: Alert Low Battery
trigger:
@@ -419,12 +422,16 @@ automation:
- service: script.voice_notify
data_template:
message: >
{% set ns = namespace(lowBattery) %}
{% set ns = namespace(lowBattery="") %}
{%- for x in states if x.attributes and x.attributes.battery_level and x.attributes.battery_level |int <= 24 %}
{%- if loop.first %}The {% elif loop.last %} and the {% else %}, the {% endif -%}
{% set ns.lowBattery = ns.lowBattery ~ ',' ~ x.name %}
{%- endfor %}
{{ ns.lowBattery -}}
{{- ' battery is ' if ns.lowBattery.split(',')|count == 1 else ' batteries are ' -}} less than 25 percent.
{{- ' battery is ' if ns.lowBattery.split(',')|count == 2 else ' batteries are ' -}} less than 25 percent.
- service: script.led_message
data_template:
message: "{{ trigger.to_state.attributes.friendly_name.split(' ')[1] }}'s phone battery is : {{ trigger.to_state.attributes.battery }}%."
# ###############################################################################
# # Automation: Notify of Sensor's Low Battery

View File

@@ -849,3 +849,16 @@ automation:
data_template:
url: !secret frontdoor_camera_stream_url
name: "frontyard"
#
# Every 15 minutes, change stream to alternate view
#
- alias: Reset Stream On Chromecast
trigger:
- platform: time_pattern
minutes: "/15"
action:
- service: script.stream2chromecast
data_template:
url: !secret driveway_camera_stream_url
name: "driveway"

View File

@@ -1,4 +1,23 @@
homeassistant:
customize:
package.door_sensors:
door_notification_script: &door_notification_script
message: >
{% set doors = "" %}
{% if states('binary_sensor.two_car_garage_door_tilt_sensor_sensor') == "on" and
states('binary_sensor.single_car_garage_door_tilt_sensor_sensor') == "on" %}
{% set doors = "Attention! Both Garage Doors are OPEN" %}
{% elif states('binary_sensor.two_car_garage_door_tilt_sensor_sensor') == "off" and
states('binary_sensor.single_car_garage_door_tilt_sensor_sensor') == "off" %}
{% set doors = "Both Garage Doors are now CLOSED" %}
{% else %}
{% if trigger.to_state.state | lower == "on" %}
Attention! Your {{ trigger.to_state.attributes.friendly_name }} is now OPENED!
{% elif trigger.to_state.state | lower == "off" %}
Your {{ trigger.to_state.attributes.friendly_name }} is now CLOSED!
{% endif %}
{% endif %}
{{ doors }}
sensor:
- platform: template
@@ -158,24 +177,12 @@ automation:
{% elif trigger.to_state.state | lower == "off" %}
{{ trigger.to_state.attributes.friendly_name }} is now CLOSED!
{% endif %}
- service: script.led_message
data_template:
<<: *door_notification_script
- service: script.voice_notify
data_template:
message: >
{% set doors = "" %}
{% if states('binary_sensor.two_car_garage_door_tilt_sensor_sensor') == "on" and
states('binary_sensor.single_car_garage_door_tilt_sensor_sensor') == "on" %}
{% set doors = "Attention! Both Garage Doors are OPEN" %}
{% elif states('binary_sensor.two_car_garage_door_tilt_sensor_sensor') == "off" and
states('binary_sensor.single_car_garage_door_tilt_sensor_sensor') == "off" %}
{% set doors = "Both Garage Doors are now CLOSED" %}
{% else %}
{% if trigger.to_state.state | lower == "on" %}
Attention! Your {{ trigger.to_state.attributes.friendly_name }} is now OPENED!
{% elif trigger.to_state.state | lower == "off" %}
Your {{ trigger.to_state.attributes.friendly_name }} is now CLOSED!
{% endif %}
{% endif %}
{{ doors }}
<<: *door_notification_script
- delay: "00:00:05"
- service: camera.snapshot
data_template:
@@ -248,6 +255,14 @@ automation:
{% else %}
yes
{% endif %}
- service: script.led_message
data_template:
message: >
{% if trigger.to_state.state | lower == "on" %}
Your {{ trigger.to_state.attributes.friendly_name.replace('Sensor', '') -}} is OPEN.
{% else %}
Your {{ trigger.to_state.attributes.friendly_name.replace('Sensor', '') -}} is CLOSED.
{% endif %}
- alias: When Front Door Opens Turn Front Room Lights ON
initial_state: true

View File

@@ -118,7 +118,7 @@ automation:
- condition: template
value_template: "{{ states('alarm_control_panel.home') != 'disarmed' }}"
- service: input_boolean.turn_on
entity_id: input_boolean.notify_camera_motion
entity_id: input_boolean.notify_camera_alerts
###############################################################################
# A gentle 10 minute reminder that the Home Security system is OFF

View File

@@ -67,7 +67,7 @@ script:
sequence:
- service: script.all_indoor_lights_off
- service: input_boolean.turn_on
entity_id: input_boolean.notify_camera_motion
entity_id: input_boolean.notify_camera_alerts
- service: climate.set_away_mode
data:
entity_id: climate.dining_room
@@ -426,8 +426,7 @@ script:
- service: mqtt.publish
data_template:
topic: messageboard/messages
payload: >
{ 'message': '{{ message }}','frameDelay': 50 }
payload: "{{ message }}"
###############################################################################
# Notifies to take pills, starts timer again!

View File

@@ -35,13 +35,14 @@ automation:
entity_id: input_boolean.working_in_garage
# Garage:
# Keeps and eye on the garage door... reminds me to close after 5 min
# Keeps and eye on the garage doors... reminds me to close after 5 min
###############################################################################
- alias: Single Car garage Door WatchDog
- alias: Two Car garage Door WatchDog
initial_state: true
trigger:
- platform: state
entity_id:
- binary_sensor.two_car_garage_door_tilt_sensor_sensor
- binary_sensor.single_car_garage_door_tilt_sensor_sensor
to: "on"
for:
@@ -54,46 +55,27 @@ automation:
value_template: "{{ states('input_boolean.garage_door_notifications') == 'on' }}"
action:
- service: script.notify_me
data:
message: "Single Car Garage Door is OPEN for more than 5 minutes!"
data_template:
message: >
Your {{ trigger.to_state.attributes.friendly_name }} is OPEN for more than 5 minutes!
- service: script.voice_notify
data_template:
message: "Attention! Your single car garage door is open for more than 5 minutes."
message: >
Attention! Your {{ trigger.to_state.attributes.friendly_name }} is open for more than 5 minutes.
- service: scipt.led_notify
data_template:
message: >
Your {{ trigger.to_state.attributes.friendly_name }} is OPEN for more than 5 minutes!
# Garage:
# Keeps and eye on the garage door... reminds me to close after 5 min
# Outdoor Lights:
# Keeps and eye on the patio and backyard lights...
###############################################################################
- alias: Two Car garage Door WatchDog
initial_state: true
trigger:
- platform: state
entity_id:
- binary_sensor.two_car_garage_door_tilt_sensor_sensor
to: "on"
for:
minutes: 5
condition:
- condition: state
entity_id: input_boolean.working_in_garage
state: "off"
- condition: template
value_template: "{{ states('input_boolean.garage_door_notifications') == 'on' }}"
action:
- service: script.notify_me
data:
message: "Your Two Car Garage Door is OPEN for more than 5 minutes!"
- service: script.voice_notify
data_template:
message: "Attention! Your two car garage door is open for more than 5 minutes."
# Front Yard:
# Keeps and eye on the front porch lights...
###############################################################################
- alias: Frontyard Light WatchDog
- alias: Outdoor Light WatchDog
initial_state: true
trigger:
- platform: state
entity_id:
- switch.wemobackyardlightswitch
- switch.frontyard_light
to: "on"
for:
@@ -111,78 +93,46 @@ automation:
message: >
{{ trigger.to_state.attributes.friendly_name }} is ON during the day time. Saving power by turning it off!
# Back Yard:
# Keeps and eye on the patio lights...
# General Watch Dog automation:
# Keeps and eye on the lights & switches, turns off after 10 PM if they are on.
###############################################################################
- alias: Backyard Light WatchDog
initial_state: true
trigger:
- platform: state
entity_id:
- switch.wemobackyardlightswitch
to: "on"
for:
minutes: 5
condition:
- condition: state
entity_id: sun.sun
state: "above_horizon"
action:
- service: switch.turn_off
data_template:
entity_id: "{{ trigger.entity_id }}"
- service: script.notify_me
data_template:
message: >
{{ trigger.to_state.attributes.friendly_name }} is ON during the day time. Saving power by turning it off!
# Guest Bedroom:
# Keeps and eye on the Guest Bedroom 1 lights...
###############################################################################
- alias: Guest Bedroom 1 Light WatchDog
- alias: Lights And Switches WatchDog
initial_state: true
trigger:
- platform: state
entity_id:
- switch.basement_left
- switch.basement_right
- switch.bathroom_fragrance
- switch.downstairs_fragrance
- switch.front_room
- switch.garage
- switch.guest_bedroom
to: "on"
for:
minutes: 15
action:
- service: switch.turn_off
data_template:
entity_id: "{{ trigger.entity_id }}"
# Guest Bedroom 2:
# Keeps and eye on the Guest Bedroom 2 lights...
###############################################################################
- alias: Guest Bedroom 2 Light WatchDog
initial_state: true
trigger:
- platform: state
entity_id:
- switch.prayer_room
to: "on"
for:
minutes: 10
action:
- service: switch.turn_off
data_template:
entity_id: "{{ trigger.entity_id }}"
# Kids Bedroom:
# Keeps and eye on the Kids Bedroom lights...
###############################################################################
- alias: Kids Bedroom Light WatchDog
initial_state: true
trigger:
- platform: state
entity_id:
- switch.kids_bed_accent
- switch.kids_bedroom
- switch.kitchen
- switch.office_room
- switch.prayer_room
- switch.upstairs_fragrance
- switch.wemoswitch1
- switch.zwave_smart_switch_switch
- light.family_room
- light.family_room_2
- light.gateway_light_34ce008ad65d
- light.hue_color_lamp_1
- light.hue_color_lamp_2
- light.hue_color_lamp_3
- light.master_bedroom
- light.master_bedroom_1
- light.master_bedroom_2
- light.master_bedroom_3
to: "on"
for:
minutes: 10
condition:
- condition: template
value_template: "{{ now().hour |int > 22 }}"
action:
- service: switch.turn_off
- service: homeassistant.turn_off
data_template:
entity_id: "{{ trigger.entity_id }}"