From 1d01811938b614afa533e7a97aab621bfbe467d9 Mon Sep 17 00:00:00 2001 From: Mahasri Kalavala Date: Tue, 14 May 2019 19:32:32 -0400 Subject: [PATCH] minor updates. --- packages/batteries.yaml | 2 +- packages/cameras.yaml | 55 ++++++++++++++++++++++++++---- packages/daily_routines.yaml | 3 ++ packages/notify.yaml | 10 +++--- packages/test.yaml | 9 +++++ zwcfg_0xd89c4f0c.xml | 65 ++++++++++++++++++------------------ 6 files changed, 99 insertions(+), 45 deletions(-) diff --git a/packages/batteries.yaml b/packages/batteries.yaml index 99362a2..2844f0c 100644 --- a/packages/batteries.yaml +++ b/packages/batteries.yaml @@ -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 }}%." diff --git a/packages/cameras.yaml b/packages/cameras.yaml index 4bc7236..ee5dac1 100644 --- a/packages/cameras.yaml +++ b/packages/cameras.yaml @@ -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" diff --git a/packages/daily_routines.yaml b/packages/daily_routines.yaml index fe34e7b..d2c96b4 100644 --- a/packages/daily_routines.yaml +++ b/packages/daily_routines.yaml @@ -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: diff --git a/packages/notify.yaml b/packages/notify.yaml index fbd67c8..adef6f4 100644 --- a/packages/notify.yaml +++ b/packages/notify.yaml @@ -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 diff --git a/packages/test.yaml b/packages/test.yaml index 0364bc2..7661664 100644 --- a/packages/test.yaml +++ b/packages/test.yaml @@ -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 %} \ No newline at end of file diff --git a/zwcfg_0xd89c4f0c.xml b/zwcfg_0xd89c4f0c.xml index 6d1b4bd..67153c9 100644 --- a/zwcfg_0xd89c4f0c.xml +++ b/zwcfg_0xd89c4f0c.xml @@ -34,10 +34,10 @@ - + - + @@ -168,7 +168,7 @@ - + @@ -208,7 +208,7 @@ - + @@ -216,9 +216,9 @@ - + - + @@ -386,7 +386,7 @@ - + @@ -728,9 +728,9 @@ - - - + + + @@ -1006,11 +1006,11 @@ - - - + + + - + @@ -1190,8 +1190,8 @@ - - + + @@ -1703,18 +1703,18 @@ - + - + - + @@ -1734,7 +1734,7 @@ - + @@ -1809,7 +1809,7 @@ - + @@ -2023,7 +2023,7 @@ - + @@ -2038,7 +2038,7 @@ - + @@ -2253,7 +2253,7 @@ - + @@ -2341,7 +2341,7 @@ - + @@ -2405,10 +2405,11 @@ - + - + + @@ -2579,7 +2580,7 @@ - + @@ -2665,7 +2666,7 @@ - + @@ -2680,7 +2681,7 @@ - + @@ -2703,7 +2704,7 @@ - + @@ -2718,7 +2719,7 @@ - +