minor updates.

This commit is contained in:
Mahasri Kalavala
2019-05-14 19:32:32 -04:00
parent cb50a7229d
commit 1d01811938
6 changed files with 99 additions and 45 deletions

View File

@@ -402,7 +402,7 @@ automation:
action:
- service: script.notify_me
data_template:
message: "{{ trigger.to_state.attributes.friendly_name }}'s phone battery is less than: {{ trigger.to_state.attributes.battery }}%."
message: "{{ trigger.to_state.attributes.friendly_name | title }}'s phone battery is less than: {{ trigger.to_state.attributes.battery }}%."
- service: script.voice_notify
data_template:
message: "{{ trigger.to_state.attributes.friendly_name }}'s phone battery is less than: {{ trigger.to_state.attributes.battery }}%."

View File

@@ -17,9 +17,6 @@ homeassistant:
customize: &customize
package: 'cameras'
hidden: &hidden
<<: *customize
hidden: true
#
# The camera url format in secrets.yaml would look like this:
@@ -294,7 +291,18 @@ automation:
- service: notify.notify_smtp
data_template:
title: 'Front door motion {{ now().strftime("%d %h %Y, %I:%M:%S %p") }}'
message: 'Motion detected at the front door on {{ now().strftime("%d %h %Y, at %I:%M:%S %p") }}. Please see the images below.'
message: >
{%- set e_id = "image_processing.tensorflow_frontdoor_camera" -%}
{%- if state_attr(e_id, 'summary') -%}
{%- set count = state_attr(e_id, 'summary') | count -%}
{%- for x in state_attr(e_id, 'summary') | list -%}
{%- if loop.first %}{% elif loop.last %}, and {% else %}, {% endif -%}
{{- state_attr(e_id, 'summary')[x]}} {{ x ~ 's' if state_attr(e_id, 'summary')[x] > 1 else x }}
{%- endfor -%}
{{ " detected in the front yard on " ~ now().strftime("%d %h %Y, at %I:%M:%S %p") ~ ". Please see the images below." }}
{% else %}
Motion detected in the front door on {{ now().strftime("%d %h %Y, at %I:%M:%S %p") }}. Please see the images below.
{%- endif -%}
data:
images:
- "/home/homeassistant/.homeassistant/www/downloads/camera/frontdoor/frontdoor_latest.jpg"
@@ -362,7 +370,18 @@ automation:
- service: notify.notify_smtp
data_template:
title: 'Driveway motion {{ now().strftime("%d %h %Y, %I:%M:%S %p") }}'
message: 'Motion detected at the driveway on {{ now().strftime("%d %h %Y, at %I:%M:%S %p") }}. Please see the images below.'
message: >
{%- set e_id = "image_processing.tensorflow_driveway_camera" -%}
{%- if state_attr(e_id, 'summary') -%}
{%- set count = state_attr(e_id, 'summary') | count -%}
{%- for x in state_attr(e_id, 'summary') | list -%}
{%- if loop.first %}{% elif loop.last %}, and {% else %}, {% endif -%}
{{- state_attr(e_id, 'summary')[x]}} {{ x ~ 's' if state_attr(e_id, 'summary')[x] > 1 else x }}
{%- endfor -%}
{{ " detected in the driveway on " ~ now().strftime("%d %h %Y, at %I:%M:%S %p") ~ ". Please see the images below." }}
{% else %}
Motion detected at the driveway on {{ now().strftime("%d %h %Y, at %I:%M:%S %p") }}. Please see the images below.
{%- endif -%}
data:
images:
- "/home/homeassistant/.homeassistant/www/downloads/camera/driveway/driveway_latest.jpg"
@@ -439,7 +458,18 @@ automation:
- service: notify.notify_smtp
data_template:
title: 'Garage motion {{ now().strftime("%d %h %Y, %I:%M:%S %p") }}'
message: 'Motion detected in the garage on {{ now().strftime("%d %h %Y, at %I:%M:%S %p") }}. Please see the images below.'
message: >
{%- set e_id = "image_processing.tensorflow_garage_camera" -%}
{%- if state_attr(e_id, 'summary') -%}
{%- set count = state_attr(e_id, 'summary') | count -%}
{%- for x in state_attr(e_id, 'summary') | list -%}
{%- if loop.first %}{% elif loop.last %}, and {% else %}, {% endif -%}
{{- state_attr(e_id, 'summary')[x]}} {{ x ~ 's' if state_attr(e_id, 'summary')[x] > 1 else x }}
{%- endfor -%}
{{ " detected in the garage on " ~ now().strftime("%d %h %Y, at %I:%M:%S %p") ~ ". Please see the images below." }}
{% else %}
Motion detected in the garage on {{ now().strftime("%d %h %Y, at %I:%M:%S %p") }}. Please see the images below.
{%- endif -%}
data:
images:
- "/home/homeassistant/.homeassistant/www/downloads/camera/garage/garage_latest.jpg"
@@ -496,7 +526,18 @@ automation:
- service: notify.notify_smtp
data_template:
title: 'Backyard motion {{ now().strftime("%d %h %Y, %I:%M:%S %p") }}'
message: 'Motion detected in the backyard on {{ now().strftime("%d %h %Y, at %I:%M:%S %p") }}. Please see the images below.'
message: >
{%- set e_id = "image_processing.tensorflow_patio_camera" -%}
{%- if state_attr(e_id, 'summary') -%}
{%- set count = state_attr(e_id, 'summary') | count -%}
{%- for x in state_attr(e_id, 'summary') | list -%}
{%- if loop.first %}{% elif loop.last %}, and {% else %}, {% endif -%}
{{- state_attr(e_id, 'summary')[x]}} {{ x ~ 's' if state_attr(e_id, 'summary')[x] > 1 else x }}
{%- endfor -%}
{{ " detected in the backyard on " ~ now().strftime("%d %h %Y, at %I:%M:%S %p") ~ ". Please see the images below." }}
{% else %}
Motion detected in the backyard on {{ now().strftime("%d %h %Y, at %I:%M:%S %p") }}. Please see the images below.
{%- endif -%}
data:
images:
- "/home/homeassistant/.homeassistant/www/downloads/camera/patio/patio_latest.jpg"

View File

@@ -180,6 +180,9 @@ automation:
- condition: state
entity_id: input_boolean.light_automations
state: 'on'
- condition: state
entity_id: input_boolean.movie_time
state: 'off'
action:
- service: switch.turn_on
data:

View File

@@ -53,11 +53,11 @@ notify:
sender: !secret smtp_sender
recipient: !secret smtp_recipient
- name: notify_aws_sns
platform: aws_sns
aws_access_key_id: !secret aws_access_key_id
aws_secret_access_key: !secret aws_secret_access_key
region_name: 'us-east-1'
# - name: notify_aws_sns
# platform: aws_sns
# aws_access_key_id: !secret aws_access_key_id
# aws_secret_access_key: !secret aws_secret_access_key
# region_name: 'us-east-1'
- name: file_notify
platform: file

View File

@@ -994,3 +994,12 @@
# data:
# payload: 'stop'
# topic: 'robotic_mower/control'
# sensor:
# - platform: rest
# resource: https://pollenkontroll.no/api/pollen-count?country=no&location=126
# name: Pollen
# value_template: >-
# {% for city in value_json.cities if city.id == '126' %}
# {{ city.id }}
# {% endfor %}