changed notification system

This commit is contained in:
Mahasri Kalavala 2022-12-03 11:28:12 -05:00
parent b9cfeeeea2
commit 20bdf8ed76
21 changed files with 458 additions and 650 deletions

View File

@ -76,8 +76,6 @@ cards:
# - script.home_mode_away # - script.home_mode_away
# - script.home_status # - script.home_status
# - script.led_message # - script.led_message
# - script.notify_me
# - script.notify_me_with_picture
# - script.patio_cam # - script.patio_cam
# - script.patio_camera_text_overlay # - script.patio_camera_text_overlay
# - script.pill_taken # - script.pill_taken

View File

@ -76,9 +76,13 @@ automation:
- condition: template - condition: template
value_template: "{{ trigger.to_state.state | int > 0 and trigger.to_state.state | int < 30 }}" value_template: "{{ trigger.to_state.state | int > 0 and trigger.to_state.state | int < 30 }}"
action: action:
- service: script.notify_me - service: script.notify_family
data_template: data_template:
message: "{{ trigger.entity_id.split('.')[1].split('_')[0] | title }}'s Birthday is only {{ trigger.to_state.state }} days to go!" message: "{{ trigger.entity_id.split('.')[1].split('_')[0] | title }}'s Birthday is only {{ trigger.to_state.state }} days to go!"
notify_options:
- telegram
- tv
- led
############################################################################### ###############################################################################
# Celebrate Birthday!!! # Celebrate Birthday!!!
@ -95,9 +99,14 @@ automation:
- condition: template - condition: template
value_template: "{{ trigger.to_state.state | int == 0 }}" value_template: "{{ trigger.to_state.state | int == 0 }}"
action: action:
- service: script.notify_me - service: script.notify_family
data_template: data_template:
message: "Hurray! Today is {{ trigger.entity_id.split('.')[1].split('_')[0] | title }}'s Birthday!" message: "Hurray! Today is {{ trigger.entity_id.split('.')[1].split('_')[0] | title }}'s Birthday!"
notify_options:
- telegram
- tv
- led
- voice
############################################################################### ###############################################################################
# Announce Happy Birthday message every hour starting 7 am until 9 PM # Announce Happy Birthday message every hour starting 7 am until 9 PM
@ -124,15 +133,13 @@ automation:
- condition: template - condition: template
value_template: "{{ states('input_label.mallika_birthday_days2go') | int == 0 }}" value_template: "{{ states('input_label.mallika_birthday_days2go') | int == 0 }}"
action: action:
- service: script.voice_notify - service: script.notify_family
data_template: data_template:
message: !include ../templates/birthday_wishes.yaml message: !include ../templates/birthday_wishes.yaml
- delay: notify_options:
minutes: 1 - voice
- service: script.voice_notify - tv
data_template: - led
message: "Alexa, Sing Happy Birthday Song."
greeting: "no"
- alias: Update Birthdays - alias: Update Birthdays
initial_state: true initial_state: true

View File

@ -348,7 +348,7 @@ automation:
images: images:
- "/config/www/downloads/camera/frontdoor/frontdoor_latest.jpg" - "/config/www/downloads/camera/frontdoor/frontdoor_latest.jpg"
- service: script.notify_me_with_picture - service: script.notify_family
data_template: data_template:
title: "Front Door Motion" title: "Front Door Motion"
message: > message: >
@ -363,8 +363,10 @@ automation:
{% else %} {% else %}
Motion detected at the front door on {{ now().strftime("%d %h %Y, at %I:%M:%S %p") }}. Please see the images below. Motion detected at the front door on {{ now().strftime("%d %h %Y, at %I:%M:%S %p") }}. Please see the images below.
{%- endif %} {%- endif %}
file: "/config/www/downloads/camera/frontdoor/frontdoor_latest.jpg" url: "/config/www/downloads/camera/frontdoor/frontdoor_latest.jpg"
caption: "Front Door Motion" notify_options:
- telegram
- tv
- condition: template - condition: template
value_template: > value_template: >
@ -428,7 +430,7 @@ automation:
{{ " detected in the driveway" }} {{ " detected in the driveway" }}
{%- endif -%} {%- endif -%}
- service: script.notify_me_with_picture - service: script.notify_family
data_template: data_template:
title: "Driveway Motion" title: "Driveway Motion"
message: > message: >
@ -443,8 +445,10 @@ automation:
{% else %} {% else %}
Motion detected at the driveway on {{ now().strftime("%d %h %Y, at %I:%M:%S %p") }}. Please see the images below. Motion detected at the driveway on {{ now().strftime("%d %h %Y, at %I:%M:%S %p") }}. Please see the images below.
{%- endif -%} {%- endif -%}
file: "/config/www/downloads/camera/driveway/driveway_latest.jpg" url: "/config/www/downloads/camera/driveway/driveway_latest.jpg"
caption: "Driveway Motion" notify_options:
- telegram
- tv
- service: notify.notify_smtp - service: notify.notify_smtp
data_template: data_template:
@ -537,7 +541,7 @@ automation:
{{ " detected in the garage." }} {{ " detected in the garage." }}
{%- endif -%} {%- endif -%}
- service: script.notify_me_with_picture - service: script.notify_family
data_template: data_template:
title: "Garage Motion" title: "Garage Motion"
message: > message: >
@ -552,8 +556,10 @@ automation:
{% else %} {% else %}
Motion detected in the garage on {{ now().strftime("%d %h %Y, at %I:%M:%S %p") }}. Please see the images below. Motion detected in the garage on {{ now().strftime("%d %h %Y, at %I:%M:%S %p") }}. Please see the images below.
{%- endif -%} {%- endif -%}
file: "/config/www/downloads/camera/garage/garage_latest.jpg" url: "/config/www/downloads/camera/garage/garage_latest.jpg"
caption: "Garage Motion" notify_options:
- telegram
- tv
- service: notify.notify_smtp - service: notify.notify_smtp
data_template: data_template:
@ -623,9 +629,9 @@ automation:
{{ " detected in the backyard." }} {{ " detected in the backyard." }}
{%- endif -%} {%- endif -%}
- service: script.notify_me_with_picture - service: script.notify_family
data_template: data_template:
title: "Backyardge Motion" title: "Backyard Motion"
message: > message: >
{%- set e_id = "image_processing.doods_patio_camera" -%} {%- set e_id = "image_processing.doods_patio_camera" -%}
{%- if state_attr(e_id, 'summary') -%} {%- if state_attr(e_id, 'summary') -%}
@ -638,8 +644,10 @@ automation:
{% else %} {% else %}
Motion detected in the backyard on {{ now().strftime("%d %h %Y, at %I:%M:%S %p") }}. Please see the images below. Motion detected in the backyard on {{ now().strftime("%d %h %Y, at %I:%M:%S %p") }}. Please see the images below.
{%- endif -%} {%- endif -%}
file: "/config/www/downloads/camera/patio/patio_latest.jpg" url: "/config/www/downloads/camera/patio/patio_latest.jpg"
caption: "Backyard Motion" notify_options:
- telegram
- tv
- service: notify.notify_smtp - service: notify.notify_smtp
data_template: data_template:

View File

@ -156,7 +156,7 @@ automation:
# Turn outdoor lights on 15 minutes before sunset # Turn outdoor lights on 15 minutes before sunset
############################################################################### ###############################################################################
- alias: Evening Outdoor Lights ON (At Sunset) - alias: Evening Outdoor Lights ON (At Sunset)
# initial_state: true # initial_state: true
trigger: trigger:
platform: sun platform: sun
event: sunset event: sunset
@ -315,9 +315,6 @@ automation:
state: "on" state: "on"
action: action:
- service: script.all_indoor_lights_off - service: script.all_indoor_lights_off
# - service: script.notify_me
# data:
# message: "It is bed time, turned lights off!"
############################################################################### ###############################################################################
# Provide Bed time Report via TTS # Provide Bed time Report via TTS
@ -333,10 +330,9 @@ automation:
action: action:
- service: script.good_night_tts - service: script.good_night_tts
###############################################################################
############################################################################### # TOGGLE WORKING IN OFFICE BOOLEAN
# TOGGLE WORKING IN OFFICE BOOLEAN ###############################################################################
###############################################################################
- alias: Suresh Working in Office Start - alias: Suresh Working in Office Start
initial_state: true initial_state: true

View File

@ -77,7 +77,6 @@ binary_sensor:
payload_off: "off" payload_off: "off"
value_template: "{{ value }}" value_template: "{{ value }}"
############################################################################### ###############################################################################
# _ _ _ # _ _ _
# /\ | | | | (_) # /\ | | | | (_)
@ -140,20 +139,10 @@ automation:
action: action:
- service: switch.turn_on - service: switch.turn_on
entity_id: switch.garage entity_id: switch.garage
- service: script.notify_me - service: script.notify_family
data_template:
message: >
{% if trigger.to_state.state | lower == "on" %}
{{ trigger.to_state.attributes.friendly_name }} is now OPENED!
{% 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: data_template:
<<: *door_notification_script <<: *door_notification_script
notify_options: ["voice", "led", "tv"]
- delay: "00:00:05" - delay: "00:00:05"
- service: camera.snapshot - service: camera.snapshot
data_template: data_template:
@ -163,9 +152,9 @@ automation:
((state_attr('automation.notify_garage_door_status', 'last_triggered') |string).replace('-','_') ((state_attr('automation.notify_garage_door_status', 'last_triggered') |string).replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg') }}" .replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg') }}"
- service: script.notify_me_with_picture - service: script.notify_family
data_template: data_template:
title: 'Garage Door Status {{ now().strftime("%d %h %Y, %I:%M:%S %p") }}' title: "{{ trigger.to_state.attributes.friendly_name }}: {{ 'OPEN' if trigger.to_state.state == 'on' else 'CLOSED' }}"
message: >- message: >-
{%- set doors = "" -%} {%- set doors = "" -%}
{%- if states('binary_sensor.door_window_sensor_158d0004231f7b') == "on" and {%- if states('binary_sensor.door_window_sensor_158d0004231f7b') == "on" and
@ -181,11 +170,12 @@ automation:
('Closed' if states('binary_sensor.door_window_sensor_158d0004231f7b') == 'off' else 'OPEN') %} ('Closed' if states('binary_sensor.door_window_sensor_158d0004231f7b') == 'off' else 'OPEN') %}
{%- endif %} {%- endif %}
Your {{doors}} on {{ now().strftime("%d %h %Y, at %I:%M:%S %p") }}. Please check the garage snapshot below. Your {{doors}} on {{ now().strftime("%d %h %Y, at %I:%M:%S %p") }}. Please check the garage snapshot below.
file: > url: >
{{ '/config/www/downloads/camera/garage/garage_' ~ {{ '/config/www/downloads/camera/garage/garage_' ~
((state_attr('automation.notify_garage_door_status', 'last_triggered') |string).replace('-','_') ((state_attr('automation.notify_garage_door_status', 'last_triggered') |string).replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg') }} .replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg') }}
caption: "{{ trigger.to_state.attributes.friendly_name }}: {{ 'OPEN' if trigger.to_state.state == 'on' else 'CLOSED' }}" notify_options:
- telegram
- service: notify.notify_smtp - service: notify.notify_smtp
data_template: data_template:
@ -230,7 +220,7 @@ automation:
- condition: template - condition: template
value_template: "{{ trigger.from_state.state != trigger.to_state.state }}" value_template: "{{ trigger.from_state.state != trigger.to_state.state }}"
action: action:
- service: script.voice_notify - service: script.notify_family
data_template: data_template:
message: > message: >
{% if trigger.to_state.state | lower == "on" %} {% if trigger.to_state.state | lower == "on" %}
@ -242,21 +232,11 @@ automation:
{% elif trigger.to_state.state | lower == "off" %} {% elif trigger.to_state.state | lower == "off" %}
Your {{ trigger.to_state.attributes.friendly_name.replace('Sensor', '') }} is CLOSED! Your {{ trigger.to_state.attributes.friendly_name.replace('Sensor', '') }} is CLOSED!
{% endif %} {% endif %}
greeting: "no" notify_options:
only_at_night: > - telegram
{% if states('alarm_control_panel.home') == 'armed_home' %} - tv
no - led
{% else %} - voice
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', '') |lower -}} is open.
{% else %}
Your {{ trigger.to_state.attributes.friendly_name.replace('Sensor', '') |lower -}} is closed.
{% endif %}
- alias: When Front Door Opens Turn Front Room Lights ON - alias: When Front Door Opens Turn Front Room Lights ON
initial_state: true initial_state: true

View File

@ -59,9 +59,13 @@ automation:
data: data:
message: "Today is {{ states('sensor.holiday') }}." message: "Today is {{ states('sensor.holiday') }}."
title: "{{ states('sensor.holiday') }}" title: "{{ states('sensor.holiday') }}"
- service: script.notify_me - service: script.notify_family
data_template: data_template:
message: "Today is: {{states('sensor.holiday') }}" message: "Today is: {{states('sensor.holiday') }}"
notify_options:
- telegram
- tv
- led
- alias: Notify Indian Holidays - alias: Notify Indian Holidays
initial_state: true initial_state: true
@ -91,7 +95,7 @@ automation:
false false
{%- endif -%} {%- endif -%}
action: action:
- service: script.notify_me - service: script.notify_family
data_template: data_template:
message: >- message: >-
{%- set days2NextEvent = 0 -%} {%- set days2NextEvent = 0 -%}
@ -109,3 +113,7 @@ automation:
{{ states.calendar.holidays_in_india.attributes.message | replace(".", "") | title }}. is day after tomorrow. {{ states.calendar.holidays_in_india.attributes.message | replace(".", "") | title }}. is day after tomorrow.
{%- endif -%} {%- endif -%}
{%- endif -%} {%- endif -%}
notify_options:
- telegram
- tv
- led

View File

@ -68,7 +68,7 @@ automation:
entity_id: alarm_control_panel.home entity_id: alarm_control_panel.home
to: "triggered" to: "triggered"
action: action:
- service: script.notify_me - service: script.notify_family
data_template: data_template:
message: > message: >
{% set ns = namespace(openDoorCount=0, doorNames="") %} {% set ns = namespace(openDoorCount=0, doorNames="") %}
@ -89,6 +89,12 @@ automation:
Your Home Security System is triggered. {{ "But ALL Doors are CLOSED! Must be a spider on one of the sensor(s) triggered it!" if ns.openDoorCount == 0 else 'Following sensors are ON currently:' }} Your Home Security System is triggered. {{ "But ALL Doors are CLOSED! Must be a spider on one of the sensor(s) triggered it!" if ns.openDoorCount == 0 else 'Following sensors are ON currently:' }}
{{ ns.doorNames }} {{ ns.doorNames }}
notify_options:
- telegram
- tv
- led
- voice
- service: camera.snapshot - service: camera.snapshot
data_template: data_template:
@ -164,27 +170,15 @@ automation:
condition: condition:
- condition: template - condition: template
value_template: "{{ states('input_boolean.security_system_alerts') == 'on' }}" value_template: "{{ states('input_boolean.security_system_alerts') == 'on' }}"
# - condition: template - condition: template
# value_template: > value_template: >
# {%- if state_attr('automation.notify_home_security_status_change', 'last_triggered') -%} {%- if state_attr('automation.notify_home_security_status_change', 'last_triggered') -%}
# {{ (as_timestamp(now()) - as_timestamp(state_attr('automation.notify_home_security_status_change', 'last_triggered'))) > 90 }} {{ (as_timestamp(now()) - as_timestamp(state_attr('automation.notify_home_security_status_change', 'last_triggered'))) > 90 }}
# {%- else -%} {%- else -%}
# true true
# {%- endif -%} {%- endif -%}
action: action:
- service: script.notify_me - service: script.notify_family
data_template:
message: >
{% if states('alarm_control_panel.home') == "armed_home" %}
Your home is now secured!
{% elif states('alarm_control_panel.home') == "armed_away" %}
Your Home Security System is now set to Away mode!
{% elif states('alarm_control_panel.home') == "triggered" %}
Attention!: Your Home Security System is triggered! It has been notified to the authorities.
{% elif states('alarm_control_panel.home') == "disarmed" %}
Attention!: Your Home Security System is turned OFF.
{% endif %}
- service: script.voice_notify
data_template: data_template:
message: > message: >
{% if states('alarm_control_panel.home') == "armed_home" %} {% if states('alarm_control_panel.home') == "armed_home" %}
@ -196,6 +190,12 @@ automation:
{% elif states('alarm_control_panel.home') == "disarmed" %} {% elif states('alarm_control_panel.home') == "disarmed" %}
Attention!: Your Home Security System is turned OFF. Attention!: Your Home Security System is turned OFF.
{% endif %} {% endif %}
notify_options:
- telegram
- tv
- led
- voice
- condition: template - condition: template
value_template: "{{ states('alarm_control_panel.home') != 'disarmed' }}" value_template: "{{ states('alarm_control_panel.home') != 'disarmed' }}"
- service: input_boolean.turn_on - service: input_boolean.turn_on
@ -213,9 +213,12 @@ automation:
for: for:
minutes: 10 minutes: 10
action: action:
- service: script.notify_me - service: script.notify_family
data: data:
message: "Home Security System is OFF for more than 10 minutes!" message: "Home Security System is OFF for more than 10 minutes!"
notify_options:
- tv
- led
############################################################################### ###############################################################################
# A gentle reminder that the home security is OFF for more than 30 minutes # A gentle reminder that the home security is OFF for more than 30 minutes
@ -232,34 +235,12 @@ automation:
- condition: template - condition: template
value_template: "{{ states('input_boolean.security_system_alerts') == 'on' }}" value_template: "{{ states('input_boolean.security_system_alerts') == 'on' }}"
action: action:
- service: script.notify_me - service: script.notify_family
data: data:
message: "Home Security System is OFF for more than 30 minutes!" message: "Home Security System is OFF for more than 30 minutes!"
notify_options:
############################################################################### - tv
# When home security system is turned OFF or turned to Home mode from "away" - led
# means, someone reached home from outside
###############################################################################
# - alias: Turn ON Thermostat upon reaching home
# initial_state: true
# trigger:
# platform: state
# entity_id: alarm_control_panel.home
# condition:
# - condition: template
# value_template: >
# {% if trigger.from_state.state == 'armed_away' and
# (trigger.to_state.state == 'armed_home' or trigger.to_state.state == 'disarmed') %}
# true
# {% else %}
# false
# {% endif %}
# action:
# - service: climate.set_preset_mode
# target:
# entity_id: climate.dining_room
# data:
# preset_mode: "eco"
############################################################################### ###############################################################################
# TURN HOME SECURITY SYSTEM ON AT BED TIME # TURN HOME SECURITY SYSTEM ON AT BED TIME
@ -285,9 +266,13 @@ automation:
- service: alarm_control_panel.alarm_arm_home - service: alarm_control_panel.alarm_arm_home
data: data:
entity_id: alarm_control_panel.home entity_id: alarm_control_panel.home
- service: script.notify_me - service: script.notify_family
data: data:
message: "It's bedtime, you forgot to turn ON Home Security System. Turned it ON for you." message: "It's bedtime, you forgot to turn ON Home Security System. Turned it ON for you."
notify_options:
- telegram
- tv
- led
############################################################################### ###############################################################################
# Check for Garage Door Status when Home Security System State changes # Check for Garage Door Status when Home Security System State changes
@ -312,139 +297,20 @@ automation:
action: action:
- service: switch.turn_on - service: switch.turn_on
entity_id: switch.garage entity_id: switch.garage
- service: script.notify_me
data_template:
message: >
Attention! Your home Security system is set to {{ states('alarm_control_panel.home').split('_')[1] | upper }} mode. BUT THE {% if states('binary_sensor.door_window_sensor_158d0004231f7b') == "on" -%}DOUBLE CAR {%- else %}SINGLE CAR {% endif %}GARAGE DOOR IS STILL OPEN!
- service: camera.snapshot - service: camera.snapshot
data_template: data_template:
entity_id: "camera.garage" entity_id: "camera.garage"
filename: "{{ '/config/www/downloads/camera/garage/garage_' ~ (state_attr('automation.home_security_system_and_garage_door_check','last_updated') ~ '').replace('-','_').replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}" filename: "{{ '/config/www/downloads/camera/garage/garage_' ~ (state_attr('automation.home_security_system_and_garage_door_check','last_updated') ~ '').replace('-','_').replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- service: script.notify_family
- service: notify.telegram
data_template:
title: "Garage"
message: "Home Security System is ON, but Garage Doors are OPEN!"
data:
photo:
- file: "{{ '/config/www/downloads/camera/garage/garage_' ~
(states.binary_sensor.motion_sensor_158d00024ee084.last_updated ~ '').replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
caption: "Garage"
- condition: template
value_template: "{{ states('alarm_control_panel.home') == 'armed_home' }}"
- service: script.voice_notify
data_template: data_template:
message: > message: >
{%- set doors = "" %} Attention! Your home Security system is set to {{ states('alarm_control_panel.home').split('_')[1] | upper }} mode. BUT THE {% if states('binary_sensor.door_window_sensor_158d0004231f7b') == "on" -%}DOUBLE CAR {%- else %}SINGLE CAR {% endif %}GARAGE DOOR IS STILL OPEN!
{%- if states('binary_sensor.door_window_sensor_158d0004231f7b') == "on" and states('binary_sensor.door_window_sensor_158d0004248d5b') == "on" %} url: "{{ '/config/www/downloads/camera/garage/garage_' ~
{%- set doors = "Both garage doors" %} (states.binary_sensor.motion_sensor_158d00024ee084.last_updated ~ '').replace('-','_')
{%- elif states('binary_sensor.door_window_sensor_158d0004248d5b') == "on"%} .replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
{%- set doors = state_attr('binary_sensor.door_window_sensor_158d0004248d5b', 'friendly_name') %} notify_options:
{%- elif states('binary_sensor.door_window_sensor_158d0004248d5b') == "on" %} - telegram
{%- set doors = state_attr('binary_sensor.door_window_sensor_158d0004231f7b', 'friendly_name') %} - tv
{%- endif %} - led
Attention! Your home Security system is set to {{ states('alarm_control_panel.home').split('_')[1] | upper }} mode. - voice
BUT the {{ doors }} {{ 'are' if doors.endswith('s') else 'is' }} open.
###############################################################################
# Turn Home Security System ON at sunset time
###############################################################################
# - alias: Turn On Home Security System At Sunset
# initial_state: true
# trigger:
# platform: sun
# event: sunset
# offset: '+00:00:00'
# condition:
# - condition: state
# entity_id: alarm_control_panel.home
# state: 'disarmed'
# action:
# - service_template: >-
# {% if states('binary_sensor.back_door_sensor_sensor') == "off" and
# states('binary_sensor.aeotec_zw120_door_window_sensor_gen5_sensor') == "off" and
# states('binary_sensor.door_window_sensor_158d0004231f7b') == "off" and
# states('binary_sensor.door_window_sensor_158d0004248d5b') == "off" %}
# alarm_control_panel.alarm_arm_home
# {% else %}
# alarm_control_panel.disarm
# {% endif %}
# data:
# entity_id: alarm_control_panel.home
# - service: script.voice_notify
# data_template:
# message: >
# {% if states('binary_sensor.back_door_sensor_sensor') == "off" and
# states('binary_sensor.aeotec_zw120_door_window_sensor_gen5_sensor') == "off" and
# states('binary_sensor.door_window_sensor_158d0004231f7b') == "off" and
# states('binary_sensor.door_window_sensor_158d0004248d5b') == "off" %}
# It's getting dark outside, and your home security system is now set to HOME mode.
# {% else %}
# It is getting dark outside.
# {%- if states('binary_sensor.back_door_sensor_sensor') == "on" -%}
# {%- set doors = doors ~ " Back Door" -%}
# {%- endif -%}
# {%- if states('binary_sensor.aeotec_zw120_door_window_sensor_gen5_sensor') == "on" -%}
# {% if doors | trim != "" %}
# {%- set doors = doors ~ " and Front Door" -%}
# {% else %}
# {%- set doors = doors ~ " Front Door" -%}
# {% endif %}
# {%- endif -%}
# {%- if states('binary_sensor.door_window_sensor_158d0004231f7b') == "on" -%}
# {% if doors | trim != "" %}
# {%- set doors = doors ~ " and Two Car Garage Door" -%}
# {% else %}
# {%- set doors = doors ~ " Two Car Garage Door" -%}
# {% endif %}
# {%- endif -%}
# {%- if states('binary_sensor.door_window_sensor_158d0004248d5b') == "on" -%}
# {% if doors | trim != "" %}
# {%- set doors = doors ~ " and Single Car Garage Door" -%}
# {% else %}
# {%- set doors = doors ~ " Single Car Garage Door" -%}
# {% endif %}
# {%- endif -%}
# Your{{ doors }} {%- if 'and' in doors -%}s are {%- else %} is {%- endif %} open. Home Security System could not be turned on.
# {% endif %}
# - service: script.notify_me
# data_template:
# message: >
# {% if states('binary_sensor.back_door_sensor_sensor') == "off" and
# states('binary_sensor.aeotec_zw120_door_window_sensor_gen5_sensor') == "off" and
# states('binary_sensor.door_window_sensor_158d0004231f7b') == "off" and
# states('binary_sensor.door_window_sensor_158d0004248d5b') == "off" %}
# It's getting dark outside, and your home security system is now set to HOME mode.
# {% else %}
# It is getting dark outside.
# {%- if states('binary_sensor.back_door_sensor_sensor') == "on" -%}
# {%- set doors = doors ~ " Back Door" -%}
# {%- endif -%}
# {%- if states('binary_sensor.aeotec_zw120_door_window_sensor_gen5_sensor') == "on" -%}
# {% if doors | trim != "" %}
# {%- set doors = doors ~ " and Front Door" -%}
# {% else %}
# {%- set doors = doors ~ " Front Door" -%}
# {% endif %}
# {%- endif -%}
# {%- if states('binary_sensor.door_window_sensor_158d0004231f7b') == "on" -%}
# {% if doors | trim != "" %}
# {%- set doors = doors ~ " and Two Car Garage Door" -%}
# {% else %}
# {%- set doors = doors ~ " Two Car Garage Door" -%}
# {% endif %}
# {%- endif -%}
# {%- if states('binary_sensor.door_window_sensor_158d0004248d5b') == "on" -%}
# {% if doors | trim != "" %}
# {%- set doors = doors ~ " and Single Car Garage Door" -%}
# {% else %}
# {%- set doors = doors ~ " Single Car Garage Door" -%}
# {% endif %}
# {%- endif -%}
# Your {{ doors}} {%- if 'and' in doors -%}s are {%- else %} is {%- endif %} open. Home Security System could not be turned on.
# {% endif %}

View File

@ -4,20 +4,19 @@ automation:
############################################################################### ###############################################################################
# Display Weather Information on LED Screen # Display Weather Information on LED Screen
############################################################################### ###############################################################################
- alias: Display Weather Changes on LED Screen - alias: Notify Weather Changes
initial_state: true initial_state: true
trigger: trigger:
- platform: state - platform: state
entity_id: sensor.dark_sky_apparent_temperature, sensor.dark_sky_hourly_summary entity_id: sensor.dark_sky_apparent_temperature, sensor.dark_sky_hourly_summary
action: action:
- service: script.led_message - service: script.notify_family
data_template:
message: >
{{ states('sensor.dark_sky_apparent_temperature') |int }} degrees, {{ states('sensor.dark_sky_hourly_summary') }}
- service: script.notify_tv
data_template: data_template:
message: > message: >
{{ states('sensor.dark_sky_apparent_temperature') |int }} degrees, {{ states('sensor.dark_sky_hourly_summary') }} {{ states('sensor.dark_sky_apparent_temperature') |int }} degrees, {{ states('sensor.dark_sky_hourly_summary') }}
notify_options:
- tv
- led
############################################################################### ###############################################################################
# Display Garage Door Status on LED Screen # Display Garage Door Status on LED Screen
@ -37,25 +36,7 @@ automation:
- condition: template - condition: template
value_template: "{{ states('input_boolean.garage_door_notifications') == 'on' }}" value_template: "{{ states('input_boolean.garage_door_notifications') == 'on' }}"
action: action:
- service: script.led_message - service: script.notify_family
data_template:
message: >
{% set doors = "" %}
{% if states('binary_sensor.door_window_sensor_158d0004231f7b') == "on" and
states('binary_sensor.door_window_sensor_158d0004248d5b') == "on" %}
{% set doors = "Attention! Both Garage Doors are OPEN" %}
{% elif states('binary_sensor.door_window_sensor_158d0004231f7b') == "off" and
states('binary_sensor.door_window_sensor_158d0004248d5b') == "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 }}
- service: script.notify_tv
data_template: data_template:
message: > message: >
{% set doors = "" %} {% set doors = "" %}
@ -73,6 +54,10 @@ automation:
{% endif %} {% endif %}
{% endif %} {% endif %}
{{ doors }} {{ doors }}
notify_options:
- telegram
- tv
- led
############################################################################### ###############################################################################
# Display Zone based Messages on LED Screen # Display Zone based Messages on LED Screen
@ -90,12 +75,12 @@ automation:
to: "home" to: "home"
for: "00:02:00" for: "00:02:00"
action: action:
- service: script.led_message - service: script.notify_family
data_template:
message: "Welcome home, {{ trigger.entity_id.split('.')[1].split('_')[1] | title }}"
- service: script.notify_tv
data_template: data_template:
message: "Welcome home, {{ trigger.entity_id.split('.')[1].split('_')[1] | title }}" message: "Welcome home, {{ trigger.entity_id.split('.')[1].split('_')[1] | title }}"
notify_options:
- tv
- led
- alias: Alert When Someone Enters a Zone on LED Screen - alias: Alert When Someone Enters a Zone on LED Screen
initial_state: true initial_state: true

View File

@ -1,7 +1,5 @@
homeassistant: homeassistant:
customize: customize:
input_label.aeotec_zw120_door_window_sensor_gen5_sensor:
unit_of_measurement: "count"
input_label.back_door_sensor_sensor: input_label.back_door_sensor_sensor:
unit_of_measurement: "count" unit_of_measurement: "count"
input_label.basement_door_sensor_sensor: input_label.basement_door_sensor_sensor:

View File

@ -37,27 +37,6 @@ nest:
############################################################################### ###############################################################################
automation: automation:
###############################################################################
# Turn OFF AC after 3 hours of cooling
# Where we live, 3 hours is plenty to cool the house down!
###############################################################################
- alias: Turn Off AC After 3 Hours of Cooling
initial_state: true
trigger:
- platform: state
entity_id: climate.dining_room
to: "cool"
for: "03:00:00"
action:
- service: climate.set_away_mode
data:
entity_id: climate.dining_room
away_mode: "true"
- service: script.notify_me
data_template:
message: "Air Condition has been ON for 3 hours.
Turning it Off to save power."
############################################################################### ###############################################################################
# Nest Thermostat automatically changes based on activity at home. # Nest Thermostat automatically changes based on activity at home.
# This automation is to keep an eye on what's going on with Nest # This automation is to keep an eye on what's going on with Nest
@ -68,23 +47,11 @@ automation:
- platform: state - platform: state
entity_id: sensor.dining_room_thermostat_operation_mode entity_id: sensor.dining_room_thermostat_operation_mode
action: action:
- service: script.notify_me - service: script.notify_family
data_template: data_template:
message: "Nest Thermostat changed from '{{ trigger.from_state.state }}' to '{{ trigger.to_state.state }}'." message: "Nest Thermostat changed from '{{ trigger.from_state.state }}' to '{{ trigger.to_state.state }}'."
- service: script.voice_notify notify_options:
data_template: - telegram
message: > - tv
{% set state = trigger.to_state.state %} - led
{% if state == "off" %} - voice
Your home's thermostat is switched off.
{% elif state == "eco" %}
Your home's thermostat is set to eco or away mode.
{% elif state == "heat" %}
Your central heating is ON.
{% elif state == "cool" %}
Your central air condition is switched ON
{% elif state == "heat-cool" %}
Your home's thermostat is set to automatic mode.
{% else %}
Your home's thermostat is set to {{ state }} mode.
{% endif %}

View File

@ -53,15 +53,128 @@ tts:
# Telegram Configuration # Telegram Configuration
# #
telegram_bot: telegram_bot:
# Setup Broadcast for sending messages
- platform: broadcast - platform: broadcast
api_key: !secret telegram_apikey api_key: !secret telegram_apikey
allowed_chat_ids: allowed_chat_ids:
- !secret telegram_chatid - !secret telegram_chatid
# Add Polling
- platform: polling - platform: polling
api_key: !secret telegram_apikey api_key: !secret telegram_apikey
parse_mode: html parse_mode: html
allowed_chat_ids: allowed_chat_ids:
- !secret telegram_chatid - !secret telegram_chatid
script:
notify_family:
sequence:
- condition: template
value_template: '{{ message | trim != "" }}'
- service: script.notify_on_led_screen
data_template:
message: "{{ message }}"
notify_options: "{{ notify_options }}"
- service: script.notify_firestick
data_template:
url: "{{ url }}"
title: "{{ title }}"
message: "{{ message }}"
notify_options: "{{ notify_options }}"
- service: script.notify_telegram
data_template:
file: "{{ url }}"
title: "{{ title }}"
message: "{{ message }}"
notify_options: "{{ notify_options }}"
- service: script.notify_email
data_template:
title: "{{ title }}"
message: "{{ message }}"
notify_options: "{{ notify_options }}"
- service: script.notify_voice
data_template:
message: "{{ message }}"
notify_options: "{{ notify_options }}"
###############################################################################
# NOTIFY OPTIONS
# 1. tv
# 2. telegram
# 3. led
# 4. email
# 5. voice
###############################################################################
notify_firestick:
sequence:
# - condition: state
# entity_id: input_boolean.firetv_alerts
# state: "on"
- condition: template
value_template: "{{ 'tv' in notify_options }}"
- service: notify.android_tv_fire_tv
data:
message: "{{ message }}"
title: Mahasri Bot
data:
color: red
duration: 7
image:
path: "{{ url }}" #/config/www/downloads/camera/driveway/driveway_20220604_185216.jpg
icon:
path: /config/www/{{- [ "suresh.jpg", "srinika.jpg", "mallika.jpg", "hasika.jpg" ] | random -}}
notify_telegram:
sequence:
# - condition: state
# entity_id: input_boolean.text_alerts
# state: "on"
- condition: template
value_template: "{{ 'telegram' in notify_options }}"
- service: telegram_bot.send_message
data:
title: "{{- title -}}"
message: "{{- message -}}"
data:
photo:
- file: "{{- file -}}"
caption: "{{- title -}}"
notify_email:
sequence:
# - condition: state
# entity_id: input_boolean.email_alerts
# state: "on"
- condition: template
value_template: "{{ 'email' in notify_options }}"
- service: script.notify_smtp
data_template:
title: "{{ title }}"
message: "{{ message }}"
notify_voice:
sequence:
# - condition: state
# entity_id: input_boolean.voice_alerts
# state: "on"
- condition: template
value_template: "{{ 'voice' in notify_options }}"
- service: script.voice_notify
data_template:
message: "{{ message }}"
notify_on_led_screen:
sequence:
# - condition: state
# entity_id: input_boolean.led_alerts
# state: "on"
- condition: template
value_template: "{{ 'led' in notify_options }}"
- service: mqtt.publish
data_template:
topic: messageboard/messages
payload: "{{ message }}"

View File

@ -117,3 +117,39 @@ automation:
entity_id: timer.timer_pill_reminder entity_id: timer.timer_pill_reminder
action: action:
- service_template: script.remind_pill - service_template: script.remind_pill
script:
###############################################################################
# Notifies to take pills, starts timer again!
# Voice notifications at home - only if the option is selected.
###############################################################################
remind_pill:
sequence:
- service: script.notify_family
data:
message: "ALERT: PLEASE TAKE YOUR TABLETS!"
notify_options:
- telegram
- service: timer.start
entity_id: timer.timer_pill_reminder
###############################################################################
# Stops timer, Records that the pills are taken, and notifies!
###############################################################################
pill_taken:
sequence:
- service: timer.cancel
entity_id: timer.timer_pill_reminder
- service: input_boolean.turn_on
entity_id: input_boolean.pill_taken
- service: script.notify_family
data_template:
message: >
Thank you for taking tablets.
{%- if state_attr('sensor.allergy_index_today', 'rating') != None %}
{{- " Today's pollen level is : " ~ state_attr('sensor.allergy_index_today', 'rating') }}.
{%- endif -%}
notify_options:
- telegram
- tv
- led

View File

@ -78,16 +78,15 @@ sensor:
- drive_smart_status - drive_smart_status
- drive_temp - drive_temp
# The following sensors are required, as the automations with trigger platform `numeric_state`,
# The following sensors are required, as the automations with trigger platform `numeric_state`, # above a certain value using `above: x` AND `for: 00:05:00` combination is not supported.
# above a certain value using `above: x` AND `for: 00:05:00` combination is not supported. #
# # Apparently `for:` is ONLY supportd for trigger platform 'state'
# Apparently `for:` is ONLY supportd for trigger platform 'state' #
# # By creating the folowing sensor, we can now have an automation with trigger platform as 'state'
# By creating the folowing sensor, we can now have an automation with trigger platform as 'state' # with a combination of `to:` and `for:`
# with a combination of `to:` and `for:` #
# # See the automations 'Notify NAS Memory Usage' and 'Notify NAS CPU Usage' that uses these sensor values
# See the automations 'Notify NAS Memory Usage' and 'Notify NAS CPU Usage' that uses these sensor values
- platform: template - platform: template
sensors: sensors:
@ -109,83 +108,97 @@ sensor:
# #
############################################################################### ###############################################################################
automation: automation:
- alias: Notify NAS Status Change - alias: Notify NAS Status Change
initial_state: true initial_state: true
trigger: trigger:
platform: state platform: state
entity_id: entity_id:
- sensor.kalavala_nas_status - sensor.kalavala_nas_status
condition: condition:
- condition: template - condition: template
value_template: "{{ trigger.from_state.state != trigger.to_state.state }}" value_template: "{{ trigger.from_state.state != trigger.to_state.state }}"
action: action:
- service: script.notify_me - service: script.notify_family
data_template: data_template:
message: "NAS Status changed to: {{ trigger.to_state.state| upper }}" message: "NAS Status changed to: {{ trigger.to_state.state| upper }}"
notify_options:
- telegram
- tv
- alias: Notify NAS Drive Status Change - alias: Notify NAS Drive Status Change
initial_state: true initial_state: true
trigger: trigger:
platform: state platform: state
entity_id: entity_id:
- sensor.kalavala_nas_smart_status_drive_01 - sensor.kalavala_nas_smart_status_drive_01
- sensor.kalavala_nas_smart_status_drive_02 - sensor.kalavala_nas_smart_status_drive_02
- sensor.kalavala_nas_smart_status_drive_03 - sensor.kalavala_nas_smart_status_drive_03
- sensor.kalavala_nas_smart_status_drive_04 - sensor.kalavala_nas_smart_status_drive_04
condition: condition:
- condition: template - condition: template
value_template: "{{ trigger.from_state.state != trigger.to_state.state }}" value_template: "{{ trigger.from_state.state != trigger.to_state.state }}"
action: action:
- service: script.notify_me - service: script.notify_family
data_template: data_template:
message: "NAS Drive state changed to: message: "NAS Drive state changed to: {{ trigger.to_state.state| upper }} from '{{ trigger.from_state.state| upper }}'"
{{ trigger.to_state.state| upper }} from notify_options:
'{{ trigger.from_state.state| upper }}'" - telegram
- tv
- alias: Notify NAS CPU Temperature - alias: Notify NAS CPU Temperature
initial_state: true initial_state: true
trigger: trigger:
platform: numeric_state platform: numeric_state
entity_id: sensor.kalavala_nas_cpu_temperature entity_id: sensor.kalavala_nas_cpu_temperature
above: 125 above: 125
action: action:
- service: script.notify_me - service: script.notify_family
data_template: data_template:
message: "NAS CPU temperature is going crazy hot, needs your attention!!! message: "NAS CPU temperature is going crazy hot, needs your attention!!! Current cpu temp is: {{ trigger.to_state.state }}"
The current cpu temp is: {{ trigger.to_state.state }}" notify_options:
- telegram
- tv
- alias: Notify NAS Disk Usage - alias: Notify NAS Disk Usage
initial_state: true initial_state: true
trigger: trigger:
platform: numeric_state platform: numeric_state
entity_id: sensor.kalavala_nas_volume_used_datavol1 entity_id: sensor.kalavala_nas_volume_used_datavol1
above: 80 above: 80
action: action:
- service: script.notify_me - service: script.notify_family
data_template: data_template:
message: "Attention! NAS disk usage is above 80 percent. Time to clean up?" message: "Attention! NAS disk usage is above 80 percent. Time to clean up?"
notify_options:
- telegram
- tv
- alias: Notify NAS Memory Usage - alias: Notify NAS Memory Usage
initial_state: true initial_state: true
trigger: trigger:
platform: state platform: state
entity_id: sensor.nas_memory_usage_above_80 entity_id: sensor.nas_memory_usage_above_80
to: 'True' to: "True"
for: '00:05:00' for: "00:05:00"
action: action:
- service: script.notify_me - service: script.notify_family
data_template: data_template:
message: "FYI - NAS Memory is above 80 percent for more than 5 minutes." message: "FYI - NAS Memory is above 80 percent for more than 5 minutes."
notify_options:
- telegram
- tv
- alias: Notify NAS CPU Usage - alias: Notify NAS CPU Usage
initial_state: true initial_state: true
trigger: trigger:
platform: state platform: state
entity_id: sensor.nas_cpu_usage_above_80 entity_id: sensor.nas_cpu_usage_above_80
to: 'True' to: "True"
for: '00:05:00' for: "00:05:00"
action: action:
- service: script.notify_me - service: script.notify_family
data_template: data_template:
message: "FYI - NAS CPU is above 80 percent for more than 5 minutes." message: "FYI - NAS CPU is above 80 percent for more than 5 minutes."
notify_options:
- telegram
- tv

View File

@ -294,7 +294,7 @@ automation:
entity_id: sensor.recycle_day entity_id: sensor.recycle_day
state: "yes" state: "yes"
action: action:
- service: script.notify_me - service: script.notify_family
data_template: data_template:
message: > message: >
{% if states.sensor.trash_day.state == "yes" and states.sensor.recycle_day.state == "yes" %} {% if states.sensor.trash_day.state == "yes" and states.sensor.recycle_day.state == "yes" %}
@ -304,18 +304,10 @@ automation:
{% elif states.sensor.recycle_day.state == "yes" %} {% elif states.sensor.recycle_day.state == "yes" %}
Attention!: Tomorrow is the Recycle Pickup day. Please don't forget to put the recycle bin outside tonight! Attention!: Tomorrow is the Recycle Pickup day. Please don't forget to put the recycle bin outside tonight!
{% endif %} {% endif %}
notify_options:
- service: script.voice_notify - telegram
data_template: - tv
message: > - led
{% if states.sensor.trash_day.state == "yes" and states.sensor.recycle_day.state == "yes" %}
Attention!: Tomorrow is the Trash and Recycle Pickup day.
Please don't forget to leave Trash bin and recycle bin outside tonight!
{% elif states.sensor.trash_day.state == "yes" %}
Attention!: Tomorrow is the Trash Pickup day. Please don't forget to put the Trash bin outside tonight!
{% elif states.sensor.recycle_day.state == "yes" %}
Attention!: Tomorrow is the Recycle Pickup day. Please don't forget to put the recycle bin outside tonight!
{% endif %}
- alias: Reset Trash Reminders - alias: Reset Trash Reminders
initial_state: true initial_state: true

View File

@ -2,7 +2,7 @@
# @author : Mahasri Kalavala # @author : Mahasri Kalavala
# @date : 09/20/2018 # @date : 09/20/2018
# @package : scripts # @package : scripts
# @description : All my scripts are here in one place! # @description : All my scripts are here in one place. Well, not ALL!
################################################################################ ################################################################################
# _____ _ _ # _____ _ _
# / ____| (_) | | # / ____| (_) | |
@ -83,10 +83,12 @@ script:
- service: alarm_control_panel.alarm_arm_away - service: alarm_control_panel.alarm_arm_away
data: data:
entity_id: alarm_control_panel.home entity_id: alarm_control_panel.home
- service: script.notify_me - service: script.notify_family
data: data:
message: > message: >
No one is at home. Cameras rolling, Indoor lights are OFF. Your home security system is turned ON! No one is at home. Cameras rolling, Indoor lights are OFF. Your home security system is turned ON!
notify_options:
- telegram
############################################################################### ###############################################################################
# The following script runs when no one is home. It excludes some lights # The following script runs when no one is home. It excludes some lights
@ -168,48 +170,6 @@ script:
# |___/ # |___/
# Notify Related Scripts # Notify Related Scripts
############################################################################### ###############################################################################
notify_me_with_picture:
sequence:
- condition: state
entity_id: input_boolean.text_alerts
state: "on"
- condition: template
value_template: '{{- message | trim != "" -}}'
- service: telegram_bot.send_message
data:
title: "{{- title -}}"
message: "{{- message -}}"
data:
photo:
- file: "{{- file -}}"
caption: "{{- caption -}}"
notify_tv:
sequence:
- service: notify.android_tv_fire_tv
data:
message: "{{ message }}"
title: Mahasri Bot
data:
color: red
duration: 7
transparency: 1%
icon:
path: /config/www/{{- [ "suresh.jpg", "srinika.jpg", "mallika.jpg", "hasika.jpg" ] | random -}}
notify_me:
sequence:
- condition: state
entity_id: input_boolean.text_alerts
state: "on"
- condition: template
value_template: '{{ message | trim != "" }}'
- service: telegram_bot.send_message
data:
message: "{{ message }}"
- service: script.notify_tv
data:
message: "{{ message }}"
good_night_tts: good_night_tts:
sequence: sequence:
@ -338,44 +298,3 @@ script:
data_template: data_template:
topic: messageboard/messages topic: messageboard/messages
payload: "{{ message }}" payload: "{{ message }}"
###############################################################################
# Notifies to take pills, starts timer again!
# Voice notifications at home - only if the option is selected.
###############################################################################
remind_pill:
sequence:
- service: script.notify_me
data:
message: "ALERT: PLEASE TAKE YOUR TABLETS!"
- service: timer.start
entity_id: timer.timer_pill_reminder
- condition: template
value_template: "{{ states('input_boolean.pill_voice_notification') == 'on' }}"
- service: script.voice_notify
data_template:
message: >
Please take the tablets. It looks like you have forgotten to take today's
dose of tablets... Once again, this is a reminder for you to take the tablets.
###############################################################################
# Stops timer, Records that the pills are taken, and notifies!
###############################################################################
pill_taken:
sequence:
- service: timer.cancel
entity_id: timer.timer_pill_reminder
- service: input_boolean.turn_on
entity_id: input_boolean.pill_taken
- service: script.notify_me
data_template:
message: >
Thank you for taking tablets.
{%- if state_attr('sensor.allergy_index_today', 'rating') != None %}
{{- " Today's pollen level is : " ~ state_attr('sensor.allergy_index_today', 'rating') }}.
{%- endif -%}
- condition: template
value_template: "{{ states('input_boolean.pill_voice_notification') == 'on' }}"
- service: script.voice_notify
data:
message: "Thank you for taking tablets on time!"

View File

@ -20,7 +20,6 @@ homeassistant:
# #
############################################################################### ###############################################################################
automation: automation:
- alias: Season Change Notification - alias: Season Change Notification
initial_state: true initial_state: true
trigger: trigger:
@ -30,7 +29,10 @@ automation:
- condition: template - condition: template
value_template: '{{ trigger.from_state.state | lower != "unknown" }}' value_template: '{{ trigger.from_state.state | lower != "unknown" }}'
action: action:
- service: script.notify_me - service: script.notify_family
data_template: data_template:
message: > message: >
Good bye {{ trigger.from_state.state }}, and Say Hello to {{ trigger.to_state.state }}! Good bye {{ trigger.from_state.state }}, and Say Hello to {{ trigger.to_state.state }}!
notify_options:
- telegram
- tv

View File

@ -116,7 +116,7 @@ input_number:
step: 5 step: 5
mode: box mode: box
######################### CLOSET LIGHTS ######################### CLOSET LIGHTS
hasika_bedroom_closet_lights: hasika_bedroom_closet_lights:
name: Hasika Closet Lights Duration name: Hasika Closet Lights Duration
min: 5 min: 5
@ -331,9 +331,11 @@ automation:
- platform: state - platform: state
entity_id: input_boolean.do_not_disturb entity_id: input_boolean.do_not_disturb
action: action:
- service: script.notify_me - service: script.notify_family
data_template: data_template:
message: "The Do Not Disturb Mode is {{ trigger.to_state.state |upper }}." message: "The Do Not Disturb Mode is {{ trigger.to_state.state |upper }}."
notify_options:
- led
# Hourly Reports # Hourly Reports
###################################################### ######################################################

View File

@ -32,9 +32,12 @@ automation:
entity_id: input_boolean.light_automations entity_id: input_boolean.light_automations
state: "on" state: "on"
action: action:
- service: script.notify_me - service: script.notify_family
data: data:
message: "It has been two hours, are you still working in the garage? Changing the status to 'Not working'!" message: "It has been two hours, are you still working in the garage?"
notify_options:
- telegram
- tv
- service: input_boolean.turn_off - service: input_boolean.turn_off
entity_id: input_boolean.working_in_garage entity_id: input_boolean.working_in_garage
@ -61,18 +64,15 @@ automation:
entity_id: input_boolean.light_automations entity_id: input_boolean.light_automations
state: "on" state: "on"
action: action:
- service: script.notify_me - service: script.notify_family
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 {{ trigger.to_state.attributes.friendly_name }} is open for more than 5 minutes.
- service: script.led_message
data_template: data_template:
message: > message: >
Your {{ trigger.to_state.attributes.friendly_name }} is OPEN for more than 5 minutes! Your {{ trigger.to_state.attributes.friendly_name }} is OPEN for more than 5 minutes!
notify_options:
- telegram
- voice
- tv
- led
# Outdoor Lights: # Outdoor Lights:
# Keeps and eye on the patio and backyard lights... # Keeps and eye on the patio and backyard lights...
@ -98,10 +98,14 @@ automation:
- service: switch.turn_off - service: switch.turn_off
data_template: data_template:
entity_id: "{{ trigger.entity_id }}" entity_id: "{{ trigger.entity_id }}"
- service: script.notify_me - service: script.notify_family
data_template: data_template:
message: > message: >
{{ trigger.to_state.attributes.friendly_name }} is ON during the day time. Saving power by turning it off! {{ trigger.to_state.attributes.friendly_name }} is ON during the day time. Saving power by turning it off!
notify_options:
- telegram
- tv
- led
# General Watch Dog automation: # General Watch Dog automation:
# Keeps and eye on the lights & switches, turns off after 10 PM if they are on. # Keeps and eye on the lights & switches, turns off after 10 PM if they are on.
@ -265,10 +269,9 @@ automation:
data_template: data_template:
entity_id: "{{ trigger.entity_id }}" entity_id: "{{ trigger.entity_id }}"
#############################################################################
############################################################################# # CLOSET LIGHTS WATCH DOG
# CLOSET LIGHTS WATCH DOG #############################################################################
#############################################################################
- alias: Srinika Bedroom Closet WatchDog - alias: Srinika Bedroom Closet WatchDog
initial_state: true initial_state: true
@ -305,114 +308,3 @@ automation:
- service: homeassistant.turn_off - service: homeassistant.turn_off
data_template: data_template:
entity_id: "{{ trigger.entity_id }}" entity_id: "{{ trigger.entity_id }}"
- alias: Notify Plex User Status
initial_state: true
trigger:
# - platform: numeric_state
# entity_id: sensor.plex_mahasri_nas
# above: 0
# for:
# minutes: 2
- platform: state
entity_id:
- media_player.plex_adi_bh_plex_for_roku_roku3
- media_player.plex_adi_bh_plex_for_roku_rokuultra
- media_player.plex_prade5_plex_for_roku_roku_express
to: 'playing'
for:
minutes: 2
action:
- service: script.notify_me
data_template:
message: >-
{%- set tag_map = {'adi.bh':'Adi', 'prade5':'Pradeep'} -%}
{% for item in states.media_player if item.state == 'playing' and state_attr(item.entity_id, 'media_title') != None
and state_attr(item.entity_id, 'username') != 'kalavala'
and tag_map[state_attr(item.entity_id, 'username')] |trim != '' %}
{{ tag_map[state_attr(item.entity_id, 'username')] }} is watching {% if state_attr(item.entity_id, 'media_content_type') == "movie" -%}
{{ "a movie, " + state_attr(item.entity_id, 'media_title') |title }}
{% endif %}
{%- if state_attr(item.entity_id, 'media_content_type') == "tvshow" %}
TV Show - {{ state_attr(item.entity_id, 'media_series_title') }}
Season: {{ state_attr(item.entity_id, 'media_season') }}, Episode: {{ state_attr(item.entity_id, 'media_episode') }} ({{ state_attr(item.entity_id, 'media_title') }})
{% endif %}
{% endfor %}
# - alias: Lights And Switches WatchDog 10 Min
# initial_state: true
# trigger:
# - platform: state
# entity_id:
# - switch.guest_bathroom_exhaust
# - switch.master_bathroom_toilet_exhaust
# to: "on"
# for:
# minutes: 10
# condition:
# - condition: state
# entity_id: input_boolean.light_automations
# state: "on"
# action:
# - service: homeassistant.turn_off
# data_template:
# entity_id: "{{ trigger.entity_id }}"
#
# Main master Bathoom has more CFM to vent out... keep it for 20 minutes
#
# - alias: Lights And Switches WatchDog 20 Min
# initial_state: true
# trigger:
# - platform: state
# entity_id:
# - switch.master_bathroom_shower_exhaust
# to: "on"
# for:
# minutes: 20
# condition:
# - condition: state
# entity_id: input_boolean.light_automations
# state: "on"
# action:
# - service: homeassistant.turn_off
# data_template:
# entity_id: "{{ trigger.entity_id }}"
# - alias: Lights And Switches WatchDog 30 Min
# initial_state: true
# trigger:
# - platform: state
# entity_id:
# - switch.guest_bathroom_lights
# - switch.master_bathroom_toilet_light
# to: "on"
# for:
# minutes: 30
# condition:
# - condition: state
# entity_id: input_boolean.light_automations
# state: "on"
# action:
# - service: homeassistant.turn_off
# data_template:
# entity_id: "{{ trigger.entity_id }}"
# - alias: Lights And Switches WatchDog 45 Min
# initial_state: true
# trigger:
# - platform: state
# entity_id:
# - switch.garage_shop_lights
# to: "on"
# for:
# minutes: 45
# condition:
# - condition: state
# entity_id: input_boolean.light_automations
# state: "on"
# action:
# - service: homeassistant.turn_off
# data_template:
# entity_id: "{{ trigger.entity_id }}"

View File

@ -192,7 +192,7 @@ automation:
- condition: template - condition: template
value_template: "{% if states.sensor.dark_sky_wind_speed.state | round < 8 %} false {% else %} true {% endif %}" value_template: "{% if states.sensor.dark_sky_wind_speed.state | round < 8 %} false {% else %} true {% endif %}"
action: action:
- service: script.notify_me - service: script.notify_family
data_template: data_template:
message: > message: >
{% set windspeed = states.sensor.dark_sky_wind_speed.state | round %} {% set windspeed = states.sensor.dark_sky_wind_speed.state | round %}
@ -207,6 +207,10 @@ automation:
{% elif ( windspeed > 60 ) and (states.input_boolean.hurricane_wind_alert.state == 'off') %} {% elif ( windspeed > 60 ) and (states.input_boolean.hurricane_wind_alert.state == 'off') %}
HURRICANE WINDS. FIND SHELTER, AND STAY INDOORS! HURRICANE WINDS. FIND SHELTER, AND STAY INDOORS!
{% endif %} {% endif %}
notify_options:
- telegram
- tv
- led
- service: input_boolean.turn_on - service: input_boolean.turn_on
data_template: data_template:
entity_id: >- entity_id: >-
@ -283,7 +287,7 @@ automation:
true true
{%- endif -%} {%- endif -%}
action: action:
- service: script.notify_me - service: script.notify_family
data_template: data_template:
message: > message: >
{% set windspeed = states.sensor.dark_sky_wind_speed.state | round %} {% set windspeed = states.sensor.dark_sky_wind_speed.state | round %}
@ -292,6 +296,10 @@ automation:
{% elif ( windspeed > 60 ) and ( windspeed <= 100 ) and (states.input_boolean.hurricane_wind_alert.state == 'off') %} {% elif ( windspeed > 60 ) and ( windspeed <= 100 ) and (states.input_boolean.hurricane_wind_alert.state == 'off') %}
HURRICANE WINDS. FIND SHELTER, AND STAY INDOORS! DO NOT GO OUT AND RISK YOUR LIFE! HURRICANE WINDS. FIND SHELTER, AND STAY INDOORS! DO NOT GO OUT AND RISK YOUR LIFE!
{% endif %} {% endif %}
notify_options:
- telegram
- tv
- led
- alias: Rain Alerts - alias: Rain Alerts
initial_state: true initial_state: true
@ -309,12 +317,13 @@ automation:
- condition: template - condition: template
value_template: "{{ states.sensor.dark_sky_precip_probability.state | int == 1 }}" value_template: "{{ states.sensor.dark_sky_precip_probability.state | int == 1 }}"
action: action:
- service: script.notify_me - service: script.notify_family
data_template: data_template:
message: "{{ trigger.to_state.state | title }} with intensity {{ states.sensor.dark_sky_precip_intensity.state | float }} inches per hour" message: "{{ trigger.to_state.state | title }} with intensity {{ states.sensor.dark_sky_precip_intensity.state | float }} inches per hour"
- service: script.voice_notify notify_options:
data_template: - telegram
message: "{{ trigger.to_state.state }} with intensity {{ states.sensor.dark_sky_precip_intensity.state | float}} inches per hour" - tv
- led
- service: input_boolean.turn_on - service: input_boolean.turn_on
data_template: data_template:
entity_id: > entity_id: >
@ -339,12 +348,14 @@ automation:
- condition: template - condition: template
value_template: "{{ states.sensor.dark_sky_precip_probability.state | int == 1 }}" value_template: "{{ states.sensor.dark_sky_precip_probability.state | int == 1 }}"
action: action:
- service: script.notify_me - service: script.notify_family
data_template: data_template:
message: "{{ trigger.to_state.state | title }} with intensity {{ states.sensor.dark_sky_precip_intensity.state | float }} inches per hour" message: "{{ trigger.to_state.state | title }} with intensity {{ states.sensor.dark_sky_precip_intensity.state | float }} inches per hour"
- service: script.voice_notify notify_options:
data_template: - telegram
message: "{{ trigger.to_state.state }} with intensity {{ states.sensor.dark_sky_precip_intensity.state | float}} inches per hour" - voice
- tv
- led
- service: input_boolean.turn_on - service: input_boolean.turn_on
data_template: data_template:
entity_id: > entity_id: >

View File

@ -473,9 +473,14 @@ script:
doorbell_camera_pics: doorbell_camera_pics:
sequence: sequence:
- service: script.notify_me - service: script.notify_family
data: data:
message: "ALERT! Someone is at the front door!" message: "ALERT! Someone is at the front door!"
notify_options:
- telegram
- voice
- tv
- led
- service: camera.snapshot - service: camera.snapshot
data_template: data_template:
entity_id: "camera.frontdoor_camera" entity_id: "camera.frontdoor_camera"
@ -504,3 +509,12 @@ script:
(state_attr('script.doorbell_camera_pics', 'last_triggered') ~ '').replace('-','_') (state_attr('script.doorbell_camera_pics', 'last_triggered') ~ '').replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}" .replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
caption: "Someone rang door bell!" caption: "Someone rang door bell!"
- service: script.notify_family
data_template:
message: Someone rang door bell!
url: "{{ '/config/www/downloads/camera/frontdoor/frontdoor_' ~
(state_attr('script.doorbell_camera_pics', 'last_triggered') ~ '').replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
notify_options:
- tv
- led

View File

@ -53,15 +53,15 @@ automation:
- condition: template - condition: template
value_template: "{{ states('input_boolean.zone_alerts') == 'on' }}" value_template: "{{ states('input_boolean.zone_alerts') == 'on' }}"
action: action:
- service: script.notify_me - service: script.notify_family
data_template: data_template:
message: > message: >
{{ trigger.entity_id.split('.')[1].split('_')[1] | title}} just entered {{ trigger.zone.attributes.friendly_name }}! {{ trigger.entity_id.split('.')[1].split('_')[1] | title}} just entered {{ trigger.zone.attributes.friendly_name }}!
- service: script.voice_notify notify_options:
data_template: - telegram
message: > - voice
{{ trigger.entity_id.split('.')[1].split('_')[1] | title}} just entered {{ trigger.zone.attributes.friendly_name }}! - tv
greeting: "no" - led
- alias: Alert When Someone Leaves a Zone - alias: Alert When Someone Leaves a Zone
initial_state: true initial_state: true
@ -78,17 +78,14 @@ automation:
- condition: template - condition: template
value_template: "{{ states('input_boolean.zone_alerts') == 'on' }}" value_template: "{{ states('input_boolean.zone_alerts') == 'on' }}"
action: action:
- service: script.notify_me - service: script.notify_family
data_template: data_template:
message: "{{ trigger.entity_id.split('.')[1].split('_')[1] | title}} just left {{ trigger.zone.attributes.friendly_name }}." message: "{{ trigger.entity_id.split('.')[1].split('_')[1] | title}} just left {{ trigger.zone.attributes.friendly_name }}."
- service: script.voice_notify notify_options:
data_template: - telegram
message: >- - voice
{{ trigger.entity_id.split('.')[1].split('_')[1] | title }} just left {{ trigger.zone.attributes.friendly_name }}. - tv
{% if trigger.entity_id.split('.')[1].split('_')[1] == "suresh" and trigger.zone.attributes.friendly_name | lower == "office" %} - led
and will be home in {{ (states('sensor.suresh2home') | int) + 5 }} minutes.
{% endif %}
greeting: "no"
############################################################################### ###############################################################################
# Welcome family members when they come home # Welcome family members when they come home
@ -110,15 +107,14 @@ automation:
entity_id: input_boolean.zone_alerts entity_id: input_boolean.zone_alerts
state: "on" state: "on"
action: action:
- service: script.notify_me - service: script.notify_family
data_template: data_template:
message: > message: >
Welcome home, {{ trigger.entity_id.split('.')[1].split('_')[1] | title }}! Welcome home, {{ trigger.entity_id.split('.')[1].split('_')[1] | title }}!
- service: script.voice_notify notify_options:
data_template: - voice
message: > - tv
"Welcome home, {{ trigger.entity_id.split('.')[1].split('_')[1] | lower }}!" - led
greeting: "no"
- service: input_boolean.turn_off - service: input_boolean.turn_off
entity_id: input_boolean.home_mode_away entity_id: input_boolean.home_mode_away
- service: switch.turn_on - service: switch.turn_on
@ -165,11 +161,16 @@ automation:
- condition: template - condition: template
value_template: '{{ states.proximity.home.attributes.dir_of_travel == "towards" }}' value_template: '{{ states.proximity.home.attributes.dir_of_travel == "towards" }}'
action: action:
- service: script.notify_me - service: script.notify_family
data_template: data_template:
message: "Suresh is on his way home, he is within the 5 miles range. Should be home soon!" message: "Suresh is on his way home, he is within the 5 miles range. Should be home soon!"
notify_options:
- telegram
- voice
- tv
- led
#################################################################################### ####################################################################################
- alias: Srinika Left Home - alias: Srinika Left Home
initial_state: true initial_state: true
trigger: trigger:
@ -188,7 +189,7 @@ automation:
- switch.srinika_bedroom_closet - switch.srinika_bedroom_closet
- switch.srinika_bedroom_accent_lights - switch.srinika_bedroom_accent_lights
#################################################################################### ####################################################################################
- alias: Hasika Left Home - alias: Hasika Left Home
initial_state: true initial_state: true
trigger: trigger: