cleaned up, and updated to latest version.

This commit is contained in:
Mahasri Kalavala
2022-11-29 19:50:52 -05:00
parent 9a8c586542
commit 3bedcbdc20
77 changed files with 3853 additions and 7279 deletions

View File

@@ -1,274 +1,274 @@
###############################################################################
# @author : Mahasri Kalavala
# @date : 09/04/2020
# @package : 3D Printer
# @description : 3D Printer Automations
###############################################################################
homeassistant:
customize:
automation.3d_print:
icon: mdi:printer
# ###############################################################################
# # @author : Mahasri Kalavala
# # @date : 09/04/2020
# # @package : 3D Printer
# # @description : 3D Printer Automations
# ###############################################################################
# homeassistant:
# customize:
# automation.3d_print:
# icon: mdi:printer
input_boolean:
twenty_five_percent:
name: "25%"
icon: mdi:radiobox-blank
# input_boolean:
# twenty_five_percent:
# name: "25%"
# icon: mdi:radiobox-blank
fifty_percent:
name: "50%"
icon: mdi:brightness-3
# fifty_percent:
# name: "50%"
# icon: mdi:brightness-3
seventy_five_percent:
name: "75%"
icon: mdi:brightness-2
# seventy_five_percent:
# name: "75%"
# icon: mdi:brightness-2
hundred_percent:
name: "100%"
icon: mdi:brightness-1
# hundred_percent:
# name: "100%"
# icon: mdi:brightness-1
power_off_when_complete:
name: Auto Shutoff When Done
icon: mdi:toggle-switch-off
# power_off_when_complete:
# name: Auto Shutoff When Done
# icon: mdi:toggle-switch-off
send_progress_pictures:
name: Send Telegram Pictures
icon: mdi:toggle-switch-off
# send_progress_pictures:
# name: Send Telegram Pictures
# icon: mdi:toggle-switch-off
#
# Octoprint Camera URL in the format
# still_image_url: "http://192.xxx.xxx.xxx/webcam/?action=snapshot"
# mjpeg_url: "http://192.xxx.xxx.xxx/webcam/?action=stream"
#
camera:
- platform: mjpeg
name: 3D Printer Camera
still_image_url: !secret octoprint_cam_snapshot
mjpeg_url: !secret octoprint_cam_stream
# #
# # Octoprint Camera URL in the format
# # still_image_url: "http://192.xxx.xxx.xxx/webcam/?action=snapshot"
# # mjpeg_url: "http://192.xxx.xxx.xxx/webcam/?action=stream"
# #
# camera:
# - platform: mjpeg
# name: 3D Printer Camera
# still_image_url: !secret octoprint_cam_snapshot
# mjpeg_url: !secret octoprint_cam_stream
#
# A couple of template sensors to show the elapsed and estimated time in readable format
# instead of # of seconds (default)
#
sensor:
- platform: template
sensors:
time_elapsed:
value_template: >
{%- macro secondsToReadableString(seconds) %}
{%- set map = {'week': (seconds / 604800) % 604800,
'day': (seconds / 86400) % 7, 'hour': (seconds / 3600) % 24,
'minute': (seconds / 60) % 60} -%}
{%- for item in map if map[item] | int > 0 -%}
{%- if loop.first %}{% elif loop.last %}, and {% else %}, {% endif -%}
{{- map[item]|int }} {{ item -}} {{- 's' if map[item]|int > 1 -}}
{%- endfor -%}
{% endmacro %}
{{ secondsToReadableString(states('sensor.octoprint_time_elapsed') |int) }}
# #
# # A couple of template sensors to show the elapsed and estimated time in readable format
# # instead of # of seconds (default)
# #
# sensor:
# # - platform: template
# # sensors:
# # time_elapsed:
# # value_template: >
# # {%- macro secondsToReadableString(seconds) %}
# # {%- set map = {'week': (seconds / 604800) % 604800,
# # 'day': (seconds / 86400) % 7, 'hour': (seconds / 3600) % 24,
# # 'minute': (seconds / 60) % 60} -%}
# # {%- for item in map if map[item] | int > 0 -%}
# # {%- if loop.first %}{% elif loop.last %}, and {% else %}, {% endif -%}
# # {{- map[item]|int }} {{ item -}} {{- 's' if map[item]|int > 1 -}}
# # {%- endfor -%}
# # {% endmacro %}
# # {{ secondsToReadableString(states('sensor.octoprint_time_elapsed') |int) }}
- platform: template
sensors:
time_estimated:
value_template: >
{%- macro secondsToReadableString(seconds) %}
{%- set map = {'week': (seconds / 604800) % 604800,
'day': (seconds / 86400) % 7, 'hour': (seconds / 3600) % 24,
'minute': (seconds / 60) % 60 } -%}
{%- for item in map if map[item] | int > 0 -%}
{%- if loop.first %}{% elif loop.last %}, and {% else %}, {% endif -%}
{{- map[item]|int }} {{ item -}} {{- 's' if map[item]|int > 1 -}}
{%- endfor -%}
{% endmacro %}
{{ secondsToReadableString(states('sensor.octoprint_time_remaining') |int) }}
# # - platform: template
# # sensors:
# # time_estimated:
# # value_template: >
# # {%- macro secondsToReadableString(seconds) %}
# # {%- set map = {'week': (seconds / 604800) % 604800,
# # 'day': (seconds / 86400) % 7, 'hour': (seconds / 3600) % 24,
# # 'minute': (seconds / 60) % 60 } -%}
# # {%- for item in map if map[item] | int > 0 -%}
# # {%- if loop.first %}{% elif loop.last %}, and {% else %}, {% endif -%}
# # {{- map[item]|int }} {{ item -}} {{- 's' if map[item]|int > 1 -}}
# # {%- endfor -%}
# # {% endmacro %}
# # {{ secondsToReadableString(states('sensor.octoprint_time_remaining') |int) }}
- platform: template
sensors:
print_completion:
value_template: >
{% set seconds = states('sensor.octoprint_time_remaining')|int %}
{% if utcnow().strftime('%s')|int | timestamp_custom("%A %D") == (utcnow().strftime('%s') |int + seconds) | timestamp_custom("%A %D") %}
Today at {{ (utcnow().strftime('%s')|int + seconds) | timestamp_custom("%I:%M %p") }}
{% else %}
{{ (utcnow().strftime('%s') |int + seconds) | timestamp_custom("%A %D %I:%M %p") }}
{% endif %}
# # - platform: template
# # sensors:
# # print_completion:
# # value_template: >
# # {% set seconds = states('sensor.octoprint_time_remaining')|int %}
# # {% if utcnow().strftime('%s')|int | timestamp_custom("%A %D") == (utcnow().strftime('%s') |int + seconds) | timestamp_custom("%A %D") %}
# # Today at {{ (utcnow().strftime('%s')|int + seconds) | timestamp_custom("%I:%M %p") }}
# # {% else %}
# # {{ (utcnow().strftime('%s') |int + seconds) | timestamp_custom("%A %D %I:%M %p") }}
# # {% endif %}
- platform: template
sensors:
octoprint_actual_bed_temp_c:
unit_of_measurement: "C"
value_template: >
{%- macro F2C(temperature) -%}
{% set tmp = (((temperature - 32) *5)/9) %}
{{- " %0.2f" % tmp }}
{%- endmacro -%}
{{ F2C(states('sensor.octoprint_actual_bed_temp') |int ) |int }}
# - platform: template
# sensors:
# octoprint_actual_bed_temp_c:
# unit_of_measurement: "C"
# value_template: >
# {%- macro F2C(temperature) -%}
# {% set tmp = (((temperature - 32) *5)/9) %}
# {{- " %0.2f" % tmp }}
# {%- endmacro -%}
# {{ F2C(states('sensor.octoprint_actual_bed_temp') |int ) |int }}
- platform: template
sensors:
octoprint_actual_tool0_temp_c:
unit_of_measurement: "C"
value_template: >
{%- macro F2C(temperature) -%}
{% set tmp = (((temperature - 32) *5)/9) %}
{{- " %0.2f" % tmp }}
{%- endmacro -%}
{{ F2C(states('sensor.octoprint_actual_tool0_temp') |int ) |int }}
# - platform: template
# sensors:
# octoprint_actual_tool0_temp_c:
# unit_of_measurement: "C"
# value_template: >
# {%- macro F2C(temperature) -%}
# {% set tmp = (((temperature - 32) *5)/9) %}
# {{- " %0.2f" % tmp }}
# {%- endmacro -%}
# {{ F2C(states('sensor.octoprint_actual_tool0_temp') |int ) |int }}
- platform: template
sensors:
octoprint_target_bed_temp_c:
unit_of_measurement: "C"
value_template: >
{%- macro F2C(temperature) -%}
{% set tmp = (((temperature - 32) *5)/9) %}
{{- " %0.2f" % tmp }}
{%- endmacro -%}
{{ F2C(states('sensor.octoprint_target_bed_temp') |int ) |int }}
# - platform: template
# sensors:
# octoprint_target_bed_temp_c:
# unit_of_measurement: "C"
# value_template: >
# {%- macro F2C(temperature) -%}
# {% set tmp = (((temperature - 32) *5)/9) %}
# {{- " %0.2f" % tmp }}
# {%- endmacro -%}
# {{ F2C(states('sensor.octoprint_target_bed_temp') |int ) |int }}
- platform: template
sensors:
octoprint_target_tool0_temp_c:
unit_of_measurement: "C"
value_template: >
{%- macro F2C(temperature) -%}
{% set tmp = (((temperature - 32) *5)/9) %}
{{- " %0.2f" % tmp }}
{%- endmacro -%}
{{ F2C(states('sensor.octoprint_target_tool0_temp') |int ) |int }}
# - platform: template
# sensors:
# octoprint_target_tool0_temp_c:
# unit_of_measurement: "C"
# value_template: >
# {%- macro F2C(temperature) -%}
# {% set tmp = (((temperature - 32) *5)/9) %}
# {{- " %0.2f" % tmp }}
# {%- endmacro -%}
# {{ F2C(states('sensor.octoprint_target_tool0_temp') |int ) |int }}
automation:
#
# Notify when the printer status changed from "Prnting" to anything.
# Use this later to determine if you want to turn off printer or not
#
- alias: "3D Print State Changed"
trigger:
platform: state
entity_id: "sensor.octoprint_current_state"
from: "Printing"
action:
- service: script.notify_me
data_template:
message: "3D Printer Status Changed from 'Printing' to '{{ trigger.to_state.state }}'."
# - platform: template
# sensors:
# octoprint_print_start:
# value_template: "{{ as_timestamp(states('sensor.octoprint_start_time'))| timestamp_custom('%m/%d/%Y, %H:%M:%S %p') }}"
#
# Updates on the Printer Status
#
- alias: "3D Print Notify Printer State"
trigger:
platform: state
entity_id: "binary_sensor.octoprint_printing"
action:
- service: script.notify_me
data_template:
message: "3D Printer Status changed from '{{ trigger.from_state.state }}' to '{{ trigger.to_state.state }}'."
# - platform: template
# sensors:
# octoprint_print_end_eta:
# value_template: "{{ as_timestamp(states('sensor.octoprint_estimated_finish_time'))| timestamp_custom('%m/%d/%Y, %H:%M:%S %p') }}"
#
# Notifies when the printer errors out
#
- alias: "3D Print Notify Printer Error"
trigger:
platform: state
entity_id: binary_sensor.octoprint_printing_error
to: "on"
action:
- service: script.notify_me
data_template:
message: "3D Printer Status changed to 'ERROR'. Please check the printer!"
# automation:
# #
# # Notify when the printer status changed from "Prnting" to anything.
# # Use this later to determine if you want to turn off printer or not
# #
# - alias: "3D Print State Changed"
# trigger:
# platform: state
# entity_id: "sensor.octoprint_current_state"
# from: "Printing"
# action:
# - service: script.notify_me
# data_template:
# message: "3D Printer Status Changed from 'Printing' to '{{ trigger.to_state.state }}'."
#
# Updates appropriate input booleans based on percentage complete
#
- alias: "3D Print Update Percentage Booleans"
trigger:
platform: state
entity_id: sensor.octoprint_job_percentage
action:
- service_template: "input_boolean.turn_{{- 'on' if states('sensor.octoprint_job_percentage') | int >= 25 else 'off' }}"
entity_id: input_boolean.twenty_five_percent
- service_template: "input_boolean.turn_{{- 'on' if states('sensor.octoprint_job_percentage') | int >= 50 else 'off' }}"
entity_id: input_boolean.fifty_percent
- service_template: "input_boolean.turn_{{- 'on' if states('sensor.octoprint_job_percentage') | int >= 75 else 'off' }}"
entity_id: input_boolean.seventy_five_percent
- service_template: "input_boolean.turn_{{- 'on' if states('sensor.octoprint_job_percentage') | int == 100 else 'off' }}"
entity_id: input_boolean.hundred_percent
# #
# # Updates on the Printer Status
# #
# - alias: "3D Print Notify Printer State"
# trigger:
# platform: state
# entity_id: "binary_sensor.octoprint_printing"
# action:
# - service: script.notify_me
# data_template:
# message: "3D Printer Status changed from '{{ trigger.from_state.state }}' to '{{ trigger.to_state.state }}'."
#
# Provides update at frequent intervals - 25%, 50%, 75%, and 100%!
#
- alias: "3D Print Progress Update"
trigger:
platform: state
entity_id: input_boolean.twenty_five_percent, input_boolean.fifty_percent, input_boolean.seventy_five_percent, input_boolean.hundred_percent
to: "on"
from: "off"
action:
- service: script.notify_me
data_template:
message: >-
{%- macro secondsToReadableString(seconds) %}
{%- set map = {'week': (seconds / 604800) % 604800,
'day': (seconds / 86400) % 7, 'hour': (seconds / 3600) % 24,
'minute': (seconds / 60) % 60 } -%}
{%- for item in map if map[item] | int > 0 -%}
{%- if loop.first %}{% elif loop.last %}, and {% else %}, {% endif -%}
{{- map[item]|int }} {{ item -}} {{- 's' if map[item]|int > 1 -}}
{%- endfor -%}
{% endmacro %}
3D Printer job is now {{ trigger.to_state.attributes.friendly_name }} complete. {% if trigger.entity_id != 'input_boolean.hundred_percent' %} Will be done in {{ secondsToReadableString(states('sensor.octoprint_time_remaining') |int) }}.
{%- endif -%}
# #
# # Notifies when the printer errors out
# #
# - alias: "3D Print Notify Printer Error"
# trigger:
# platform: state
# entity_id: binary_sensor.octoprint_printing_error
# to: "on"
# action:
# - service: script.notify_me
# data_template:
# message: "3D Printer Status changed to 'ERROR'. Please check the printer!"
#
# When the printing is complete (100%), it waits for 2 minutes and turns off the printer.
# It also resets all the input booleans, so that it starts fresh next time.
# Resetting input boleans is not necessary as they get updated automatically when
# octoprint job percentage value chaanges... but why not?
#
- alias: "3d Print Job Finished"
trigger:
platform: state
entity_id: input_boolean.hundred_percent
to: "on"
action:
- condition: template
value_template: "{{ states('input_boolean.power_off_when_complete') == 'on' }}"
- delay: "00:02:00"
- service: switch.turn_off
entity_id: switch.3d_printer
- service: script.notify_me
data_template:
message: "3D Printer is now switched off!"
- service_template: input_boolean.turn_off
entity_id: input_boolean.twenty_five_percent
- service_template: input_boolean.turn_off
entity_id: input_boolean.fifty_percent
- service_template: input_boolean.turn_off
entity_id: input_boolean.seventy_five_percent
- service_template: input_boolean.turn_off
entity_id: input_boolean.hundred_percent
# #
# # Updates appropriate input booleans based on percentage complete
# #
# - alias: "3D Print Update Percentage Booleans"
# trigger:
# platform: state
# entity_id: sensor.octoprint_job_percentage
# action:
# - service_template: "input_boolean.turn_{{- 'on' if states('sensor.octoprint_job_percentage') | int >= 25 else 'off' }}"
# entity_id: input_boolean.twenty_five_percent
# - service_template: "input_boolean.turn_{{- 'on' if states('sensor.octoprint_job_percentage') | int >= 50 else 'off' }}"
# entity_id: input_boolean.fifty_percent
# - service_template: "input_boolean.turn_{{- 'on' if states('sensor.octoprint_job_percentage') | int >= 75 else 'off' }}"
# entity_id: input_boolean.seventy_five_percent
# - service_template: "input_boolean.turn_{{- 'on' if states('sensor.octoprint_job_percentage') | int == 100 else 'off' }}"
# entity_id: input_boolean.hundred_percent
#
# If the printer is ON and is "Printing", it will send a snapshot/picture every 30 minutes
#
- alias: "3D Print Send Telegram Pictures"
trigger:
platform: time_pattern
minutes: "/30"
seconds: 00
condition:
- condition: template
value_template: "{{ states('input_boolean.send_progress_pictures') == 'on' }}"
- condition: template
value_template: "{{ states('sensor.octoprint_current_state') | lower == 'printing' }}"
action:
- service: camera.snapshot
data:
entity_id: camera.3d_printer_camera
filename: "/config/www/downloads/camera/3dprinter/print_latest.jpg"
- service: notify.telegram
data_template:
title: "3D Printer"
message: "Print Progress"
data:
photo:
- file: "/config/www/downloads/camera/3dprinter/print_latest.jpg"
caption: "3D Print Progress at {{ states('sensor.octoprint_job_percentage') }}%"
# #
# # Provides update at frequent intervals - 25%, 50%, 75%, and 100%!
# #
# - alias: "3D Print Progress Update"
# trigger:
# platform: state
# entity_id: input_boolean.twenty_five_percent, input_boolean.fifty_percent, input_boolean.seventy_five_percent, input_boolean.hundred_percent
# to: "on"
# from: "off"
# action:
# - service: script.notify_me
# data_template:
# message: >-
# 3D Printer job is now {{ trigger.to_state.attributes.friendly_name }} complete.
# #
# # When the printing is complete (100%), it waits for 2 minutes and turns off the printer.
# # It also resets all the input booleans, so that it starts fresh next time.
# # Resetting input boleans is not necessary as they get updated automatically when
# # octoprint job percentage value chaanges... but why not?
# #
# - alias: "3d Print Job Finished"
# trigger:
# platform: state
# entity_id: input_boolean.hundred_percent
# to: "on"
# action:
# - condition: template
# value_template: "{{ states('input_boolean.power_off_when_complete') == 'on' }}"
# - delay: "00:02:00"
# - service: switch.turn_off
# entity_id: switch.3d_printer
# - service: script.notify_me
# data_template:
# message: "3D Printer is now switched off!"
# - service_template: input_boolean.turn_off
# entity_id: input_boolean.twenty_five_percent
# - service_template: input_boolean.turn_off
# entity_id: input_boolean.fifty_percent
# - service_template: input_boolean.turn_off
# entity_id: input_boolean.seventy_five_percent
# - service_template: input_boolean.turn_off
# entity_id: input_boolean.hundred_percent
# #
# # If the printer is ON and is "Printing", it will send a snapshot/picture every 30 minutes
# #
# - alias: "3D Print Send Telegram Pictures"
# trigger:
# platform: time_pattern
# minutes: "/30"
# seconds: 00
# condition:
# - condition: template
# value_template: "{{ states('input_boolean.send_progress_pictures') == 'on' }}"
# - condition: template
# value_template: "{{ states('sensor.octoprint_current_state') | lower == 'printing' }}"
# action:
# - service: camera.snapshot
# data:
# entity_id: camera.3d_printer_camera
# filename: "/config/www/downloads/camera/3dprinter/print_latest.jpg"
# - service: notify.telegram
# data_template:
# title: "3D Printer"
# message: "Print Progress"
# data:
# photo:
# - file: "/config/www/downloads/camera/3dprinter/print_latest.jpg"
# caption: "3D Print Progress at {{ states('sensor.octoprint_job_percentage') }}%"

View File

@@ -1,113 +0,0 @@
homeassistant:
customize:
timer.timer_downstairs_aroma:
hidden: true
timer.timer_upstairs_aroma:
hidden: true
timer:
timer_downstairs_aroma:
duration: "01:00:00"
timer_upstairs_aroma:
duration: "01:00:00"
###############################################################################
# _ _ _
# /\ | | | | (_)
# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
# / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \/ __|
# / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | \__ \
# /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_|___/
#
###############################################################################
automation:
- alias: Downstairs Aroma Timer Start
initial_state: true
trigger:
- platform: state
entity_id: switch.downstairs_fragrance
from: "off"
to: "on"
action:
- service: timer.start
entity_id: timer.timer_downstairs_aroma
- alias: Downstairs Aroma Timer Finish
initial_state: true
trigger:
- platform: state
entity_id: switch.downstairs_fragrance
from: "on"
to: "off"
action:
- service: timer.finish
entity_id: timer.timer_downstairs_aroma
- alias: Upstairs Aroma Timer Start
initial_state: true
trigger:
- platform: state
entity_id: switch.upstairs_fragrance
from: "off"
to: "on"
action:
- service: timer.start
entity_id: timer.timer_upstairs_aroma
- alias: Upstairs Aroma Timer Finish
initial_state: true
trigger:
- platform: state
entity_id: switch.upstairs_fragrance
from: "on"
to: "off"
action:
- service: timer.finish
entity_id: timer.timer_upstairs_aroma
#
# Timer Elapsed Events
#
- alias: Downstairs Aroma Timer Elapsed
initial_state: true
trigger:
- platform: event
event_type: timer.finished
event_data:
entity_id: timer.timer_downstairs_aroma
action:
- service: switch.turn_off
entity_id: switch.downstairs_fragrance
- alias: Upstairs Aroma Timer Elapsed
initial_state: true
trigger:
- platform: event
event_type: timer.finished
event_data:
entity_id: timer.timer_upstairs_aroma
action:
- service: switch.turn_off
entity_id: switch.upstairs_fragrance
#
# Turn ON fragrance outlets automatically at specific times of the day
#
- alias: Turn On Upstairs Aroma
trigger:
- platform: time
at: "08:00:00"
- platform: time
at: "20:00:00"
action:
- service: switch.turn_on
entity_id: switch.upstairs_fragrance
- alias: Turn On Downstairs Aroma
trigger:
- platform: time
at: "17:00:00"
action:
- service: switch.turn_on
entity_id: switch.downstairs_fragrance

View File

@@ -1,473 +1,473 @@
###############################################################################
# @author : Mahasri Kalavala
# @date : 04/15/2017
# @package : Batteries
# @description : Status about various baterries (iphones, sensors...etc)
###############################################################################
homeassistant:
customize:
group.batteries:
order: 2
# ###############################################################################
# # @author : Mahasri Kalavala
# # @date : 04/15/2017
# # @package : Batteries
# # @description : Status about various baterries (iphones, sensors...etc)
# ###############################################################################
# homeassistant:
# customize:
# group.batteries:
# order: 2
sensor.suresh_iphone_battery_state:
hidden: true
sensor.mallika_iphone_battery_state:
hidden: true
sensor.srinika_iphone_battery_state:
hidden: true
sensor.hasika_iphone_battery_state:
hidden: true
# sensor.suresh_iphone_battery_state:
# hidden: true
# sensor.mallika_iphone_battery_state:
# hidden: true
# sensor.srinika_iphone_battery_state:
# hidden: true
# sensor.hasika_iphone_battery_state:
# hidden: true
sensor.suresh_iphone_battery_ot:
hidden: true
sensor.mallika_iphone_battery_ot:
hidden: true
sensor.srinika_iphone_battery_ot:
hidden: true
sensor.hasika_iphone_battery_ot:
hidden: true
# sensor.suresh_iphone_battery_ot:
# hidden: true
# sensor.mallika_iphone_battery_ot:
# hidden: true
# sensor.srinika_iphone_battery_ot:
# hidden: true
# sensor.hasika_iphone_battery_ot:
# hidden: true
sensor.hasika_iphone_wifi_state:
friendly_name: Hasika Phone Wi-Fi Status
sensor.mallika_iphone_wifi_state:
friendly_name: Mallika Phone Wi-Fi Status
sensor.srinika_iphone_wifi_state:
friendly_name: Srinika Phone Wi-Fi Status
sensor.suresh_iphone_wifi_state:
friendly_name: Suresh Phone Wi-Fi Status
# sensor.hasika_iphone_wifi_state:
# friendly_name: Hasika Phone Wi-Fi Status
# sensor.mallika_iphone_wifi_state:
# friendly_name: Mallika Phone Wi-Fi Status
# sensor.srinika_iphone_wifi_state:
# friendly_name: Srinika Phone Wi-Fi Status
# sensor.suresh_iphone_wifi_state:
# friendly_name: Suresh Phone Wi-Fi Status
sensor:
- platform: mqtt
state_topic: "owntracks/mallika/mallika"
name: "Mallika iPhone Battery (OT)"
unit_of_measurement: "%"
value_template: "{{ value_json.batt }}"
# sensor:
# - platform: mqtt
# state_topic: "owntracks/mallika/mallika"
# name: "Mallika iPhone Battery (OT)"
# unit_of_measurement: "%"
# value_template: "{{ value_json.batt }}"
- platform: mqtt
state_topic: "owntracks/suresh/suresh"
name: "Suresh iPhone Battery (OT)"
unit_of_measurement: "%"
value_template: "{{ value_json.batt }}"
# - platform: mqtt
# state_topic: "owntracks/suresh/suresh"
# name: "Suresh iPhone Battery (OT)"
# unit_of_measurement: "%"
# value_template: "{{ value_json.batt }}"
- platform: mqtt
state_topic: "owntracks/srinika/srinika"
name: "Srinika iPhone Battery (OT)"
unit_of_measurement: "%"
value_template: "{{ value_json.batt }}"
# - platform: mqtt
# state_topic: "owntracks/srinika/srinika"
# name: "Srinika iPhone Battery (OT)"
# unit_of_measurement: "%"
# value_template: "{{ value_json.batt }}"
- platform: mqtt
state_topic: "owntracks/hasika/hasika"
name: "Hasika iPhone Battery (OT)"
unit_of_measurement: "%"
value_template: "{{ value_json.batt }}"
# - platform: mqtt
# state_topic: "owntracks/hasika/hasika"
# name: "Hasika iPhone Battery (OT)"
# unit_of_measurement: "%"
# value_template: "{{ value_json.batt }}"
- platform: mqtt
state_topic: "owntracks/mallika/mallika"
name: "Mallika iPhone Battery State"
value_template: >
{% if value_json.charging == 1 %}
Charging
{% else %}
Not Charging
{% endif %}
icon: "mdi:battery-charging"
# - platform: mqtt
# state_topic: "owntracks/mallika/mallika"
# name: "Mallika iPhone Battery State"
# value_template: >
# {% if value_json.charging == 1 %}
# Charging
# {% else %}
# Not Charging
# {% endif %}
# icon: "mdi:battery-charging"
- platform: mqtt
state_topic: "owntracks/suresh/suresh"
name: "Suresh iPhone Battery State"
value_template: >
{% if value_json.charging == 1 %}
Charging
{% else %}
Not Charging
{% endif %}
icon: "mdi:battery-charging"
# - platform: mqtt
# state_topic: "owntracks/suresh/suresh"
# name: "Suresh iPhone Battery State"
# value_template: >
# {% if value_json.charging == 1 %}
# Charging
# {% else %}
# Not Charging
# {% endif %}
# icon: "mdi:battery-charging"
- platform: mqtt
state_topic: "owntracks/srinika/srinika"
name: "Srinika iPhone Battery State"
value_template: >
{% if value_json.charging == 1 %}
Charging
{% else %}
Not Charging
{% endif %}
icon: "mdi:battery-charging"
# - platform: mqtt
# state_topic: "owntracks/srinika/srinika"
# name: "Srinika iPhone Battery State"
# value_template: >
# {% if value_json.charging == 1 %}
# Charging
# {% else %}
# Not Charging
# {% endif %}
# icon: "mdi:battery-charging"
- platform: mqtt
state_topic: "owntracks/hasika/hasika"
name: "Hasika iPhone Battery State"
value_template: >
{% if value_json.charging == 1 %}
Charging
{% else %}
Not Charging
{% endif %}
icon: "mdi:battery-charging"
# - platform: mqtt
# state_topic: "owntracks/hasika/hasika"
# name: "Hasika iPhone Battery State"
# value_template: >
# {% if value_json.charging == 1 %}
# Charging
# {% else %}
# Not Charging
# {% endif %}
# icon: "mdi:battery-charging"
- platform: mqtt
state_topic: "owntracks/mallika/mallika"
name: "Mallika iPhone Wifi State"
value_template: >
{% if value_json.conn == "w" %}
Connected
{% else %}
Not Connected
{% endif %}
icon: "mdi:wifi"
# - platform: mqtt
# state_topic: "owntracks/mallika/mallika"
# name: "Mallika iPhone Wifi State"
# value_template: >
# {% if value_json.conn == "w" %}
# Connected
# {% else %}
# Not Connected
# {% endif %}
# icon: "mdi:wifi"
- platform: mqtt
state_topic: "owntracks/suresh/suresh"
name: "Suresh iPhone Wifi State"
value_template: >
{% if value_json.conn == "w" %}
Connected
{% else %}
Not Connected
{% endif %}
icon: "mdi:wifi"
# - platform: mqtt
# state_topic: "owntracks/suresh/suresh"
# name: "Suresh iPhone Wifi State"
# value_template: >
# {% if value_json.conn == "w" %}
# Connected
# {% else %}
# Not Connected
# {% endif %}
# icon: "mdi:wifi"
- platform: mqtt
state_topic: "owntracks/srinika/srinika"
name: "Srinika iPhone Wifi State"
value_template: >
{% if value_json.conn == "w" %}
Connected
{% else %}
Not Connected
{% endif %}
icon: "mdi:wifi"
# - platform: mqtt
# state_topic: "owntracks/srinika/srinika"
# name: "Srinika iPhone Wifi State"
# value_template: >
# {% if value_json.conn == "w" %}
# Connected
# {% else %}
# Not Connected
# {% endif %}
# icon: "mdi:wifi"
- platform: mqtt
state_topic: "owntracks/hasika/hasika"
name: "Hasika iPhone Wifi State"
value_template: >
{% if value_json.conn == "w" %}
Connected
{% else %}
Not Connected
{% endif %}
icon: "mdi:wifi"
# - platform: mqtt
# state_topic: "owntracks/hasika/hasika"
# name: "Hasika iPhone Wifi State"
# value_template: >
# {% if value_json.conn == "w" %}
# Connected
# {% else %}
# Not Connected
# {% endif %}
# icon: "mdi:wifi"
- platform: mqtt
state_topic: "owntracks/mallika/mallika"
name: "Mallika Driving Speed"
value_template: "{{ value_json.vel |int|round}}"
unit_of_measurement: miles
# - platform: mqtt
# state_topic: "owntracks/mallika/mallika"
# name: "Mallika Driving Speed"
# value_template: "{{ value_json.vel |int|round}}"
# unit_of_measurement: miles
- platform: mqtt
state_topic: "owntracks/suresh/suresh"
name: "Suresh Driving Speed"
value_template: "{{ value_json.vel |int|round}}"
unit_of_measurement: miles
# - platform: mqtt
# state_topic: "owntracks/suresh/suresh"
# name: "Suresh Driving Speed"
# value_template: "{{ value_json.vel |int|round}}"
# unit_of_measurement: miles
- platform: mqtt
state_topic: "owntracks/srinika/srinika"
name: "Srinika Driving Speed"
value_template: "{{ value_json.vel |int|round}}"
unit_of_measurement: miles
# - platform: mqtt
# state_topic: "owntracks/srinika/srinika"
# name: "Srinika Driving Speed"
# value_template: "{{ value_json.vel |int|round}}"
# unit_of_measurement: miles
- platform: mqtt
state_topic: "owntracks/hasika/hasika"
name: "Hasika Driving Speed"
value_template: "{{ value_json.vel |int|round}}"
unit_of_measurement: miles
# - platform: mqtt
# state_topic: "owntracks/hasika/hasika"
# name: "Hasika Driving Speed"
# value_template: "{{ value_json.vel |int|round}}"
# unit_of_measurement: miles
- platform: template
sensors:
suresh_iphone_battery_ot:
unit_of_measurement: "%"
value_template: >
{% if states('sensor.suresh_iphone_battery_ot') != "unknown" %}
{{ states('sensor.suresh_iphone_battery_ot')| int }}
{% else %}
0
{% endif %}
icon_template: >-
{% if states('sensor.suresh_iphone_battery_ot') != "unknown" %}
{% set battery_level = states('sensor.suresh_iphone_battery_ot')|int (-1)%}
{% set battery_round = (battery_level|int / 10)|int * 10 %}
{% if states('sensor.suresh_iphone_battery_state') | lower == "charging" %}
{% if battery_level == -1 %}
mdi:battery-unknown
{% else %}
{% if battery_round >= 100 %}
mdi:battery-charging-100
{% elif battery_round > 0 %}
mdi:battery-charging-{{ battery_round }}
{% else %}
mdi:battery-alert
{% endif %}
{% endif %}
{% else %}
{% if battery_level == -1 %}
mdi:battery-unknown
{% else %}
{% if battery_round >= 100 %}
mdi:battery
{% elif battery_round > 0 %}
mdi:battery-{{ battery_round }}
{% else %}
mdi:battery-alert
{% endif %}
{% endif %}
{% endif %}
{% else %}
mdi:battery-alert
{% endif %}
# - platform: template
# sensors:
# suresh_iphone_battery_ot:
# unit_of_measurement: "%"
# value_template: >
# {% if states('sensor.suresh_iphone_battery_ot') != "unknown" %}
# {{ states('sensor.suresh_iphone_battery_ot')| int }}
# {% else %}
# 0
# {% endif %}
# icon_template: >-
# {% if states('sensor.suresh_iphone_battery_ot') != "unknown" %}
# {% set battery_level = states('sensor.suresh_iphone_battery_ot')|int (-1)%}
# {% set battery_round = (battery_level|int / 10)|int * 10 %}
# {% if states('sensor.suresh_iphone_battery_state') | lower == "charging" %}
# {% if battery_level == -1 %}
# mdi:battery-unknown
# {% else %}
# {% if battery_round >= 100 %}
# mdi:battery-charging-100
# {% elif battery_round > 0 %}
# mdi:battery-charging-{{ battery_round }}
# {% else %}
# mdi:battery-alert
# {% endif %}
# {% endif %}
# {% else %}
# {% if battery_level == -1 %}
# mdi:battery-unknown
# {% else %}
# {% if battery_round >= 100 %}
# mdi:battery
# {% elif battery_round > 0 %}
# mdi:battery-{{ battery_round }}
# {% else %}
# mdi:battery-alert
# {% endif %}
# {% endif %}
# {% endif %}
# {% else %}
# mdi:battery-alert
# {% endif %}
- platform: template
sensors:
mallika_iphone_battery_ot:
unit_of_measurement: "%"
value_template: "{{ states('sensor.mallika_iphone_battery_ot')|int(-1) }}"
icon_template: >-
{% if states('sensor.mallika_iphone_battery_ot') != "unknown" %}
{% set battery_level = states('sensor.mallika_iphone_battery_ot')|int (-1)%}
{% set battery_round = (battery_level|int / 10)|int * 10 %}
{% if states('sensor.mallika_iphone_battery_state') | lower == "charging" %}
{% if battery_level == -1 %}
mdi:battery-unknown
{% else %}
{% if battery_round >= 100 %}
mdi:battery-charging-100
{% elif battery_round > 0 %}
mdi:battery-charging-{{ battery_round }}
{% else %}
mdi:battery-alert
{% endif %}
{% endif %}
{% else %}
{% if battery_level == -1 %}
mdi:battery-unknown
{% else %}
{% if battery_round >= 100 %}
mdi:battery
{% elif battery_round > 0 %}
mdi:battery-{{ battery_round }}
{% else %}
mdi:battery-alert
{% endif %}
{% endif %}
{% endif %}
{% else %}
mdi:battery-alert
{% endif %}
# - platform: template
# sensors:
# mallika_iphone_battery_ot:
# unit_of_measurement: "%"
# value_template: "{{ states('sensor.mallika_iphone_battery_ot')|int(-1) }}"
# icon_template: >-
# {% if states('sensor.mallika_iphone_battery_ot') != "unknown" %}
# {% set battery_level = states('sensor.mallika_iphone_battery_ot')|int (-1)%}
# {% set battery_round = (battery_level|int / 10)|int * 10 %}
# {% if states('sensor.mallika_iphone_battery_state') | lower == "charging" %}
# {% if battery_level == -1 %}
# mdi:battery-unknown
# {% else %}
# {% if battery_round >= 100 %}
# mdi:battery-charging-100
# {% elif battery_round > 0 %}
# mdi:battery-charging-{{ battery_round }}
# {% else %}
# mdi:battery-alert
# {% endif %}
# {% endif %}
# {% else %}
# {% if battery_level == -1 %}
# mdi:battery-unknown
# {% else %}
# {% if battery_round >= 100 %}
# mdi:battery
# {% elif battery_round > 0 %}
# mdi:battery-{{ battery_round }}
# {% else %}
# mdi:battery-alert
# {% endif %}
# {% endif %}
# {% endif %}
# {% else %}
# mdi:battery-alert
# {% endif %}
- platform: template
sensors:
srinika_iphone_battery_ot:
unit_of_measurement: "%"
value_template: "{{ states('sensor.srinika_iphone_battery_ot')|int(-1) }}"
icon_template: >-
{% if states('sensor.srinika_iphone_battery_ot') != "unknown" %}
{% set battery_level = states('sensor.srinika_iphone_battery_ot')|int (-1)%}
{% set battery_round = (battery_level|int / 10)|int * 10 %}
{% if states('sensor.srinika_iphone_battery_state') | lower == "charging" %}
{% if battery_level == -1 %}
mdi:battery-unknown
{% else %}
{% if battery_round >= 100 %}
mdi:battery-charging-100
{% elif battery_round > 0 %}
mdi:battery-charging-{{ battery_round }}
{% else %}
mdi:battery-alert
{% endif %}
{% endif %}
{% else %}
{% if battery_level == -1 %}
mdi:battery-unknown
{% else %}
{% if battery_round >= 100 %}
mdi:battery
{% elif battery_round > 0 %}
mdi:battery-{{ battery_round }}
{% else %}
mdi:battery-alert
{% endif %}
{% endif %}
{% endif %}
{% else %}
mdi:battery-alert
{% endif %}
# - platform: template
# sensors:
# srinika_iphone_battery_ot:
# unit_of_measurement: "%"
# value_template: "{{ states('sensor.srinika_iphone_battery_ot')|int(-1) }}"
# icon_template: >-
# {% if states('sensor.srinika_iphone_battery_ot') != "unknown" %}
# {% set battery_level = states('sensor.srinika_iphone_battery_ot')|int (-1)%}
# {% set battery_round = (battery_level|int / 10)|int * 10 %}
# {% if states('sensor.srinika_iphone_battery_state') | lower == "charging" %}
# {% if battery_level == -1 %}
# mdi:battery-unknown
# {% else %}
# {% if battery_round >= 100 %}
# mdi:battery-charging-100
# {% elif battery_round > 0 %}
# mdi:battery-charging-{{ battery_round }}
# {% else %}
# mdi:battery-alert
# {% endif %}
# {% endif %}
# {% else %}
# {% if battery_level == -1 %}
# mdi:battery-unknown
# {% else %}
# {% if battery_round >= 100 %}
# mdi:battery
# {% elif battery_round > 0 %}
# mdi:battery-{{ battery_round }}
# {% else %}
# mdi:battery-alert
# {% endif %}
# {% endif %}
# {% endif %}
# {% else %}
# mdi:battery-alert
# {% endif %}
- platform: template
sensors:
hasika_iphone_battery_ot:
unit_of_measurement: "%"
value_template: "{{ states('sensor.hasika_iphone_battery_ot')|int(-1) }}"
icon_template: >-
{% if states('sensor.hasika_iphone_battery_ot') != "unknown" %}
{% set battery_level = states('sensor.hasika_iphone_battery_ot')|int (-1)%}
{% set battery_round = (battery_level|int / 10)|int * 10 %}
{% if states('sensor.hasika_iphone_battery_state') | lower == "charging" %}
{% if battery_level == -1 %}
mdi:battery-unknown
{% else %}
{% if battery_round >= 100 %}
mdi:battery-charging-100
{% elif battery_round > 0 %}
mdi:battery-charging-{{ battery_round }}
{% else %}
mdi:battery-alert
{% endif %}
{% endif %}
{% else %}
{% if battery_level == -1 %}
mdi:battery-unknown
{% else %}
{% if battery_round >= 100 %}
mdi:battery
{% elif battery_round > 0 %}
mdi:battery-{{ battery_round }}
{% else %}
mdi:battery-alert
{% endif %}
{% endif %}
{% endif %}
{% else %}
mdi:battery-alert
{% endif %}
# - platform: template
# sensors:
# hasika_iphone_battery_ot:
# unit_of_measurement: "%"
# value_template: "{{ states('sensor.hasika_iphone_battery_ot')|int(-1) }}"
# icon_template: >-
# {% if states('sensor.hasika_iphone_battery_ot') != "unknown" %}
# {% set battery_level = states('sensor.hasika_iphone_battery_ot')|int (-1)%}
# {% set battery_round = (battery_level|int / 10)|int * 10 %}
# {% if states('sensor.hasika_iphone_battery_state') | lower == "charging" %}
# {% if battery_level == -1 %}
# mdi:battery-unknown
# {% else %}
# {% if battery_round >= 100 %}
# mdi:battery-charging-100
# {% elif battery_round > 0 %}
# mdi:battery-charging-{{ battery_round }}
# {% else %}
# mdi:battery-alert
# {% endif %}
# {% endif %}
# {% else %}
# {% if battery_level == -1 %}
# mdi:battery-unknown
# {% else %}
# {% if battery_round >= 100 %}
# mdi:battery
# {% elif battery_round > 0 %}
# mdi:battery-{{ battery_round }}
# {% else %}
# mdi:battery-alert
# {% endif %}
# {% endif %}
# {% endif %}
# {% else %}
# mdi:battery-alert
# {% endif %}
###############################################################################
# _ _ _
# /\ | | | | (_)
# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
# / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \/ __|
# / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | \__ \
# /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_|___/
#
###############################################################################
# ###############################################################################
# # _ _ _
# # /\ | | | | (_)
# # / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
# # / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \/ __|
# # / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | \__ \
# # /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_|___/
# #
# ###############################################################################
automation:
#
# This automation alerts family members when they are "moving" - meaning either in driving from work,
# kids got on the school bus, and bus is moving...etc
# This will only announces/ alert when someone is at home.
#
- alias: Alert When Moving
trigger:
platform: numeric_state
entity_id:
- sensor.suresh_driving_speed
- sensor.mallika_driving_speed
- sensor.srinika_driving_speed
- sensor.hasika_driving_speed
above: 8
condition:
- condition: template
value_template: >
{%- if state_attr('automation.alert_when_moving', 'last_triggered') -%}
{{ (as_timestamp(now()) - as_timestamp(state_attr('automation.alert_when_moving', 'last_triggered'))) > 300 }}
{%- else -%}
true
{%- endif -%}
- condition: template
value_template: "{{ states('input_boolean.home_mode_away') == 'off' }}"
- condition: template
value_template: "{{ states('alarm_control_panel.home') | lower != 'armed_away' }}"
action:
- service: script.voice_notify
data_template:
message: >-
{% set apostrophe = "\'" %}
{{ trigger.entity_id.split('.')[1].split('_')[0] |title ~ apostrophe ~ 's' }} vehicle is in motion.
- service: script.notify_me
data_template:
message: >-
{% set apostrophe = "\'" %}
{{ trigger.entity_id.split('.')[1].split('_')[0] |title ~ apostrophe ~ 's' }} vehicle is going at {{ trigger.to_state.state |round *2 }} mph.
# automation:
# #
# # This automation alerts family members when they are "moving" - meaning either in driving from work,
# # kids got on the school bus, and bus is moving...etc
# # This will only announces/ alert when someone is at home.
# #
# - alias: Alert When Moving
# trigger:
# platform: numeric_state
# entity_id:
# - sensor.suresh_driving_speed
# - sensor.mallika_driving_speed
# - sensor.srinika_driving_speed
# - sensor.hasika_driving_speed
# above: 8
# condition:
# - condition: template
# value_template: >
# {%- if state_attr('automation.alert_when_moving', 'last_triggered') -%}
# {{ (as_timestamp(now()) - as_timestamp(state_attr('automation.alert_when_moving', 'last_triggered'))) > 300 }}
# {%- else -%}
# true
# {%- endif -%}
# - condition: template
# value_template: "{{ states('input_boolean.home_mode_away') == 'off' }}"
# - condition: template
# value_template: "{{ states('alarm_control_panel.home') | lower != 'armed_away' }}"
# action:
# - service: script.voice_notify
# data_template:
# message: >-
# {% set apostrophe = "\'" %}
# {{ trigger.entity_id.split('.')[1].split('_')[0] |title ~ apostrophe ~ 's' }} vehicle is in motion.
# - service: script.notify_me
# data_template:
# message: >-
# {% set apostrophe = "\'" %}
# {{ trigger.entity_id.split('.')[1].split('_')[0] |title ~ apostrophe ~ 's' }} vehicle is going at {{ trigger.to_state.state |round *2 }} mph.
###############################################################################
# Automation: Notify of iPhone Low Battery
###############################################################################
- alias: Notify Low battery
initial_state: true
trigger:
platform: numeric_state
entity_id:
- device_tracker.life360_suresh
- device_tracker.life360_mallika
- device_tracker.life360_srinika
- device_tracker.life360_hasika
value_template: "{{ state.attributes.battery }}"
below: 25
condition:
- condition: template
value_template: "{{ states('input_boolean.battery_notifications') == 'on' }}"
action:
- service: script.notify_me
data_template:
message: "{{ trigger.to_state.attributes.friendly_name.split(' ')[1] | title }}'s phone battery is : {{ trigger.to_state.attributes.battery }}%."
- 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 }}%."
# ###############################################################################
# # Automation: Notify of iPhone Low Battery
# ###############################################################################
# - alias: Notify Low battery
# initial_state: true
# trigger:
# platform: numeric_state
# entity_id:
# - device_tracker.suresh
# - device_tracker.mallika
# - device_tracker.srinika
# - device_tracker.hasika
# value_template: "{{ state.attributes.battery }}"
# below: 25
# condition:
# - condition: template
# value_template: "{{ states('input_boolean.battery_notifications') == 'on' }}"
# action:
# - service: script.notify_me
# data_template:
# message: "{{ trigger.to_state.attributes.friendly_name.split(' ')[1] | title }}'s phone battery is : {{ trigger.to_state.attributes.battery }}%."
# - 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:
# - platform: template
# value_template: >
# {% set ns = namespace(lowBattery=false) %}
# {%- for x in states if x.attributes and x.attributes.battery_level and x.attributes.battery_level |int <= 24 %}
# {% set ns.lowBattery = true %}{% endfor %}
# {{ ns.lowBattery }}
# condition:
# - condition: template
# value_template: "{{ ((trigger.to_state.state | int) < states('sensor.battery_alert_threshold') | int) }}"
# action:
# - service: script.voice_notify
# data_template:
# message: >
# {% 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 == 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 }}%."
# # - alias: Alert Low Battery
# # trigger:
# # - platform: template
# # value_template: >
# # {% set ns = namespace(lowBattery=false) %}
# # {%- for x in states if x.attributes and x.attributes.battery_level and x.attributes.battery_level |int <= 24 %}
# # {% set ns.lowBattery = true %}{% endfor %}
# # {{ ns.lowBattery }}
# # condition:
# # - condition: template
# # value_template: "{{ ((trigger.to_state.state | int) < states('sensor.battery_alert_threshold') | int) }}"
# # action:
# # - service: script.voice_notify
# # data_template:
# # message: >
# # {% 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 == 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 }}%."
- alias: Check Wi-Fi Status of iPhones At Home
initial_state: true
trigger:
- platform: state
entity_id:
- device_tracker.life360_mallika
- device_tracker.life360_suresh
- device_tracker.life360_srinika
- device_tracker.life360_hasika
from: "not_home"
to: "home"
for: "00:05:00"
condition:
condition: or
conditions:
- condition: state
entity_id: sensor.hasika_iphone_wifi_state
state: "Not Connected"
- condition: state
entity_id: sensor.mallika_iphone_wifi_state
state: "Not Connected"
- condition: state
entity_id: sensor.srinika_iphone_wifi_state
state: "Not Connected"
- condition: state
entity_id: sensor.suresh_iphone_wifi_state
state: "Not Connected"
action:
- service: script.notify_me
data_template:
message: >
{% set member = trigger.entity_id.split('.')[1].split('_')[0] %}
{{ member | title }}'s iPhone is not connected to Wi-Fi at home!
- service: script.voice_notify
data_template:
message: >
{% set member = trigger.entity_id.split('.')[1].split('_')[0] %}
{{ member | title }}'s iPhone is not connected to Wi-Fi at home!
# - alias: Check Wi-Fi Status of iPhones At Home
# initial_state: true
# trigger:
# - platform: state
# entity_id:
# - device_tracker.mallika
# - device_tracker.suresh
# - device_tracker.srinika
# - device_tracker.hasika
# from: "not_home"
# to: "home"
# for: "00:05:00"
# condition:
# condition: or
# conditions:
# - condition: state
# entity_id: sensor.hasika_iphone_wifi_state
# state: "Not Connected"
# - condition: state
# entity_id: sensor.mallika_iphone_wifi_state
# state: "Not Connected"
# - condition: state
# entity_id: sensor.srinika_iphone_wifi_state
# state: "Not Connected"
# - condition: state
# entity_id: sensor.suresh_iphone_wifi_state
# state: "Not Connected"
# action:
# - service: script.notify_me
# data_template:
# message: >
# {% set member = trigger.entity_id.split('.')[1].split('_')[0] %}
# {{ member | title }}'s iPhone is not connected to Wi-Fi at home!
# - service: script.voice_notify
# data_template:
# message: >
# {% set member = trigger.entity_id.split('.')[1].split('_')[0] %}
# {{ member | title }}'s iPhone is not connected to Wi-Fi at home!

View File

@@ -13,6 +13,7 @@ homeassistant:
# frontdoor_camera_url: http://username:password@192.168.xxx.xxx/ISAPI/Streaming/channels/101/picture
#
camera:
- platform: generic
name: Frontdoor Camera
still_image_url: !secret frontdoor_camera_url
@@ -58,9 +59,12 @@ camera:
# input: porch_camera_rtsp_url
# name: Porch Camera
- platform: mjpeg
mjpeg_url: !secret garage_camera_url
name: Garage Camera
# - platform: mjpeg
# mjpeg_url: !secret garage_camera_url
# name: Garage Camera
# add amcrest cameras
- platform: amcrest
- platform: local_file
name: Frontdoor Latest Scan
@@ -87,6 +91,16 @@ camera:
shell_command:
reset_camera_stream: !secret camera_stream_restart_docker_url
# Amcrest Camera Model IP8M-T2669EW-AI
amcrest:
- host: !secret amcrest_front_camera_ip
username: !secret amcrest_front_camera_username
password: !secret amcrest_front_camera_password
binary_sensors:
- motion_detected
- crossline_detected
- online
switch:
- platform: rest
resource: !secret camera_stream_docker_url
@@ -132,22 +146,46 @@ binary_sensor:
payload_off: "OFF"
value_template: "{{ value }}"
# image_processing:
# - platform: tensorflow
# scan_interval: 10000
# source:
# - entity_id: camera.frontdoor_camera
# - entity_id: camera.driveway_camera
# - entity_id: camera.patio_camera
# - entity_id: camera.playarea_camera
# - entity_id: camera.garage_camera
# - entity_id: camera.3d_printer_camera
# - entity_id: camera.porch_camera
# file_out:
# - "/config/www/downloads/camera/{{- camera_entity.split('.')[1].split('_')[0] -}}/{{ camera_entity.split('.')[1].split('_')[0] }}_latest.jpg"
# - "/config/www/downloads/camera/{{- camera_entity.split('.')[1].split('_')[0] -}}/{{ camera_entity.split('.')[1].split('_')[0] }}_{{ now().strftime('%Y%m%d_%H%M%S') }}.jpg"
# model:
# graph: /config/tensorflow/models/efficientdet_d0_coco17_tpu-32/
image_processing:
- platform: tensorflow
- platform: doods
scan_interval: 10000
url: !secret doods_server_url
detector: tensorflow
source:
- entity_id: camera.frontdoor_camera
- entity_id: camera.driveway_camera
- entity_id: camera.patio_camera
- entity_id: camera.playarea_camera
- entity_id: camera.garage_camera
- entity_id: camera.garage
- entity_id: camera.3d_printer_camera
- entity_id: camera.porch_camera
file_out:
- "/config/www/downloads/camera/{{- camera_entity.split('.')[1].split('_')[0] -}}/{{ camera_entity.split('.')[1].split('_')[0] }}_latest.jpg"
- "/config/www/downloads/camera/{{- camera_entity.split('.')[1].split('_')[0] -}}/{{ camera_entity.split('.')[1].split('_')[0] }}_{{ now().strftime('%Y%m%d_%H%M%S') }}.jpg"
model:
graph: /config/tensorflow/models/efficientdet_d0_coco17_tpu-32/
labels:
- name: person
confidence: 75
- name: car
confidence: 90
- name: truck
confidence: 90
input_label:
current_stream:
@@ -240,7 +278,7 @@ automation:
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- service: image_processing.scan
data_template:
entity_id: image_processing.tensorflow_porch_camera
entity_id: image_processing.doods_porch_camera
#
# Scan front door and driveway cameras when motion detected
@@ -261,14 +299,14 @@ automation:
value_template: "{{ states('alarm_control_panel.home') == 'armed_home' or states('alarm_control_panel.home') == 'armed_away' }}"
- service: image_processing.scan
data_template:
entity_id: image_processing.tensorflow_frontdoor_camera
entity_id: image_processing.doods_frontdoor_camera
- service: image_processing.scan
data_template:
entity_id: image_processing.tensorflow_driveway_camera
entity_id: image_processing.doods_driveway_camera
- condition: template
value_template: >-
{% if state_attr('image_processing.tensorflow_frontdoor_camera', 'summary') != None %}
{% if state_attr('image_processing.tensorflow_frontdoor_camera', 'summary') |count > 0 %}
{% if state_attr('image_processing.doods_frontdoor_camera', 'summary') != None %}
{% if state_attr('image_processing.doods_frontdoor_camera', 'summary') |count > 0 %}
true
{% else %}
false
@@ -280,7 +318,7 @@ automation:
- service: script.voice_notify
data_template:
message: >-
{%- set e_id = "image_processing.tensorflow_frontdoor_camera" -%}
{%- set e_id = "image_processing.doods_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 -%}
@@ -295,7 +333,7 @@ automation:
data_template:
title: 'Front door motion {{ now().strftime("%d %h %Y, %I:%M:%S %p") }}'
message: >
{%- set e_id = "image_processing.tensorflow_frontdoor_camera" -%}
{%- set e_id = "image_processing.doods_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 -%}
@@ -314,7 +352,7 @@ automation:
data_template:
title: "Front Door Motion"
message: >
{%- set e_id = "image_processing.tensorflow_frontdoor_camera" -%}
{%- set e_id = "image_processing.doods_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 -%}
@@ -338,7 +376,7 @@ automation:
{% endif %}
- service: image_processing.scan
data_template:
entity_id: image_processing.tensorflow_garage_camera
entity_id: image_processing.doods_garage
#
# Scan driveway and frontdoor cameras when motion detected
# if the garage doors are open, scan garage cameras as well
@@ -361,14 +399,14 @@ automation:
value_template: "{{ states('alarm_control_panel.home') == 'armed_home' or states('alarm_control_panel.home') == 'armed_away' }}"
- service: image_processing.scan
data_template:
entity_id: image_processing.tensorflow_driveway_camera
entity_id: image_processing.doods_driveway_camera
- service: image_processing.scan
data_template:
entity_id: image_processing.tensorflow_frontdoor_camera
entity_id: image_processing.doods_frontdoor_camera
- condition: template
value_template: >-
{% if state_attr('image_processing.tensorflow_driveway_camera', 'summary') != None %}
{% if state_attr('image_processing.tensorflow_driveway_camera', 'summary') |count > 0 %}
{% if state_attr('image_processing.doods_driveway_camera', 'summary') != None %}
{% if state_attr('image_processing.doods_driveway_camera', 'summary') |count > 0 %}
true
{% else %}
false
@@ -380,7 +418,7 @@ automation:
- service: script.voice_notify
data_template:
message: >-
{%- set e_id = "image_processing.tensorflow_driveway_camera" -%}
{%- set e_id = "image_processing.doods_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 -%}
@@ -394,7 +432,7 @@ automation:
data_template:
title: "Driveway Motion"
message: >
{%- set e_id = "image_processing.tensorflow_driveway_camera" -%}
{%- set e_id = "image_processing.doods_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 -%}
@@ -412,7 +450,7 @@ automation:
data_template:
title: 'Driveway motion {{ now().strftime("%d %h %Y, %I:%M:%S %p") }}'
message: >
{%- set e_id = "image_processing.tensorflow_driveway_camera" -%}
{%- set e_id = "image_processing.doods_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 -%}
@@ -438,7 +476,7 @@ automation:
- service: image_processing.scan
data_template:
entity_id: image_processing.tensorflow_garage_camera
entity_id: image_processing.doods_garage
#
# When motion detected in garage, scan garage camera
@@ -459,7 +497,7 @@ automation:
action:
- service: image_processing.scan
data_template:
entity_id: image_processing.tensorflow_garage_camera
entity_id: image_processing.doods_garage
- condition: template
value_template: >
{% if states('binary_sensor.door_window_sensor_158d0004248d5b') == "on" or
@@ -470,14 +508,14 @@ automation:
{% endif %}
- service: image_processing.scan
data_template:
entity_id: image_processing.tensorflow_driveway_camera
entity_id: image_processing.doods_driveway_camera
- service: image_processing.scan
data_template:
entity_id: image_processing.tensorflow_frontdoor_camera
entity_id: image_processing.doods_frontdoor_camera
- condition: template
value_template: >-
{% if state_attr('image_processing.tensorflow_garage_camera', 'summary') != None %}
{% if state_attr('image_processing.tensorflow_garage_camera', 'summary') |count > 0 %}
{% if state_attr('image_processing.doods_garage', 'summary') != None %}
{% if state_attr('image_processing.doods_garage', 'summary') |count > 0 %}
true
{% else %}
false
@@ -489,7 +527,7 @@ automation:
- service: script.voice_notify
data_template:
message: >-
{%- set e_id = "image_processing.tensorflow_garage_camera" -%}
{%- set e_id = "image_processing.doods_garage" -%}
{%- if state_attr(e_id, 'summary') -%}
{%- set count = state_attr(e_id, 'summary') | count -%}
{%- for x in state_attr(e_id, 'summary') | list -%}
@@ -503,7 +541,7 @@ automation:
data_template:
title: "Garage Motion"
message: >
{%- set e_id = "image_processing.tensorflow_garage_camera" -%}
{%- set e_id = "image_processing.doods_garage" -%}
{%- if state_attr(e_id, 'summary') -%}
{%- set count = state_attr(e_id, 'summary') | count -%}
{%- for x in state_attr(e_id, 'summary') | list -%}
@@ -521,7 +559,7 @@ automation:
data_template:
title: 'Garage motion {{ now().strftime("%d %h %Y, %I:%M:%S %p") }}'
message: >
{%- set e_id = "image_processing.tensorflow_garage_camera" -%}
{%- set e_id = "image_processing.doods_garage" -%}
{%- if state_attr(e_id, 'summary') -%}
{%- set count = state_attr(e_id, 'summary') | count -%}
{%- for x in state_attr(e_id, 'summary') | list -%}
@@ -556,14 +594,14 @@ automation:
value_template: "{{ states('alarm_control_panel.home') == 'armed_home' or states('alarm_control_panel.home') == 'armed_away' }}"
- service: image_processing.scan
data_template:
entity_id: image_processing.tensorflow_patio_camera
entity_id: image_processing.doods_patio_camera
- service: image_processing.scan
data_template:
entity_id: image_processing.tensorflow_playarea_camera
entity_id: image_processing.doods_playarea_camera
- condition: template
value_template: >-
{% if state_attr('image_processing.tensorflow_patio_camera', 'summary') != None %}
{% if state_attr('image_processing.tensorflow_patio_camera', 'summary') |count > 0 %}
{% if state_attr('image_processing.doods_patio_camera', 'summary') != None %}
{% if state_attr('image_processing.doods_patio_camera', 'summary') |count > 0 %}
true
{% else %}
false
@@ -575,7 +613,7 @@ automation:
- service: script.voice_notify
data_template:
message: >-
{%- set e_id = "image_processing.tensorflow_patio_camera" -%}
{%- set e_id = "image_processing.doods_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 -%}
@@ -589,7 +627,7 @@ automation:
data_template:
title: "Backyardge Motion"
message: >
{%- set e_id = "image_processing.tensorflow_patio_camera" -%}
{%- set e_id = "image_processing.doods_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 -%}
@@ -607,7 +645,7 @@ automation:
data_template:
title: 'Backyard motion {{ now().strftime("%d %h %Y, %I:%M:%S %p") }}'
message: >
{%- set e_id = "image_processing.tensorflow_patio_camera" -%}
{%- set e_id = "image_processing.doods_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 -%}
@@ -693,7 +731,7 @@ automation:
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- service: camera.snapshot
data_template:
entity_id: "camera.garage_camera"
entity_id: "camera.garage"
filename:
"{{ '/config/www/downloads/camera/garage/garage_' ~
(states.binary_sensor.motion_sensor_158d00024ee084.last_updated ~ '').replace('-','_')
@@ -742,7 +780,7 @@ automation:
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- condition: template
value_template: "{{ states('device_tracker.life360_suresh') == 'home' }}"
value_template: "{{ states('device_tracker.suresh') == 'home' }}"
- service: notify.ios_devices
data_template:
@@ -792,7 +830,7 @@ automation:
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- service: camera.snapshot
data_template:
entity_id: "camera.garage_camera"
entity_id: "camera.garage"
filename:
"{{ '/config/www/downloads/camera/garage/garage_' ~
(states.binary_sensor.motion_sensor_158d00024e57fb.last_updated ~ '').replace('-','_')
@@ -834,7 +872,7 @@ automation:
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- condition: template
value_template: "{{ states('device_tracker.life360_suresh') == 'home' }}"
value_template: "{{ states('device_tracker.suresh') == 'home' }}"
- service: notify.ios_devices
data_template:
message: "Check Driveway camera!"
@@ -869,8 +907,8 @@ automation:
action:
- condition: template
value_template: >-
{% if state_attr('image_processing.tensorflow_frontdoor_camera', 'summary') != None %}
{% if state_attr('image_processing.tensorflow_frontdoor_camera', 'summary') |count > 0 %}
{% if state_attr('image_processing.doods_frontdoor_camera', 'summary') != None %}
{% if state_attr('image_processing.doods_frontdoor_camera', 'summary') |count > 0 %}
true
{% else %}
false
@@ -924,7 +962,7 @@ automation:
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- condition: template
value_template: "{{ states('device_tracker.life360_suresh') == 'home' }}"
value_template: "{{ states('device_tracker.suresh') == 'home' }}"
- service: notify.ios_devices
data_template:
message: "Check Patio camera!"

View File

@@ -1,409 +0,0 @@
# #
# # I COMMENTED OUT ALL THE TAGBOX RELATED STUFF AS I USE TENSORFLOW COMPONENT FOR IT.
# #
# homeassistant:
# customize:
# image_processing.facebox_frontdoor_camera:
# friendly_name: People @ Front Door
# image_processing.facebox_driveway_camera:
# friendly_name: People @ Driveway
# image_processing.facebox_patio_camera:
# friendly_name: People @ Patio
# image_processing.facebox_playarea_camera:
# friendly_name: People @ Playarea
# image_processing.facebox_garage_camera:
# friendly_name: People @ Garage
# image_processing.tagbox_frontdoor_camera:
# friendly_name: Frontdoor Tag
# image_processing.tagbox_driveway_camera:
# friendly_name: Driveway Tag
# image_processing.tagbox_playarea_camera:
# friendly_name: Playarea Tag
# image_processing.tagbox_patio_camera:
# friendly_name: Patio Tag
# image_processing.tagbox_garage_camera:
# friendly_name: Garage Tag
# sensor.frontdoor_camera_objects:
# friendly_name: Things At Front Door
# sensor.driveway_camera_objects:
# friendly_name: Things At Driveway
# sensor.playarea_camera_objects:
# friendly_name: Things At Playarea
# sensor.patio_camera_objects:
# friendly_name: Things At Patio
# sensor.garage_camera_objects:
# friendly_name: Things in Garage
# sensor.frontdoor_camera_people:
# friendly_name: People At Front Door
# sensor.driveway_camera_people:
# friendly_name: People Driveway
# sensor.playarea_camera_people:
# friendly_name: People Playarea
# sensor.patio_camera_people:
# friendly_name: People Patio
# sensor.garage_camera_people:
# friendly_name: Garage Patio
# image_processing:
# - platform: facebox
# ip_address: !secret ha_ip_address
# scan_interval: 360
# port: 8080
# source:
# - entity_id: camera.frontdoor_camera
# - entity_id: camera.driveway_camera
# - entity_id: camera.patio_camera
# - entity_id: camera.playarea_camera
# - entity_id: camera.garage_camera
# # - platform: tagbox
# # scan_interval: 10000 # Default 10
# # ip_address: !secret ha_ip_address
# # port: 8081
# # source:
# # - entity_id: camera.frontdoor_camera
# # - entity_id: camera.driveway_camera
# # - entity_id: camera.patio_camera
# # - entity_id: camera.playarea_camera
# # - entity_id: camera.garage_camera
# sensor:
# ##
# #Facebox related sensors
# ##
# - platform: template
# sensors:
# frontdoor_camera_people:
# value_template: >-
# {% set faces = state_attr('image_processing.facebox_frontdoor_camera', 'matched_faces') %}
# {% if None != faces %}
# {% if faces | list | count == 0 %}
# Clear
# {% else %}
# {%- for face in faces | list %}{%- if loop.first %}{% elif loop.last %} and {% else %}, {% endif -%}{{ face }}{%- endfor %}
# {% endif %}
# {% endif %}
# icon_template: mdi:cctv
# - platform: template
# sensors:
# driveway_camera_people:
# value_template: >-
# {% set faces = state_attr('image_processing.facebox_driveway_camera', 'matched_faces') %}
# {% if None != faces %}
# {% if faces | list | count == 0 %}
# Clear
# {% else %}
# {%- for face in faces | list %}{%- if loop.first %}{% elif loop.last %} and {% else %}, {% endif -%}{{ face }}{%- endfor %}
# {% endif %}
# {% endif %}
# icon_template: mdi:cctv
# - platform: template
# sensors:
# patio_camera_people:
# value_template: >-
# {% set faces = state_attr('image_processing.facebox_patio_camera', 'matched_faces') %}
# {% if None != faces %}
# {% if faces | list | count == 0 %}
# Clear
# {% else %}
# {%- for face in faces | list %}{%- if loop.first %}{% elif loop.last %} and {% else %}, {% endif -%}{{ face }}{%- endfor %}
# {% endif %}
# {% endif %}
# icon_template: mdi:cctv
# - platform: template
# sensors:
# playarea_camera_people:
# value_template: >-
# {% set faces = state_attr('image_processing.facebox_playarea_camera', 'matched_faces') %}
# {% if None != faces %}
# {% if faces | list | count == 0 %}
# Clear
# {% else %}
# {%- for face in faces | list %}{%- if loop.first %}{% elif loop.last %} and {% else %}, {% endif -%}{{ face }}{%- endfor %}
# {% endif %}
# {% endif %}
# icon_template: mdi:cctv
# - platform: template
# sensors:
# garage_camera_people:
# value_template: >-
# {% set faces = state_attr('image_processing.facebox_garage_camera', 'matched_faces') %}
# {% if None != faces %}
# {% if faces | list | count == 0 %}
# Clear
# {% else %}
# {%- for face in faces | list %}{%- if loop.first %}{% elif loop.last %} and {% else %}, {% endif -%}{{ face }}{%- endfor %}
# {% endif %}
# {% endif %}
# icon_template: mdi:cctv
# # ###########################################################################################################################
# # # Tagbox related Sensors; Please don't go crazy looking at the code. Here is the simple explanation.
# # # The tagbox gives a bunch of tags for each picture, and I eliminate a bunch of unwanted tags by filtering them out
# # # The unwanted tags are something that I really don't care - like a Tree in the front yard.
# # # Then I do custom mapping of the tags that fits my needs. That way I can display what I want rather than what I was given.
# # # I have no control over what tagbox gives, I want to pick and choose tags irrespective of confidence level.
# # ###########################################################################################################################
# # - platform: template
# # sensors:
# # frontdoor_camera_objects:
# # value_template: >-
# # {% set attribs = state_attr('image_processing.tagbox_frontdoor_camera', 'tags') %}
# # {%- if None != attribs -%}
# # {%- set tag_map = {'Vehicle':'Car', 'Sedan':'Car', 'Luxury vehicle':'Car', 'Driving':'Car',
# # 'Wheel':'Car', 'Automotive design':'Car', 'Automotive exterior':'Car',
# # 'Transport':'Car', 'Sports car':'Car', 'Land vehicle':'Car', 'Supercar':'Car',
# # 'Waterway':'Rain', 'Super car': 'Car'
# # } -%}
# # {%- set unwanted_tags = ['Asphalt', 'Backyard', 'City', 'Estate', 'Flower', 'Garden', 'Grass', 'Tree', 'Car', 'Vehicle', 'Suburb', 'Street',
# # 'Highway', 'Infrastructure', 'Lane', 'Lawn', 'Neighbourhood', 'Public space', 'Super car', 'Snow', 'Winter', 'Supercar',
# # 'Residential area', 'Road', 'Road surface', 'Sidewalk', 'Tarmac', 'Race track', 'Sport venue', 'Soil', 'Outdoor structure', 'Cartoon', 'Poster', 'Illustration',
# # 'Transport', 'Walkway', 'Yard', 'Screenshot', 'Night', 'Lighting and Light', 'Drawing', 'Sketch', 'Stadium',
# # 'Black-and-white', 'Monochrome', 'Monochrome photography', 'Black and White', 'Parking lot', 'Parking',
# # 'Black', 'White', 'Darkness', 'Light', 'Text'] -%}
# # {%- macro filter_unwanted(tags) -%}
# # {%- set comma = joiner(',') -%}
# # {%- for item in tags if item not in unwanted_tags -%}{{- comma() -}}{{- item -}}{% endfor %}{%- endmacro -%}
# # {%- macro mapped_items(tags) -%}
# # {%- set comma = joiner(',') -%}
# # {%- for item in tags if item not in tag_map -%}{{- comma() -}}{{- item -}}
# # {%- endfor -%}
# # {%- for item in tags if item in tag_map -%}{{- comma() -}}{{- tag_map[item] -}}{%- endfor -%}
# # {%- endmacro -%}
# # {% macro get_final_output(output_list) %}
# # {%- for x in output_list if x != "" -%}
# # {%- if loop.first %}{% elif loop.last %},{% else %},{% endif -%}{{- x -}}
# # {%- endfor -%}
# # {% endmacro %}
# # {%- set result = filter_unwanted(attribs| map(attribute='name')|list).split(',') -%}
# # {%- set output = get_final_output(mapped_items(result).split(',') | unique|list) -%}
# # {{- "Clear" if output |trim == "" else output -}}
# # {% endif %}
# # icon_template: mdi:cctv
# # - platform: template
# # sensors:
# # driveway_camera_objects:
# # value_template: >-
# # {%- set attribs = state_attr('image_processing.tagbox_driveway_camera', 'tags') -%}
# # {%- if None != attribs -%}
# # {%- set tag_map = {'Vehicle':'Car', 'Sedan':'Car', 'Luxury vehicle':'Car', 'Driving':'Car',
# # 'Wheel':'Car', 'Automotive design':'Car', 'Automotive exterior':'Car',
# # 'Transport':'Car', 'Sports car':'Car', 'Land vehicle':'Car','Supercar':'Car',
# # 'Waterway':'Rain', 'Super car': 'Car'
# # } -%}
# # {%- set unwanted_tags = ['Asphalt', 'Backyard', 'City', 'Estate', 'Flower', 'Garden', 'Grass', 'Tree', 'Car', 'Vehicle', 'Suburb', 'Street',
# # 'Highway', 'Infrastructure', 'Lane', 'Lawn', 'Neighbourhood', 'Public space', 'Super car', 'Sport venue', 'Supercar',
# # 'Residential area', 'Road', 'Road surface', 'Sidewalk', 'Tarmac', 'Race track', 'Snow', 'Winter', 'Soil', 'Outdoor structure', 'Cartoon', 'Poster', 'Illustration',
# # 'Transport', 'Walkway', 'Yard', 'Screenshot', 'Night', 'Lighting and Light', 'Drawing', 'Sketch', 'Stadium',
# # 'Black-and-white', 'Monochrome', 'Monochrome photography', 'Black and White',
# # 'Black', 'White', 'Darkness', 'Light', 'Text'] -%}
# # {%- macro filter_unwanted(tags) -%}
# # {%- set comma = joiner(',') -%}
# # {%- for item in tags if item not in unwanted_tags -%}{{- comma() -}}{{- item -}}{% endfor %}{%- endmacro -%}
# # {%- macro mapped_items(tags) -%}
# # {%- set comma = joiner(',') -%}
# # {%- for item in tags if item not in tag_map -%}{{- comma() -}}{{- item -}}
# # {%- endfor -%}
# # {%- for item in tags if item in tag_map -%}{{- comma() -}}{{- tag_map[item] -}}{%- endfor -%}
# # {%- endmacro -%}
# # {% macro get_final_output(output_list) %}
# # {%- for x in output_list if x != "" -%}
# # {%- if loop.first %}{% elif loop.last %},{% else %},{% endif -%}{{- x -}}
# # {%- endfor -%}
# # {% endmacro %}
# # {%- set result = filter_unwanted(attribs| map(attribute='name')|list).split(',') -%}
# # {%- set output = get_final_output(mapped_items(result).split(',') | unique|list) -%}
# # {{- "Clear" if output |trim == "" else output -}}
# # {% endif %}
# # icon_template: mdi:cctv
# # - platform: template
# # sensors:
# # patio_camera_objects:
# # value_template: >-
# # {% set attribs = state_attr('image_processing.tagbox_patio_camera', 'tags') %}
# # {%- if None != attribs -%}
# # {%- set tag_map = {'Waterway':'Rain'} -%}
# # {%- set unwanted_tags = ['Asphalt', 'Backyard', 'City', 'Estate', 'Flower', 'Garden', 'Grass', 'Tree', 'Vehicle','Driving', 'Transport', 'Car', 'Vehicle', 'Suburb', 'Street',
# # 'Highway', 'Infrastructure', 'Lane', 'Lawn', 'Neighbourhood', 'Public space', 'Car', 'Wheel', 'Sports car','Super car', 'Sport venue', 'Outdoor structure', 'Cartoon', 'Poster', 'Illustration',
# # 'Residential area', 'Road', 'Road surface', 'Sidewalk', 'Tarmac', 'Race track', 'Sedan', 'Automotive design', 'Snow', 'Winter', 'Soil', 'Stadium',
# # 'Transport', 'Walkway', 'Yard', 'Screenshot', 'Night', 'Lighting and Light', 'Luxury vehicle', 'Automotive exterior', 'Drawing', 'Sketch',
# # 'Black-and-white', 'Monochrome', 'Monochrome photography', 'Black and White', 'Black', 'White', 'Light', 'Text'] -%}
# # {%- macro filter_unwanted(tags) -%}
# # {%- set comma = joiner(',') -%}
# # {%- for item in tags if item not in unwanted_tags -%}{{- comma() -}}{{- item -}}{% endfor %}{%- endmacro -%}
# # {%- macro mapped_items(tags) -%}
# # {%- set comma = joiner(',') -%}
# # {%- for item in tags if item not in tag_map -%}{{- comma() -}}{{- item -}}
# # {%- endfor -%}
# # {%- for item in tags if item in tag_map -%}{{- comma() -}}{{- tag_map[item] -}}{%- endfor -%}
# # {%- endmacro -%}
# # {% macro get_final_output(output_list) %}
# # {%- for x in output_list if x != "" -%}
# # {%- if loop.first %}{% elif loop.last %},{% else %},{% endif -%}{{- x -}}
# # {%- endfor -%}
# # {% endmacro %}
# # {%- set result = filter_unwanted(attribs| map(attribute='name')|list).split(',') -%}
# # {%- set output = get_final_output(mapped_items(result).split(',') | unique|list) -%}
# # {{- "Clear" if output |trim == "" else output -}}
# # {% endif %}
# # icon_template: mdi:cctv
# # - platform: template
# # sensors:
# # playarea_camera_objects:
# # value_template: >-
# # {% set attribs = state_attr('image_processing.tagbox_playarea_camera', 'tags') %}
# # {%- if None != attribs -%}
# # {%- set tag_map = {'Waterway':'Rain'} -%}
# # {%- set unwanted_tags = ['Asphalt', 'Backyard', 'City', 'Estate', 'Flower', 'Garden', 'Grass', 'Tree', 'Vehicle','Driving', 'Transport', 'Car', 'Vehicle', 'Suburb', 'Street',
# # 'Highway', 'Infrastructure', 'Lane', 'Lawn', 'Neighbourhood', 'Public space', 'Car', 'Wheel', 'Sports car', 'Super car', 'Winter', 'Soil', 'Stadium',
# # 'Residential area', 'Road', 'Road surface', 'Sidewalk', 'Tarmac', 'Race track', 'Sedan', 'Automotive design', 'Snow', 'Sport venue', 'Outdoor structure', 'Cartoon', 'Poster', 'Illustration',
# # 'Transport', 'Walkway', 'Yard', 'Screenshot', 'Night', 'Lighting and Light', 'Luxury vehicle', 'Automotive exterior', 'Drawing', 'Sketch',
# # 'Black-and-white', 'Monochrome', 'Monochrome photography', 'Black and White', 'Black', 'White', 'Light', 'Text'] -%}
# # {%- macro filter_unwanted(tags) -%}
# # {%- set comma = joiner(',') -%}
# # {%- for item in tags if item not in unwanted_tags -%}{{- comma() -}}{{- item -}}{% endfor %}{%- endmacro -%}
# # {%- macro mapped_items(tags) -%}
# # {%- set comma = joiner(',') -%}
# # {%- for item in tags if item not in tag_map -%}{{- comma() -}}{{- item -}}{%- endfor -%}
# # {%- for item in tags if item in tag_map -%}{{- comma() -}}{{- tag_map[item] -}}{%- endfor -%}
# # {%- endmacro -%}
# # {% macro get_final_output(output_list) %}
# # {%- for x in output_list if x != "" -%}
# # {%- if loop.first %}{% elif loop.last %},{% else %},{% endif -%}{{- x -}}
# # {%- endfor -%}
# # {% endmacro %}
# # {%- set result = filter_unwanted(attribs| map(attribute='name')|list).split(',') -%}
# # {%- set output = get_final_output(mapped_items(result).split(',') | unique|list) -%}
# # {{- "Clear" if output |trim == "" else output -}}
# # {% endif %}
# # icon_template: mdi:cctv
# # - platform: template
# # sensors:
# # garage_camera_objects:
# # value_template: >-
# # {% set attribs = state_attr('image_processing.tagbox_garage_camera', 'tags') %}
# # {%- if None != attribs -%}
# # {%- set tag_map = {'Waterway':'Rain'} -%}
# # {%- set unwanted_tags = ['Asphalt', 'Backyard', 'City', 'Estate', 'Flower', 'Garden', 'Grass', 'Tree', 'Driving', 'Transport', 'Suburb', 'Street',
# # 'Highway', 'Infrastructure', 'Lane', 'Lawn', 'Neighbourhood', 'Public space', 'Winter', 'Soil', 'Stadium',
# # 'Residential area', 'Road', 'Road surface', 'Sidewalk', 'Tarmac', 'Race track', 'Sedan', 'Automotive design', 'Snow', 'Sport venue', 'Outdoor structure', 'Cartoon', 'Poster', 'Illustration',
# # 'Transport', 'Walkway', 'Yard', 'Screenshot', 'Night', 'Lighting and Light', 'Luxury vehicle', 'Automotive exterior', 'Drawing', 'Sketch',
# # 'Black-and-white', 'Monochrome', 'Monochrome photography', 'Black and White', 'Black', 'White', 'Light', 'Text'] -%}
# # {%- macro filter_unwanted(tags) -%}
# # {%- set comma = joiner(',') -%}
# # {%- for item in tags if item not in unwanted_tags -%}{{- comma() -}}{{- item -}}{% endfor %}{%- endmacro -%}
# # {%- macro mapped_items(tags) -%}
# # {%- set comma = joiner(',') -%}
# # {%- for item in tags if item not in tag_map -%}{{- comma() -}}{{- item -}}{%- endfor -%}
# # {%- for item in tags if item in tag_map -%}{{- comma() -}}{{- tag_map[item] -}}{%- endfor -%}
# # {%- endmacro -%}
# # {% macro get_final_output(output_list) %}
# # {%- for x in output_list if x != "" -%}
# # {%- if loop.first %}{% elif loop.last %},{% else %},{% endif -%}{{- x -}}
# # {%- endfor -%}
# # {% endmacro %}
# # {%- set result = filter_unwanted(attribs| map(attribute='name')|list).split(',') -%}
# # {%- set output = get_final_output(mapped_items(result).split(',') | unique|list) -%}
# # {{- "Clear" if output |trim == "" else output -}}
# # {% endif %}
# # icon_template: mdi:cctv
# automation:
# - alias: Alert Family Member Activity
# trigger:
# - platform: state
# entity_id:
# - sensor.frontdoor_camera_people
# - sensor.driveway_camera_people
# - sensor.patio_camera_people
# - sensor.playarea_camera_people
# - sensor.garage_camera_people
# condition:
# - condition: template
# value_template: "{{ states('input_boolean.notify_camera_alerts') == 'on' }}"
# - condition: template
# value_template: '{{ trigger.to_state.state | trim != "" and
# trigger.to_state.state | lower | trim != "unknown" and
# trigger.to_state.state | lower | trim != "clear" }}'
# action:
# - service: script.notify_me
# data_template:
# message: >-
# {% set camera_name = states['camera'][trigger.entity_id.split('.')[1].split('_')[0] ~ '_camera'].attributes.friendly_name %}
# {{ trigger.to_state.state }} is at the {{ camera_name }}.
# # - alias: Alert Object Activity
# # trigger:
# # - platform: state
# # entity_id:
# # - sensor.frontdoor_camera_objects
# # - sensor.driveway_camera_objects
# # - sensor.patio_camera_objects
# # - sensor.playarea_camera_objects
# # - sensor.garage_camera_objects
# # condition:
# # - condition: template
# # value_template: "{{ states('input_boolean.notify_camera_alerts') == 'on' }}"
# # - condition: template
# # value_template: '{{ trigger.to_state.state | trim != "" and
# # trigger.to_state.state | lower | trim != "unknown" and
# # trigger.to_state.state | lower | trim != "clear" }}'
# # action:
# # - service: script.notify_me
# # data_template:
# # message: >-
# # {% set camera_name = states['camera'][trigger.entity_id.split('.')[1].split('_')[0] ~ '_camera'].attributes.friendly_name %}
# # {{ trigger.to_state.state }} detected at the {{ camera_name }}.
# #
# # This automation basically scans image and keeps a count of people from each camera view and notifies using iOS notification
# # There is another automation that alerts in the house (using TTS) based on the data
# #
# - alias: Scan People and Objects
# initial_state: true
# trigger:
# - platform: state
# entity_id:
# - binary_sensor.frontdoor_camera_motion
# - binary_sensor.driveway_camera_motion
# - binary_sensor.patio_camera_motion
# - binary_sensor.playarea_camera_motion
# - binary_sensor.frontdoor_camera_field_detection
# - binary_sensor.driveway_camera_field_detection
# - binary_sensor.patio_camera_field_detection
# - binary_sensor.playarea_camera_field_detection
# - binary_sensor.frontdoor_camera_line_crossing
# - binary_sensor.driveway_camera_line_crossing
# - binary_sensor.patio_camera_line_crossing
# - binary_sensor.playarea_camera_line_crossing
# - binary_sensor.garage_motion
# to: 'on'
# condition:
# - condition: template
# value_template: "{{ states('input_boolean.notify_camera_alerts') == 'on' }}"
# - condition: template
# value_template: >
# {% macro last_triggered(entity) %}
# {% set time_in_seconds = 30 %}
# {{ ( (as_timestamp(now()) - as_timestamp(states["binary_sensor"][entity].attributes.last_tripped_time)))|round|abs < time_in_seconds }}
# {% endmacro %}
# {{ last_triggered(trigger.entity_id.split('.')[1].split('_')[0] ~ '_camera_motion')}}
# action:
# - service: image_processing.scan
# data_template:
# entity_id: "image_processing.facebox_{{- trigger.entity_id.split('.')[1].split('_')[0] -}}_camera"
# # - service: image_processing.scan
# # data_template:
# # entity_id: "image_processing.tagbox_{{- trigger.entity_id.split('.')[1].split('_')[0] -}}_camera"

View File

@@ -40,7 +40,7 @@ automation:
action:
- service: switch.turn_on
data:
entity_id: switch.kitchen
entity_id: switch.kitchen_switch
###############################################################################
# Turn ON Master Bedroom lights ON in the morning
@@ -70,6 +70,9 @@ automation:
transition: 15
brightness: 25
color_temp: 154
- service: switch.turn_on
data:
entity_id: switch.chromecast_monitor
- alias: Morning Master Bedroom Lights OFF (Mallika)
initial_state: true
@@ -134,7 +137,7 @@ automation:
state: "on"
action:
- service: switch.turn_off
entity_id: switch.kitchen
entity_id: switch.kitchen_switch
- service: switch.turn_off
entity_id: switch.front_room
@@ -153,7 +156,7 @@ automation:
# Turn outdoor lights on 15 minutes before sunset
###############################################################################
- alias: Evening Outdoor Lights ON (At Sunset)
initial_state: true
# initial_state: true
trigger:
platform: sun
event: sunset
@@ -187,23 +190,23 @@ automation:
action:
- service: switch.turn_on
data:
entity_id: switch.kitchen
entity_id: switch.kitchen_switch
- service: light.turn_on
data:
entity_id: light.hue_color_lamp_1
transition: 15
transition: 3000
brightness: 255
color_temp: 154
- service: light.turn_on
data:
entity_id: light.hue_color_lamp_2
transition: 15
transition: 3000
brightness: 255
color_temp: 154
- service: light.turn_on
data:
entity_id: light.hue_color_lamp_3
transition: 15
transition: 3000
brightness: 255
color_temp: 154
- service: light.turn_on
@@ -217,7 +220,7 @@ automation:
brightness: 25
color_temp: 366
- service: switch.turn_on
entity_id: switch.kids_bed_accent
entity_id: switch.hasika_bed_accent
- service: switch.turn_on
entity_id: switch.front_room
- service: switch.turn_on
@@ -281,9 +284,9 @@ automation:
state: "on"
action:
- service: script.all_indoor_lights_off
- service: script.notify_me
data:
message: "It is bed time, turned lights off!"
# - service: script.notify_me
# data:
# message: "It is bed time, turned lights off!"
###############################################################################
# Provide Bed time Report via TTS

View File

@@ -157,7 +157,7 @@ automation:
- delay: "00:00:05"
- service: camera.snapshot
data_template:
entity_id: "camera.garage_camera"
entity_id: "camera.garage"
filename:
"{{ '/config/www/downloads/camera/garage/garage_' ~
((state_attr('automation.notify_garage_door_status', 'last_triggered') |string).replace('-','_')
@@ -290,7 +290,7 @@ automation:
- condition: template
value_template: "{{ states('sun.sun') == 'below_horizon' }}"
- service: switch.turn_on
entity_id: switch.kitchen
entity_id: switch.kitchen_switch
################################################################################
# When I open the garage door
@@ -324,6 +324,9 @@ automation:
- service: timer.start
entity_id: timer.timer_garage
###############################################################################
# MASTER BATHROOM AUTOMATIONS
###############################################################################
#
# Only turn ON lights at 25% at night
#
@@ -335,7 +338,7 @@ automation:
to: "on"
condition:
- condition: template
value_template: '{{states.sun.sun.state == "below_horizon"}}'
value_template: '{{states("sun.sun") == "below_horizon"}}'
- condition: state
entity_id: input_boolean.light_automations
state: "on"
@@ -354,7 +357,7 @@ automation:
to: "on"
condition:
- condition: template
value_template: '{{states.sun.sun.state == "above_horizon"}}'
value_template: '{{states("sun.sun") == "above_horizon"}}'
- condition: state
entity_id: input_boolean.light_automations
state: "on"
@@ -362,5 +365,54 @@ automation:
- service: light.turn_on
entity_id: light.master_bathroom_lights
data:
brightness: 255 # 100% of brightness
transition: 10
brightness: 254 # 100% of brightness
transition: 5
- alias: Master Bathroom Toilet Door Opened
initial_state: true
trigger:
platform: state
entity_id: binary_sensor.door_window_sensor_158d00044e5cb3
to: "on"
condition:
- condition: state
entity_id: input_boolean.light_automations
state: "on"
action:
- service: switch.turn_on
entity_id: switch.master_bathroom_toilet_light
- alias: Turn off Master Bathroom Toilet if the door is open for too long
initial_state: true
trigger:
- platform: state
entity_id: binary_sensor.door_window_sensor_158d00044e5cb3
to: "on"
for:
minutes: 3
condition:
- condition: state
entity_id: input_boolean.light_automations
state: "on"
action:
- service: switch.turn_off
data_template:
entity_id: switch.master_bathroom_toilet_light
###############################################################################
# GUEST BATHROOM AUTOMATIONS
###############################################################################
- alias: Guest Bathroom Door Opened
initial_state: true
trigger:
platform: state
entity_id: binary_sensor.door_window_sensor_158d00045ab168
to: "on"
condition:
- condition: state
entity_id: input_boolean.light_automations
state: "on"
action:
- service: switch.turn_on
entity_id: switch.guest_bathroom_lights

View File

@@ -1,39 +0,0 @@
# sudo usermod -a -G video homeassistant
# ln -s /usr/local/lib/python3.4/dist-packages/cec /srv/homeassistant/lib/python3.4/site-packages
# echo scan | cec-client -s -d 1
# opening a connection to the CEC adapter...
# requesting CEC bus information ...
# CEC bus information
# ===================
# device #0: TV
# address: 0.0.0.0
# active source: no
# vendor: Vizio
# osd string: TV
# CEC version: 1.4
# power status: on
# language: eng
#
#
# device #1: Recorder 1
# address: 2.0.0.0
# active source: no
# vendor: Pulse Eight
# osd string: CECTester
# CEC version: 1.4
# power status: on
# language: eng
# currently active source: unknown (-1)
# Edit /boot/config.txt and include the line to prevent turning TV on when you restart Raspberry Pi
# hdmi_ignore_cec_init=1
hdmi_cec:
devices:
TV: 0.0.0.0
PI: 2.0.0.0

View File

@@ -6,28 +6,7 @@
###############################################################################
homeassistant:
shell_command:
stop_hass: >-
hassctl stop
restart_hass: >-
hassctl restart
update_hass: >-
hassctl update-hass && hassctl config && hassctl restart
speedtestdotnet:
scan_interval:
hours: 1
monitored_conditions:
- ping
- download
- upload
sensor:
- platform: uptime
name: Home Assistant Up Time
- platform: rest
resource: http://icanhazip.com
name: external_ip
@@ -43,28 +22,3 @@ sensor:
- type: ipv4_address
arg: ens160
- type: last_boot
- platform: mqtt
state_topic: "iotlink/domain/winsvr2016/lwt"
name: "Windows Server"
value_template: "{{ value }}"
- platform: mqtt
state_topic: "iotlink/domain/winsvr2016/windows-monitor/stats/cpu/usage"
name: "Windows Server CPU Usage"
value_template: "{{ value }}"
- platform: mqtt
state_topic: "iotlink/domain/winsvr2016/windows-monitor/stats/memory/used"
name: "Windows Server Memory Used"
value_template: "{{ value }}"
- platform: mqtt
state_topic: "iotlink/domain/winsvr2016/windows-monitor/stats/memory/available"
name: "Windows Server Memory Available"
value_template: "{{ value }}"
- platform: mqtt
state_topic: "iotlink/domain/winsvr2016/windows-monitor/stats/system/idle-time"
name: "Windows Server Idle Time"
value_template: "{{ value }}"

View File

@@ -16,11 +16,6 @@ homeassistant:
friendly_name: Home Security System
icon: mdi:security
# simplisafe:
# accounts:
# - username: !secret simplisafe_username
# password: !secret simplisafe_password
###############################################################################
# _ _ _
# /\ | | | | (_)
@@ -111,7 +106,7 @@ automation:
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- service: camera.snapshot
data_template:
entity_id: "camera.garage_camera"
entity_id: "camera.garage"
filename:
"{{ '/config/www/downloads/camera/garage/garage_' ~
(states.binary_sensor.motion_sensor_158d00024ee084.last_updated ~ '').replace('-','_')
@@ -265,33 +260,33 @@ automation:
entity_id: climate.dining_room
away_mode: "false"
# ###############################################################################
# # TURN HOME SECURITY SYSTEM ON AT BED TIME
# ###############################################################################
# - alias: Night HomeSecurity On
# initial_state: true
# trigger:
# platform: time_pattern
# minutes: "/5"
# seconds: 00
# condition:
# - condition: template
# value_template: "{{ states('sensor.bedtime_hour')|int == now().hour|int }}"
# - condition: template
# value_template: "{{ states('sensor.bedtime_minute')|int == now().minute|int }}"
# - condition: template
# value_template: "{{ states('alarm_control_panel.home') != 'away' }}"
# - condition: template
# value_template: "{{ states('alarm_control_panel.home') == 'disarmed' }}"
# - condition: template
# value_template: "{{ states('input_boolean.security_system_alerts') == 'on' }}"
# action:
# - service: alarm_control_panel.alarm_arm_home
# data:
# entity_id: alarm_control_panel.home
# - service: script.notify_me
# data:
# message: "It's bedtime, you forgot to turn ON Home Security System. Turned it ON for you."
###############################################################################
# TURN HOME SECURITY SYSTEM ON AT BED TIME
###############################################################################
- alias: Night HomeSecurity On
initial_state: true
trigger:
platform: time_pattern
minutes: "/5"
seconds: 00
condition:
- condition: template
value_template: "{{ states('sensor.bedtime_hour')|int == now().hour|int }}"
- condition: template
value_template: "{{ states('sensor.bedtime_minute')|int == now().minute|int }}"
- condition: template
value_template: "{{ states('alarm_control_panel.home') != 'away' }}"
- condition: template
value_template: "{{ states('alarm_control_panel.home') == 'disarmed' }}"
- condition: template
value_template: "{{ states('input_boolean.security_system_alerts') == 'on' }}"
action:
- service: alarm_control_panel.alarm_arm_home
data:
entity_id: alarm_control_panel.home
- service: script.notify_me
data:
message: "It's bedtime, you forgot to turn ON Home Security System. Turned it ON for you."
###############################################################################
# Check for Garage Door Status when Home Security System State changes
@@ -324,7 +319,7 @@ automation:
- service: camera.snapshot
data_template:
entity_id: "camera.garage_camera"
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' }}"
- service: notify.telegram

View File

@@ -60,10 +60,10 @@ automation:
trigger:
- platform: state
entity_id:
- device_tracker.life360_mallika
- device_tracker.life360_suresh
- device_tracker.life360_srinika
- device_tracker.life360_hasika
- device_tracker.mallika
- device_tracker.suresh
- device_tracker.srinika
- device_tracker.hasika
from: "not_home"
to: "home"
for: "00:02:00"
@@ -77,16 +77,12 @@ automation:
trigger:
- platform: zone
entity_id:
- device_tracker.life360_hasika
- device_tracker.life360_mallika
- device_tracker.life360_srinika
- device_tracker.life360_suresh
- device_tracker.hasika
- device_tracker.mallika
- device_tracker.srinika
- device_tracker.suresh
zone: zone.home
event: enter
- platform: zone
entity_id: device_tracker.life360_suresh
zone: zone.work
event: enter
condition:
- condition: template
value_template: "{{ states('input_boolean.zone_alerts') == 'on' }}"

View File

@@ -24,22 +24,6 @@ homeassistant:
emulated_hue_name: Backyard Lights
homebridge_name: Backyard Lights
switch.guest_bedroom:
icon: mdi:lightbulb
friendly_name: Guest Bedroom 1
emulated_hue_name: Guest Bedroom 1
homebridge_name: Guest Bedroom 1
switch.prayer_room:
icon: mdi:lightbulb
friendly_name: Guest Bedroom 2
emulated_hue_name: Guest Bedroom 2
homebridge_name: Guest Bedroom 2
switch.kids_bed_accent:
friendly_name: Hasika's Bed Accent Lights
assumed_state: false
icon: mdi:lightbulb
switch.front_room:
friendly_name: Front Room Light
assumed_state: false
@@ -52,7 +36,7 @@ homeassistant:
friendly_name: Basement Right Side Lights
assumed_state: false
icon: mdi:lightbulb
switch.kitchen:
switch.kitchen_switch:
friendly_name: Kitchen Light
assumed_state: false
icon: mdi:lightbulb
@@ -60,9 +44,6 @@ homeassistant:
friendly_name: Office Room Lights
assumed_state: false
icon: mdi:lightbulb
switch.kids_bedroom:
friendly_name: Kids Bedroom
icon: mdi:lightbulb
switch.garage:
friendly_name: Garage Lights
icon: mdi:lightbulb
@@ -82,55 +63,14 @@ homeassistant:
input_boolean.long_flash:
icon: mdi:flash
friendly_name: Long Flash
input_boolean.animate_downstairs_lights:
icon: mdi:flash-outline
friendly_name: Animate Family Room Lights
input_boolean.animate_upstairs_lights:
icon: mdi:flash-outline
friendly_name: Animate Master Bedroom Lights
tplink:
discovery: false
switch:
# In-wall switches
- host: !secret tplink_hasika_bedroom
- host: !secret tplink_srinika_bedroom
- host: !secret tplink_guest_bedroom
- host: !secret tplink_garage
- host: !secret tplink_garage_shoplights
- host: !secret tplink_basement_left
- host: !secret tplink_basement_right
- host: !secret tplink_kitchen
- host: !secret tplink_office_room
- host: !secret tplink_front_room
# Smart Outlets
- host: !secret tplink_smart_outlet1
#name: Downstairs Fragrance Outlet
- host: !secret tplink_smart_outlet3
#name: Upstairs Fragrance Outlet
- host: !secret tplink_kids_bed_accent_light
#name: Kids Bed Accent Light
- host: !secret tplink_3d_printer
dimmer:
- host: !secret tplink_bathroom_lights
strip:
- host: !secret tplink_smart_strip
- host: !secret tplink_outdoor_plug
wemo:
discovery: false
static:
- !secret wemo_switch_1
- !secret wemo_switch_2
- !secret wemo_switch_3
input_boolean:
animate_upstairs_lights:
name: Animate Master Bedroom Lights
initial: off
animate_downstairs_lights:
name: Animate Family Room Lights
initial: off
long_flash:
name: Long Flash Lights
initial: off

View File

@@ -6,18 +6,12 @@ homeassistant:
unit_of_measurement: "count"
input_label.basement_door_sensor_sensor:
unit_of_measurement: "count"
input_label.downstairs_multi_sensor_sensor:
unit_of_measurement: "count"
input_label.front_room_multi_sensor_sensor:
unit_of_measurement: "count"
input_label.front_room_window_sensor_sensor:
unit_of_measurement: "count"
input_label.garage_door_sensor_sensor:
unit_of_measurement: "count"
input_label.garage_motion:
unit_of_measurement: "count"
input_label.guest_bedroom_multi_sensor_sensor:
unit_of_measurement: "count"
input_label.kitchen_motion_sensor_sensor:
unit_of_measurement: "count"
input_label.motion_sensor_158d00016c2d0e:
@@ -50,8 +44,6 @@ homeassistant:
unit_of_measurement: "count"
input_label.two_car_garage_door_tilt_sensor_sensor:
unit_of_measurement: "count"
input_label.upstairs_multi_sensor_sensor:
unit_of_measurement: "count"
input_label.door_window_sensor_158d0004231f7b:
unit_of_measurement: "count"
input_label.door_window_sensor_158d0004248d5b:
@@ -80,21 +72,12 @@ input_label:
name: Garage Door
icon: mdi:run-fast
downstairs_multi_sensor_sensor:
name: TV Room Multi Sensor
icon: mdi:run-fast
front_room_multi_sensor_sensor:
name: Front Room Multi Sensor
icon: mdi:run-fast
front_room_window_sensor_sensor:
name: Front Room Sensor
icon: mdi:run-fast
garage_motion:
name: Garage Motion
icon: mdi:run-fast
guest_bedroom_multi_sensor_sensor:
name: Guest Bedroom Motion
icon: mdi:run-fast
kitchen_motion_sensor_sensor:
name: Kitchen Motion
icon: mdi:run-fast
@@ -145,9 +128,6 @@ input_label:
stairs_motion_sensor_sensor:
name: Stairs Motion
icon: mdi:run-fast
upstairs_multi_sensor_sensor:
name: Upstairs Motion Sensor
icon: mdi:run-fast
automation:
- alias: Count Motions
@@ -159,12 +139,9 @@ automation:
- binary_sensor.door_window_sensor_158d00040ad8fc
- binary_sensor.door_window_sensor_158d0004880f30 # garage entry door
- binary_sensor.basement_door_sensor_sensor
- binary_sensor.downstairs_multi_sensor_sensor
- binary_sensor.front_room_multi_sensor_sensor
- binary_sensor.front_room_window_sensor_sensor
- binary_sensor.garage_door_sensor_sensor
- binary_sensor.garage_motion
- binary_sensor.guest_bedroom_multi_sensor_sensor
- binary_sensor.kitchen_motion_sensor_sensor
- binary_sensor.motion_sensor_158d00016c2d0e
- binary_sensor.motion_sensor_158d00016db6d2
@@ -181,7 +158,6 @@ automation:
- binary_sensor.stairs_motion_sensor_sensor
- binary_sensor.door_window_sensor_158d0004248d5b # Single Car Garage
- binary_sensor.door_window_sensor_158d0004231f7b # Double Car Garage
- binary_sensor.upstairs_multi_sensor_sensor
action:
- service: input_label.set_value
data_template:
@@ -200,12 +176,9 @@ automation:
value: 0
entity_id:
- input_label.basement_door_sensor_sensor
- input_label.downstairs_multi_sensor_sensor
- input_label.front_room_multi_sensor_sensor
- input_label.front_room_window_sensor_sensor
- input_label.garage_door_sensor_sensor
- input_label.garage_motion
- input_label.guest_bedroom_multi_sensor_sensor
- input_label.kitchen_motion_sensor_sensor
- input_label.motion_sensor_158d00016c2d0e
- input_label.motion_sensor_158d00016db6d2

View File

@@ -70,6 +70,16 @@ automation:
entity_id: timer.timer_masterbathroom
- service: light.turn_on
entity_id: light.master_bathroom_lights
data:
brightness: 64 # 25% of brightness
transition: 5
- condition: template
value_template: '{{states("sun.sun") == "above_horizon"}}'
- service: light.turn_on
entity_id: light.master_bathroom_lights
data:
brightness: 254 # 100% of brightness
transition: 5
- alias: Master Bathroom Timer Elapsed
initial_state: true
@@ -171,7 +181,7 @@ automation:
state: "on"
action:
- service: switch.turn_on
entity_id: switch.kitchen
entity_id: switch.kitchen_switch
- service: timer.start
entity_id: timer.timer_kitchen
# Kitchen:
@@ -199,7 +209,7 @@ automation:
{% else %}
switch.turn_on
{% endif %}
entity_id: switch.kitchen
entity_id: switch.kitchen_switch
# Family Room:
# Motion Detected - When TV is OFF, turn ON the light 100% and extend timer
###############################################################################

View File

@@ -6,9 +6,6 @@
###############################################################################
homeassistant:
ifttt:
key: !secret ifttt_key
notify:
- name: ios_devices
platform: group

View File

@@ -1,218 +0,0 @@
# ###############################################################################
# # AUTHOR : Suresh Kalavala
# # DATE : 03/04/2018
# # PACKAGE : PALO ALTO APPLANCE/DEVICE SENSOR
# # Description : Package to monitor PaloAlto device, logged-in users, vpn users
# # and other system information
# ###############################################################################
# homeassistant:
# customize:
# # Sensors from custom component
# sensor.paloalto_host_name:
# friendly_name: Palo Alto Host Name
# sensor.paloalto_operation_mode:
# friendly_name: Device Operation Mode
# sensor.paloalto_serial_number:
# friendly_name: Device Serial Number
# sensor.paloalto_global_protect_user_count:
# friendly_name: VPN Loggedin User Count
# sensor.paloalto_global_protect_users:
# friendly_name: VPN Loggedin Users
# sensor.paloalto_global_protect_version:
# friendly_name: VPN Software Version
# sensor.paloalto_logdb_version:
# friendly_name: Log Db Version
# sensor.paloalto_software_version:
# friendly_name: Device Software Version
# sensor.paloalto_core_temperature:
# friendly_name: Core Temperature
# sensor.paloalto_system_temperature:
# friendly_name: System Temperature
# sensor.paloalto_up_time:
# friendly_name: Up Time
# # Scripts
# script.paloalto_clear_traffic_logs:
# friendly_name: Clear Traffic Logs
# script.paloalto_clear_threat_logs:
# friendly_name: Clear Threat Logs
# script.paloalto_clear_alarm_logs:
# friendly_name: Clear Alarm Logs
# script.paloalto_clear_authentication_logs:
# friendly_name: Clear Authentication Logs
# script.paloalto_clear_config_logs:
# friendly_name: Clear Configuration Logs
# script.paloalto_clear_system_logs:
# friendly_name: Clear System Logs
# script.paloalto_shutdown:
# friendly_name: Shutdown Palo Alto Device
# icon: mdi:power
# script.paloalto_restart:
# friendly_name: Restart Palo Alto Device
# icon: mdi:restart
# sensor:
# - platform: paloalto
# api_key: !secret paloalto_authkey
# ip_address: !secret paloalto_hostip
# ssl: True
# verify_ssl: False
# scan_interval: 60
# monitored_conditions:
# - host_name
# - up_time
# - serial_no
# - sw_version
# - gp_version
# - logdb_version
# - operation_mode
# - core_temp
# - sys_temp
# - gp_users
# - gp_user_count
# - loggedin_user_count
# - loggedin_users
# #
# # All the URLs below use the following format
# # For ex: paloalto_clear_traffic_logs: "curl -k 'https://192.xxx.xxx.xxx/api/?type=op&cmd=<clear><log><traffic></traffic></log></clear>&key=YOUR_API_KEY'"
# # Check out secrets.example file for additional details about the commands
# # https://github.com/skalavala/mysmarthome/blob/master/secrets.example
# #
# shell_command:
# paloalto_clear_traffic_logs: !secret paloalto_clear_traffic_logs
# paloalto_clear_threat_logs: !secret paloalto_clear_threat_logs
# paloalto_clear_alarm_logs: !secret paloalto_clear_alarm_logs
# paloalto_clear_authentication_logs: !secret paloalto_clear_authentication_logs
# paloalto_clear_config_logs: !secret paloalto_clear_config_logs
# paloalto_clear_system_logs: !secret paloalto_clear_system_logs
# paloalto_shutdown: !secret paloalto_shutdown
# paloalto_restart: !secret paloalto_restart
# script:
# paloalto_clear_traffic_logs:
# sequence:
# - service: shell_command.paloalto_clear_traffic_logs
# paloalto_clear_threat_logs:
# sequence:
# - service: shell_command.paloalto_clear_threat_logs
# paloalto_clear_alarm_logs:
# sequence:
# - service: shell_command.paloalto_clear_alarm_logs
# paloalto_clear_authentication_logs:
# sequence:
# - service: shell_command.paloalto_clear_authentication_logs
# paloalto_clear_config_logs:
# sequence:
# - service: shell_command.paloalto_clear_config_logs
# paloalto_clear_system_logs:
# sequence:
# - service: shell_command.paloalto_clear_system_logs
# paloalto_shutdown:
# sequence:
# - service: shell_command.paloalto_shutdown
# paloalto_restart:
# sequence:
# - service: shell_command.paloalto_restart
# automation:
# #
# # Alerts me when someone logs into my VPN network
# # This automation compares before and after state changes
# # and alerts when someone logged in/out of VPN
# #
# - alias: Alert When Someone Logged into VPN
# initial_state: true
# trigger:
# - platform: state
# entity_id: sensor.paloalto_global_protect_users
# condition:
# - condition: template
# value_template: '{{ trigger.from_state.state | lower != trigger.to_state.state | lower }}'
# action:
# - service: script.notify_me
# data_template:
# message: >-
# {% set before = trigger.from_state.state %}
# {% set after = trigger.to_state.state %}
# {% macro loggedIn(beforeList, afterList) %}
# {%- for user in afterList if user != 'None' and user not in beforeList%}
# {%- if loop.first %}{% elif loop.last %} and{% else %},{% endif -%}
# {{- user }}
# {%- endfor %}
# {%- endmacro %}
# {% macro loggedOut(beforeList, afterList) %}
# {%- for user in beforeList if user != 'None' and user not in afterList %}
# {%- if loop.first %}{% elif loop.last %} and{% else %},{% endif -%}
# {{- user }}
# {%- endfor %}
# {%- endmacro %}
# {%- macro checkUsers(beforeList, afterList) -%}
# {%- set loggedInUsers = loggedIn(beforeList, afterList) -%}
# {%- set loggedOutUsers = loggedOut(beforeList, afterList) -%}
# {%- if loggedInUsers | trim != "" -%}
# Alert! {{- loggedInUsers | title }} just logged into your Web VPN.
# {%- endif -%}
# {%- if loggedOutUsers | trim != "" %}
# {{- loggedOutUsers |title }} just logged out of your Web VPN.
# {% endif %}
# {%- endmacro -%}
# {{ checkUsers(before.split(','), after.split(',')) }}
# #
# # Alerts me when someone logs into my firewall.
# # This automation compares before and after state changes
# # and alerts when someone logged in/out of Firewall
# #
# - alias: Alert When Someone Logged into Firewall
# initial_state: true
# trigger:
# - platform: state
# entity_id: sensor.paloalto_loggedin_users
# condition:
# - condition: template
# value_template: '{{ trigger.from_state.state | lower != trigger.to_state.state | lower }}'
# action:
# - service: script.notify_me
# data_template:
# message: >-
# {% set before = trigger.from_state.state %}
# {% set after = trigger.to_state.state %}
# {% macro loggedIn(beforeList, afterList) %}
# {%- for user in afterList if user != 'None' and user not in beforeList%}
# {%- if loop.first %}{% elif loop.last %} and{% else %},{% endif -%}
# {{- user }}
# {%- endfor %}
# {%- endmacro %}
# {% macro loggedOut(beforeList, afterList) %}
# {%- for user in beforeList if user != 'None' and user not in afterList %}
# {%- if loop.first %}{% elif loop.last %} and{% else %},{% endif -%}
# {{- user }}
# {%- endfor %}
# {%- endmacro %}
# {%- macro checkUsers(beforeList, afterList) -%}
# {%- set loggedInUsers = loggedIn(beforeList, afterList) -%}
# {%- set loggedOutUsers = loggedOut(beforeList, afterList) -%}
# {%- if loggedInUsers | trim != "" -%}
# Alert! {{- loggedInUsers | title }} just logged into your Palo Alto Firewall.
# {%- endif -%}
# {%- if loggedOutUsers | trim != "" %}
# {{- loggedOutUsers |title }} just logged out of your Palo Alto Firewall.
# {% endif %}
# {%- endmacro -%}
# {{ checkUsers(before.split(','), after.split(',')) }}
# #
# # Palo Alto PA-200 device sucks ass in terms of its disk space!
# # A work around would be to clear traffic logs periodically
# # This automation runs every hour and clears traffic log/log files
# #
# - alias: Clear Traffic Logs
# initial_state: True
# trigger:
# - platform: time_pattern
# hours: '/1'
# minutes: 00
# action:
# - service: script.paloalto_clear_traffic_logs

View File

@@ -1,552 +0,0 @@
###############################################################################
# @author : Mahasri Kalavala
# @date : 12/27/2017
# @package : Pi Admin Package
# @description : Got way too many Raspberry Pi's and this package is to
# help me with managing them via Home Assistant.
#
# How Does It Work?
#
# Each Raspberry Pi runs a service (a python program) locally that listens for
# commands via MQTT on a pre-defined topic. This package publishes commands
# to MQTT requesting each Raspberry Pi to respond and or return data.
# When the responses are received (on a differet topic), the sensors gets
# updated automatically and are displayed.
#
################################################################################
homeassistant:
customize:
script.restart_all_raspberrypis:
friendly_name: Restart All Raspberry Pis
script.restart_all_snapclients:
friendly_name: Restart All Snapserver Clients
script.shutdown_all_raspberrypis:
friendly_name: Shutdown All Raspberry Pis
script.query_wifi_info:
friendly_name: Query WiFi Info
script.query_disk_info:
friendly_name: Query Disk Info
input_select:
raspberry_pis:
name: All Raspberry Pis
options:
- Select One
- pi_basement
- pi_theater
- pi_kitchen
- pi_familyroom
- pi_frontroom
- pi_garage
- pi_guest1
- pi_guest2
- pi_masterbedroom
initial: Select One
icon: mdi:pig
rpi_commands:
name: RPi Commands
options:
- Select One
- Restart Server
- Shutdown
- Restart Snapcast
initial: Select One
icon: mdi:pig
sensor:
## WiFi Information related sensors
- platform: mqtt
state_topic: "/wifi/pi_basement"
name: Basement Pi Signal Level
value_template: '{{ value_json["Signal Level"]}}'
unit_of_measurement: dBm
- platform: mqtt
state_topic: "/wifi/pi_basement"
name: Basement Pi Link Quality
value_template: '{{ value_json["Link Quality"]}}'
- platform: mqtt
state_topic: "/wifi/pi_theater"
name: Theater Pi Signal Level
value_template: '{{ value_json["Signal Level"]}}'
unit_of_measurement: dBm
- platform: mqtt
state_topic: "/wifi/pi_theater"
name: Theater Pi Link Quality
value_template: '{{ value_json["Link Quality"]}}'
- platform: mqtt
state_topic: "/wifi/pi_kitchen"
name: Kitchen Pi Signal Level
value_template: '{{ value_json["Signal Level"]}}'
unit_of_measurement: dBm
- platform: mqtt
state_topic: "/wifi/pi_kitchen"
name: Kitchen Pi Link Quality
value_template: '{{ value_json["Link Quality"]}}'
- platform: mqtt
state_topic: "/wifi/pi_familyroom"
name: Family Room Pi Signal Level
value_template: '{{ value_json["Signal Level"]}}'
unit_of_measurement: dBm
- platform: mqtt
state_topic: "/wifi/pi_familyroom"
name: Family Room Pi Link Quality
value_template: '{{ value_json["Link Quality"]}}'
- platform: mqtt
state_topic: "/wifi/pi_frontroom"
name: Front Room Pi Signal Level
value_template: '{{ value_json["Signal Level"]}}'
unit_of_measurement: dBm
- platform: mqtt
state_topic: "/wifi/pi_frontroom"
name: Front Room Pi Link Quality
value_template: '{{ value_json["Link Quality"]}}'
- platform: mqtt
state_topic: "/wifi/pi_garage"
name: Garage Pi Signal Level
value_template: '{{ value_json["Signal Level"]}}'
unit_of_measurement: dBm
- platform: mqtt
state_topic: "/wifi/pi_garage"
name: Garage Pi Link Quality
value_template: '{{ value_json["Link Quality"]}}'
- platform: mqtt
state_topic: "/wifi/pi_guest1"
name: Guest 1 Pi Signal Level
value_template: '{{ value_json["Signal Level"]}}'
unit_of_measurement: dBm
- platform: mqtt
state_topic: "/wifi/pi_guest1"
name: Guest 1 Pi Link Quality
value_template: '{{ value_json["Link Quality"]}}'
- platform: mqtt
state_topic: "/wifi/pi_guest2"
name: Guest 2 Pi Signal Level
value_template: '{{ value_json["Signal Level"]}}'
unit_of_measurement: dBm
- platform: mqtt
state_topic: "/wifi/pi_guest2"
name: Guest 2 Pi Link Quality
value_template: '{{ value_json["Link Quality"]}}'
- platform: mqtt
state_topic: "/wifi/pi_masterbedroom"
name: master Bedroom Pi Signal Level
value_template: '{{ value_json["Signal Level"]}}'
unit_of_measurement: dBm
- platform: mqtt
state_topic: "/wifi/pi_masterbedroom"
name: Master Bedroom Pi Link Quality
value_template: '{{ value_json["Link Quality"]}}'
## Disk Information related Sensors
- platform: mqtt
state_topic: "/disk/pi_basement"
name: Basement Pi Available Disk
value_template: '{{ value_json["Available"]}}'
- platform: mqtt
state_topic: "/disk/pi_basement"
name: Basement Pi Disk Used
value_template: '{{ value_json["% Used"]}}'
- platform: mqtt
state_topic: "/disk/pi_theater"
name: Theater Pi Available Disk
value_template: '{{ value_json["Available"]}}'
- platform: mqtt
state_topic: "/disk/pi_theater"
name: Theater Pi Disk Used
value_template: '{{ value_json["% Used"]}}'
- platform: mqtt
state_topic: "/disk/pi_kitchen"
name: Kitchen Pi Available Disk
value_template: '{{ value_json["Available"]}}'
- platform: mqtt
state_topic: "/disk/pi_kitchen"
name: Kitchen Pi Disk Used
value_template: '{{ value_json["% Used"]}}'
- platform: mqtt
state_topic: "/disk/pi_familyroom"
name: Family Room Pi Available Disk
value_template: '{{ value_json["Available"]}}'
- platform: mqtt
state_topic: "/disk/pi_familyroom"
name: Family Room Pi Disk Used
value_template: '{{ value_json["% Used"]}}'
- platform: mqtt
state_topic: "/disk/pi_frontroom"
name: Front Room Pi Available Disk
value_template: '{{ value_json["Available"]}}'
- platform: mqtt
state_topic: "/disk/pi_frontroom"
name: Front Room Pi Disk Used
value_template: '{{ value_json["% Used"]}}'
- platform: mqtt
state_topic: "/disk/pi_garage"
name: Garage Pi Available Disk
value_template: '{{ value_json["Available"]}}'
- platform: mqtt
state_topic: "/disk/pi_garage"
name: Garage Pi Disk Used
value_template: '{{ value_json["% Used"]}}'
- platform: mqtt
state_topic: "/disk/pi_guest1"
name: Guest 1 Pi Available Disk
value_template: '{{ value_json["Available"]}}'
- platform: mqtt
state_topic: "/disk/pi_guest1"
name: Guest 1 Pi Disk Used
value_template: '{{ value_json["% Used"]}}'
- platform: mqtt
state_topic: "/disk/pi_guest2"
name: Guest 2 Pi Available Disk
value_template: '{{ value_json["Available"]}}'
- platform: mqtt
state_topic: "/disk/pi_guest2"
name: Guest 2 Pi Disk Used
value_template: '{{ value_json["% Used"]}}'
- platform: mqtt
state_topic: "/disk/pi_masterbedroom"
name: Master Bedroom Pi Available Disk
value_template: '{{ value_json["Available"]}}'
- platform: mqtt
state_topic: "/disk/pi_masterbedroom"
name: Master Bedroom Pi Disk Used
value_template: '{{ value_json["% Used"]}}'
script:
restart_all_raspberrypis:
sequence:
- service: mqtt.publish
data_template:
topic: "/server/pi_basement"
payload: CMD_REBOOT_PI
retain: false
- service: mqtt.publish
data_template:
topic: "/server/pi_theater"
payload: CMD_REBOOT_PI
retain: false
- service: mqtt.publish
data_template:
topic: "/server/pi_kitchen"
payload: CMD_REBOOT_PI
retain: false
- service: mqtt.publish
data_template:
topic: "/server/pi_familyroom"
payload: CMD_REBOOT_PI
retain: false
- service: mqtt.publish
data_template:
topic: "/server/pi_frontroom"
payload: CMD_REBOOT_PI
retain: false
- service: mqtt.publish
data_template:
topic: "/server/pi_garage"
payload: CMD_REBOOT_PI
retain: false
- service: mqtt.publish
data_template:
topic: "/server/pi_guest1"
payload: CMD_REBOOT_PI
retain: false
- service: mqtt.publish
data_template:
topic: "/server/pi_guest2"
payload: CMD_REBOOT_PI
retain: false
- service: mqtt.publish
data_template:
topic: "/server/pi_masterbedroom"
payload: CMD_REBOOT_PI
retain: false
restart_all_snapclients:
sequence:
- service: mqtt.publish
data_template:
topic: "/server/pi_basement"
payload: CMD_RESTART_SNAPCLIENT
retain: false
- service: mqtt.publish
data_template:
topic: "/server/pi_theater"
payload: CMD_RESTART_SNAPCLIENT
retain: false
- service: mqtt.publish
data_template:
topic: "/server/pi_kitchen"
payload: CMD_RESTART_SNAPCLIENT
retain: false
- service: mqtt.publish
data_template:
topic: "/server/pi_familyroom"
payload: CMD_RESTART_SNAPCLIENT
retain: false
- service: mqtt.publish
data_template:
topic: "/server/pi_frontroom"
payload: CMD_RESTART_SNAPCLIENT
retain: false
- service: mqtt.publish
data_template:
topic: "/server/pi_garage"
payload: CMD_RESTART_SNAPCLIENT
retain: false
- service: mqtt.publish
data_template:
topic: "/server/pi_guest1"
payload: CMD_RESTART_SNAPCLIENT
retain: false
- service: mqtt.publish
data_template:
topic: "/server/pi_guest2"
payload: CMD_RESTART_SNAPCLIENT
retain: false
- service: mqtt.publish
data_template:
topic: "/server/pi_masterbedroom"
payload: CMD_RESTART_SNAPCLIENT
retain: false
shutdown_all_raspberrypis:
sequence:
- service: mqtt.publish
data_template:
topic: "/server/pi_basement"
payload: CMD_SHUTDOWN_PI
retain: false
- service: mqtt.publish
data_template:
topic: "/server/pi_theater"
payload: CMD_SHUTDOWN_PI
retain: false
- service: mqtt.publish
data_template:
topic: "/server/pi_kitchen"
payload: CMD_SHUTDOWN_PI
retain: false
- service: mqtt.publish
data_template:
topic: "/server/pi_familyroom"
payload: CMD_SHUTDOWN_PI
retain: false
- service: mqtt.publish
data_template:
topic: "/server/pi_frontroom"
payload: CMD_SHUTDOWN_PI
retain: false
- service: mqtt.publish
data_template:
topic: "/server/pi_garage"
payload: CMD_SHUTDOWN_PI
retain: false
- service: mqtt.publish
data_template:
topic: "/server/pi_guest1"
payload: CMD_SHUTDOWN_PI
retain: false
- service: mqtt.publish
data_template:
topic: "/server/pi_guest2"
payload: CMD_SHUTDOWN_PI
retain: false
- service: mqtt.publish
data_template:
topic: "/server/pi_masterbedroom"
payload: CMD_SHUTDOWN_PI
retain: false
# Script to Query Disk Information - Publishes message 'CMD_REPORT_WIFI_DETAILS'
# to MQTT, so that the message gets received by individual Raspberry Pi
###############################################################################
query_wifi_info:
sequence:
- service: mqtt.publish
data:
topic: /server/pi_basement
payload: "CMD_REPORT_WIFI_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pi_theater
payload: "CMD_REPORT_WIFI_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pi_kitchen
payload: "CMD_REPORT_WIFI_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pi_familyroom
payload: "CMD_REPORT_WIFI_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pi_frontroom
payload: "CMD_REPORT_WIFI_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pi_garage
payload: "CMD_REPORT_WIFI_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pi_guest1
payload: "CMD_REPORT_WIFI_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pi_guest2
payload: "CMD_REPORT_WIFI_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pi_masterbedroom
payload: "CMD_REPORT_WIFI_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pizero_green
payload: "CMD_REPORT_WIFI_DETAILS"
retain: false
# Script to Query Disk Information - Publishes message 'CMD_REPORT_DISK_DETAILS'
# to MQTT, so that the message gets received by individual Raspberry Pi
###############################################################################
query_disk_info:
sequence:
- service: mqtt.publish
data:
topic: /server/pi_basement
payload: "CMD_REPORT_DISK_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pi_theater
payload: "CMD_REPORT_DISK_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pi_kitchen
payload: "CMD_REPORT_DISK_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pi_familyroom
payload: "CMD_REPORT_DISK_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pi_frontroom
payload: "CMD_REPORT_DISK_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pi_garage
payload: "CMD_REPORT_DISK_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pi_guest1
payload: "CMD_REPORT_DISK_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pi_guest2
payload: "CMD_REPORT_DISK_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pi_masterbedroom
payload: "CMD_REPORT_DISK_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pizero_green
payload: "CMD_REPORT_DISK_DETAILS"
retain: false
###############################################################################
# _ _ _
# /\ | | | | (_)
# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
# / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \/ __|
# / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | \__ \
# /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_|___/
#
###############################################################################
# Automations: Various automations to query and issue commands to Raspberry Pis
###############################################################################
automation:
# Queries WiFi Signal Level and Link Quality - it loads during startup, and
# updates once every 30 minutes
###############################################################################
- alias: Query RPi Wifi Data
initial_state: true
trigger:
- platform: time_pattern
minutes: "/30"
- platform: homeassistant
event: start
action:
- service: script.query_wifi_info
# Queries Disk Available and % Used - it loads during startup, and
# updates once every 30 minutes
###############################################################################
- alias: Query RPi Disk Data
initial_state: true
trigger:
- platform: time_pattern
minutes: "/30"
- platform: homeassistant
event: start
action:
- service: script.query_disk_info
# Issues commands to Raspberry Pi via MQTT - On Demand
###############################################################################
- alias: Raspberry Pi Command
initial_state: true
trigger:
- platform: state
entity_id: input_select.rpi_commands
condition:
- condition: template
value_template: "{{ states('input_select.raspberry_pis') | lower != 'select one' }}"
- condition: template
value_template: "{{ states('input_select.rpi_commands') | lower != 'select one' }}"
action:
service: mqtt.publish
data_template:
retain: false
topic: "{{ '/server/' ~ states('input_select.raspberry_pis') }}"
payload: >-
{% if states('input_select.rpi_commands') | lower == "restart server" %}
CMD_REBOOT_PI
{% elif states('input_select.rpi_commands') | lower == "restart snapcast" %}
CMD_RESTART_SNAPCLIENT
{% else %}
CMD_SHUTDOWN_PI
{% endif %}

View File

@@ -27,11 +27,6 @@ input_boolean:
name: Pill Taken
icon: mdi:pill
pill_on_vacation:
name: On Vacation
initial: off
icon: mdi:beach
pill_voice_notification:
name: Pill Voice Notification
icon: mdi:speaker
@@ -90,20 +85,6 @@ automation:
- service: input_boolean.turn_off
entity_id: input_boolean.pill_taken
###############################################################################
# Set the vacation mode automatically based on home security system state
# When travelling, make sure you add a reminder on your mobile phone
###############################################################################
- alias: Set Vacation Mode For Pills
initial_state: true
trigger:
platform: state
entity_id: alarm_control_panel.home
action:
- service_template: "input_boolean.turn_{{- 'on' if
states('alarm_control_panel.home') == 'armed_away' else 'off' }}"
entity_id: input_boolean.pill_on_vacation
###############################################################################
# Checks if the pills were taken - trigger on the pill reminder time
# Also, only remind if not on vacation or away from home
@@ -120,7 +101,7 @@ automation:
- condition: template
value_template: "{{ states('input_boolean.pill_taken') == 'off' }}"
- condition: template
value_template: "{{ states('input_boolean.pill_on_vacation') == 'off' }}"
value_template: "{{ states('input_boolean.home_mode_away') == 'off' }}"
action:
- service: script.remind_pill

View File

@@ -282,7 +282,7 @@ automation:
condition: and
conditions:
- condition: template
value_template: '{{ states.input_boolean.trash_reminders.state == "on" }}'
value_template: "{{ states('input_boolean.trash_reminders') == 'on' }}"
- condition: or
conditions:
- condition: state

View File

@@ -1,186 +0,0 @@
# NOTE: THIS CODE WORKS! I NO LONGER USE RPI FOR MY HA ANYMORE. HENCE THE CODE IS COMMENTED.
# PLEASE FEEL FREE TO COPY THE CODE AND UNCOMMENT IT, AND SHOULD WORK OUT OF THE BOX
# ###############################################################################
# # @author : Mahasri Kalavala
# # @date : 04/15/2017
# # @package : RF Outlets
# # @description : Etekcity RF Outlet Sensors and Automations
# ###############################################################################
# homeassistant:
# customize:
# group.etekcity_rf_switches:
# order: 13
# switch.switch_one:
# friendly_name: Switch One
# switch.switch_two:
# friendly_name: Switch Two
# switch.switch_three:
# friendly_name: Switch Three
# switch.switch_four:
# friendly_name: Switch Four
# switch.switch_five:
# friendly_name: Switch Five
# sensor.rf_switch_one:
# hidden: true
# sensor.rf_switch_two:
# hidden: true
# sensor.rf_switch_three:
# hidden: true
# sensor.rf_switch_four:
# hidden: true
# sensor.rf_switch_five:
# hidden: true
# ###############################################################################
# # RF Switches
# ###############################################################################
# switch:
# - platform: rpi_rf
# gpio: 17
# switches:
# switch_one:
# code_on: !secret rf_switch_1_code_on
# code_off: !secret rf_switch_1_code_off
# pulselength: !secret rf_switch_1_pulselength
# switch_two:
# code_on: !secret rf_switch_2_code_on
# code_off: !secret rf_switch_2_code_off
# pulselength: !secret rf_switch_2_pulselength
# switch_three:
# code_on: !secret rf_switch_3_code_on
# code_off: !secret rf_switch_3_code_off
# pulselength: !secret rf_switch_3_pulselength
# switch_four:
# code_on: !secret rf_switch_4_code_on
# code_off: !secret rf_switch_4_code_off
# pulselength: !secret rf_switch_4_pulselength
# switch_five:
# code_on: !secret rf_switch_5_code_on
# code_off: !secret rf_switch_5_code_off
# pulselength: !secret rf_switch_5_pulselength
# ###############################################################################
# # Sensor Definitions
# ###############################################################################
# sensor:
# - platform: mqtt
# state_topic: "/home/rfswitches/switch_one"
# name: "RF Switch One"
# value_template: "{{ value }}"
# - platform: mqtt
# state_topic: "/home/rfswitches/switch_two"
# name: "RF Switch Two"
# value_template: "{{ value }}"
# - platform: mqtt
# state_topic: "/home/rfswitches/switch_three"
# name: "RF Switch Three"
# value_template: "{{ value }}"
# - platform: mqtt
# state_topic: "/home/rfswitches/switch_four"
# name: "RF Switch Four"
# value_template: "{{ value }}"
# - platform: mqtt
# state_topic: "/home/rfswitches/switch_five"
# name: "RF Switch Five"
# value_template: "{{ value }}"
# ###############################################################################
# # Automation - Saves Switch State to MQTT
# ###############################################################################
# automation:
# # When the switch state changes (programatically or by UI), save the state to MQTT
# - alias: Save RF Switch State
# initial_state: true
# trigger:
# platform: state
# entity_id:
# - switch.switch_one
# - switch.switch_two
# - switch.switch_three
# - switch.switch_four
# - switch.switch_five
# action:
# service: mqtt.publish
# data_template:
# topic: "/home/rfswitches/{{ trigger.entity_id.split('.')[1] }}"
# retain: true
# qos: 1
# payload: '{{ trigger.to_state.state }}'
# # When the switch state is updated in MQTT (for remove integration), reload the Switch to that state
# - alias: Sync MQTT and Switch States
# initial_state: true
# trigger:
# platform: state
# entity_id:
# - sensor.rf_switch_one
# - sensor.rf_switch_two
# - sensor.rf_switch_three
# - sensor.rf_switch_four
# - sensor.rf_switch_five
# action:
# - service_template: >
# {%- if trigger.to_state.state | lower == "on" -%}
# homeassistant.turn_on
# {%- else -%}
# homeassistant.turn_off
# {%- endif -%}
# data_template:
# entity_id: 'switch.switch_{{ trigger.entity_id.split(".")[1].split("_")[2]}}'
# ###############################################################################
# # Startup event - restores states of dropdowns, and RF Switches...etc
# ###############################################################################
# - alias: Restore RF Switch Status on Startup
# initial_state: true
# trigger:
# platform: homeassistant
# event: start
# action:
# - delay:
# minutes: 1
# - service_template: >
# {%- if states('sensor.rf_switch_one') | lower == "on" -%}
# homeassistant.turn_on
# {%- else -%}
# homeassistant.turn_off
# {%- endif -%}
# entity_id: switch.switch_one
# - service_template: >
# {%- if states('sensor.rf_switch_two') | lower == "on" -%}
# homeassistant.turn_on
# {%- else -%}
# homeassistant.turn_off
# {%- endif -%}
# entity_id: switch.switch_two
# - service_template: >
# {%- if states('sensor.rf_switch_three') | lower == "on" -%}
# homeassistant.turn_on
# {%- else -%}
# homeassistant.turn_off
# {%- endif -%}
# entity_id: switch.switch_three
# - service_template: >
# {%- if states('sensor.rf_switch_four') | lower == "on" -%}
# homeassistant.turn_on
# {%- else -%}
# homeassistant.turn_off
# {%- endif -%}
# entity_id: switch.switch_four
# - service_template: >
# {%- if states('sensor.rf_switch_five') | lower == "on" -%}
# homeassistant.turn_on
# {%- else -%}
# homeassistant.turn_off
# {%- endif -%}
# data:
# entity_id: switch.switch_five

View File

@@ -80,14 +80,13 @@ script:
- service: script.all_indoor_lights_off
- service: input_boolean.turn_on
entity_id: input_boolean.notify_camera_alerts
- service: climate.set_away_mode
- service: alarm_control_panel.alarm_arm_away
data:
entity_id: climate.dining_room
away_mode: "true"
entity_id: alarm_control_panel.home
- service: script.notify_me
data:
message: >
No one is at home. Cameras rolling, Indoor lights OFF, Thermostat is set to 'away' and your home is secured!
No one is at home. Cameras rolling, Indoor lights are OFF. Your home security system is turned ON!
###############################################################################
# The following script runs when no one is home. It excludes some lights
@@ -111,28 +110,18 @@ script:
entity_id:
- switch.basement_left
- switch.basement_right
- switch.downstairs_fragrance
- switch.front_room
- switch.garage
- switch.garage_shop_lights
- switch.guest_bedroom
- switch.kids_bed_accent
- switch.kids_bedroom
- switch.kitchen
- switch.srinika_bedroom
- switch.hasika_bed_accent
- switch.hasika_bedroom
- switch.kitchen_switch
- switch.office_room
- switch.prayer_room
- switch.upstairs_fragrance
- switch.guest_room
- switch.officeroom_accent_lights
stop_hass:
sequence:
- service: shell_command.stop_hass
update_hass:
sequence:
- service: shell_command.update_hass
restart_hass:
sequence:
- service: shell_command.restart_hass
- switch.chromecast_monitor
- switch.master_bathroom_lights
xiaomi_red:
sequence:
@@ -186,8 +175,8 @@ script:
state: "on"
- condition: template
value_template: '{{- message | trim != "" -}}'
- service: notify.telegram
data_template:
- service: telegram_bot.send_message
data:
title: "{{- title -}}"
message: "{{- message -}}"
data:
@@ -202,9 +191,15 @@ script:
state: "on"
- condition: template
value_template: '{{ message | trim != "" }}'
- service: notify.telegram
data_template:
- service: telegram_bot.send_message
data:
message: "{{ message }}"
- service: notify.android_tv_fire_tv
data:
message: "{{ message }}"
title: "Hello!"
data:
color: red
good_night_tts:
sequence:
@@ -363,8 +358,12 @@ script:
- service: input_boolean.turn_on
entity_id: input_boolean.pill_taken
- service: script.notify_me
data:
message: "Thank you for taking tablets on time!"
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

View File

@@ -10,10 +10,6 @@
homeassistant:
sensor:
- platform: season
type: astronomical
###############################################################################
# _ _ _
# /\ | | | | (_)

View File

@@ -56,18 +56,79 @@ input_datetime:
input_number:
calendar_remind_before_days:
name: Calendar Remind Before Days
initial: 2
min: 1
max: 15
step: 1
mode: box
battery_alert_threshold:
name: Notify Low Battery if goes below
initial: 4
min: 1
max: 100
step: 1
mode: box
guest_bathroom_exhaust_timer_duration:
name: Guest Bathroom Shower Exhaust Timer Duration
min: 5
max: 240
step: 5
mode: box
master_bathroom_shower_exhaust_timer_duration:
name: Master Bathroom Shower Exhaust Timer Duration
min: 5
max: 240
step: 5
mode: box
master_bathroom_toilet_exhaust_timer_duration:
name: Master Bathroom Toilet Exhaust Timer Duration
min: 5
max: 240
step: 5
mode: box
master_bathroom_toilet_lights:
name: Master Bathroom Toilet Lights Duration
min: 5
max: 240
step: 5
mode: box
guest_bathroom_lights:
name: Guest Bathroom Lights Duration
min: 5
max: 240
step: 5
mode: box
master_bathroom_lights:
name: Master Bathroom Lights Duration
min: 5
max: 240
step: 5
mode: box
garage_lights:
name: Garage Lights Duration
min: 5
max: 240
step: 5
mode: box
garage_shop_lights:
name: Garage Shop Lights Duration
min: 5
max: 240
step: 5
mode: box
######################### CLOSET LIGHTS
hasika_bedroom_closet_lights:
name: Hasika Closet Lights Duration
min: 5
max: 120
step: 5
mode: box
srinika_bedroom_closet_lights:
name: Srinika Closet Lights Duration
min: 5
max: 120
step: 5
mode: box
sensor:
- platform: template
@@ -202,11 +263,6 @@ input_boolean:
name: Battery Notifications
icon: mdi:battery
sharp_tv:
name: TV
initial: on
icon: mdi:television-classic
dummy:
name: "Dummy Input Boolean!"
icon: mdi:sticker-emoji

View File

@@ -1,57 +0,0 @@
homeassistant:
# customize:
# The scan_interval is now set to 6 hours
# Leaving it to the default (which is 5 minutes, or 300 seconds) will drain battery at a rate of
# 10 miles per day (or 3% battery use) on an average. Use this setting carefully!
tesla:
username: !secret tesla_username
password: !secret tesla_password
scan_interval: 21600
###############################################################################
# _ _ _
# /\ | | | | (_)
# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
# / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \/ __|
# / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | \__ \
# /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_|___/
#
###############################################################################
automation:
- alias: Notify Charging Status
initial_state: true
trigger:
- platform: state
entity_id: binary_sensor.tesla_model_3_charger_sensor
action:
- service: script.notify_me
data_template:
message: "Tesla Car Charge Status changed to: {{ trigger.to_state.state| upper }}"
- alias: Notify Door Status
initial_state: true
trigger:
- platform: state
entity_id: lock.tesla_model_3_door_lock
condition:
- condition: template
value_template: '{{ trigger.from_state.state | lower != "unknown" }}'
action:
- service: script.notify_me
data_template:
message: "Tesla Door is now: {{ trigger.to_state.state | upper }}"
- alias: Notify Charger Switch State
initial_state: true
trigger:
- platform: state
entity_id: switch.tesla_model_3_charger_switch
condition:
- condition: template
value_template: '{{ trigger.from_state.state | lower != "unknown" }}'
action:
- service: script.notify_me
data_template:
message: "Tesla Door is now: {{ trigger.to_state.state| upper }}"

View File

@@ -12,13 +12,6 @@ binary_sensor:
payload_off: "off"
value_template: "{{ value }}"
- platform: mqtt
name: Sharp TV Command State
state_topic: "/home/sharp_tv_cmd"
payload_on: "on"
payload_off: "off"
value_template: "{{ value }}"
###############################################################################
# _ _ _
# /\ | | | | (_)
@@ -29,26 +22,33 @@ binary_sensor:
#
###############################################################################
automation:
# Restore Familyroom Lights
###############################################################################
- alias: Restore Familyroom Lights
- alias: TV Status ON
initial_state: true
trigger:
platform: state
entity_id: input_boolean.animate_downstairs_lights
to: "off"
condition:
- condition: state
entity_id: input_boolean.light_automations
state: "on"
entity_id: remote.streaming_stick_4k
to: "on"
action:
- service: light.turn_on
data:
entity_id: group.family_room_lights
transition: 5
rgb_color: [255, 251, 245]
brightness: 255
color_temp: 162
- service: mqtt.publish
data_template:
topic: "/home/sharptv"
payload: "on"
retain: true
- alias: TV Status OFF
initial_state: true
trigger:
platform: state
entity_id: remote.streaming_stick_4k
to: "unavailable"
action:
- service: mqtt.publish
data_template:
topic: "/home/sharptv"
payload: "off"
retain: true
# Dim Family Room Lights When TV is Turned ON
###############################################################################

View File

@@ -1,105 +0,0 @@
###############################################################################
# @Author : Mahasri Kalavala
# @Date : 01/27/2018
# @Package : USPS Package - notifies me of mails and packages.
###############################################################################
homeassistant:
customize:
sensor.usps_mail:
friendly_name: USPS Mail
icon: mdi:email-outline
sensor.usps_packages:
friendly_name: USPS Packages
icon: mdi:package-variant
sensor:
- platform: mqtt
name: "USPS Mail"
state_topic: "/usps/mails"
value_template: "{{ value }}"
- platform: mqtt
name: USPS Packages
state_topic: "/usps/packages"
value_template: "{{ value }}"
camera:
- platform: generic
name: USPS Mail Pictures
still_image_url: !secret usps_camera_url
###############################################################################
# _ _ _
# /\ | | | | (_)
# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
# / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \/ __|
# / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | \__ \
# /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_|___/
#
###############################################################################
automation:
# Notify USPS mails via TTS, and iOS notification with attachment
###############################################################################
- alias: Notify USPS Mail
initial_state: true
trigger:
- platform: state
entity_id: sensor.usps_mail
condition:
- condition: template
value_template: "{{ states('sensor.usps_mail') != 'unknown' }}"
- condition: template
value_template: "{{ states('sensor.usps_mail') | int > 0 }}"
- condition: template
value_template: "{{ ((now().hour | int) > 7) and ((now().hour | int) < 16) }}"
action:
- service: script.voice_notify
data_template:
message: >
{%- if states('sensor.usps_mail') | int == 1 -%}
Attention: USPS is delivering {{ states('sensor.usps_mail') }} mail today.
{%- else -%}
Attention: USPS is delivering {{ states('sensor.usps_mail') }} mails today.
{%- endif -%}
- service: script.led_message
data_template:
message: >
{%- if states('sensor.usps_mail') | int == 1 -%}
USPS is delivering {{ states('sensor.usps_mail') }} mail today.
{%- else -%}
USPS is delivering {{ states('sensor.usps_mail') }} mails today.
{%- endif -%}
- service: notify.ios_devices
data_template:
message: "USPS will be delivering {{ states('sensor.usps_mail') }} mail(s) today."
data:
push:
category: camera
entity_id: "camera.usps_mail_pictures"
attachment:
url: "{{ state_attr('camera.usps_mail_pictures', 'entity_picture') }}"
content-type: jpg
# Notify USPS packages via TTS. Usually there are no pictures for packages
###############################################################################
- alias: Notify USPS Packages
initial_state: true
trigger:
- platform: state
entity_id: sensor.usps_packages
condition:
- condition: template
value_template: "{{ states('sensor.usps_packages') != 'unknown' }}"
- condition: template
value_template: "{{ states('sensor.usps_packages') | int > 0 }}"
- condition: template
value_template: "{{ ((now().hour | int) > 7) and ((now().hour | int) < 16) }}"
action:
- service: script.voice_notify
data_template:
message: >
{%- if states('sensor.usps_packages') | int == 1 -%}
Attention: USPS is delivering {{ states('sensor.usps_packages') }} package today.
{%- else -%}
Attention: USPS is delivering {{ states('sensor.usps_packages') }} packages today.
{%- endif -%}

View File

@@ -106,7 +106,7 @@ automation:
# General Watch Dog automation:
# Keeps and eye on the lights & switches, turns off after 10 PM if they are on.
###############################################################################
- alias: Lights And Switches WatchDog
- alias: Lights And Switches WatchDog 10 Min
initial_state: true
trigger:
- platform: state
@@ -114,12 +114,11 @@ automation:
- switch.basement_left
- switch.basement_right
- switch.front_room
- switch.guest_bedroom
- switch.kids_bed_accent
- switch.kids_bedroom
- switch.kitchen
- switch.prayer_room
- switch.upstairs_fragrance
- switch.srinika_bedroom
- switch.hasika_bed_accent
- switch.hasika_bedroom
- switch.kitchen_switch
- switch.study_room
- light.hue_color_lamp_1
- light.hue_color_lamp_2
- light.hue_color_lamp_3
@@ -139,3 +138,281 @@ automation:
- service: homeassistant.turn_off
data_template:
entity_id: "{{ trigger.entity_id }}"
- alias: Guest Bathroom Lights WatchDog
initial_state: true
trigger:
- platform: state
entity_id:
- switch.guest_bathroom_lights
to: "on"
for:
minutes: "{{ states('input_number.guest_bathroom_lights')|int }}"
condition:
- condition: state
entity_id: input_boolean.light_automations
state: "on"
action:
- service: homeassistant.turn_off
data_template:
entity_id: "{{ trigger.entity_id }}"
- alias: Master Bathroom Lights WatchDog
initial_state: true
trigger:
- platform: state
entity_id:
- light.master_bathroom_lights
to: "on"
for:
minutes: "{{ states('input_number.master_bathroom_lights')|int }}"
condition:
- condition: state
entity_id: input_boolean.light_automations
state: "on"
action:
- service: homeassistant.turn_off
data_template:
entity_id: "{{ trigger.entity_id }}"
- alias: Garage Lights WatchDog
initial_state: true
trigger:
- platform: state
entity_id:
- switch.garage
to: "on"
for:
minutes: "{{ states('input_number.garage_lights')|int }}"
condition:
- condition: state
entity_id: input_boolean.light_automations
state: "on"
action:
- service: homeassistant.turn_off
data_template:
entity_id: "{{ trigger.entity_id }}"
- alias: Garage Shop Lights WatchDog
initial_state: true
trigger:
- platform: state
entity_id:
- switch.garage_shop_lights
to: "on"
for:
minutes: "{{ states('input_number.garage_shop_lights')|int }}"
condition:
- condition: state
entity_id: input_boolean.light_automations
state: "on"
action:
- service: homeassistant.turn_off
data_template:
entity_id: "{{ trigger.entity_id }}"
- alias: Guest Bathroom Exhaust WatchDog
initial_state: true
trigger:
- platform: state
entity_id:
- switch.guest_bathroom_exhaust
to: "on"
for:
minutes: "{{ states('input_number.guest_bathroom_exhaust_timer_duration')|int }}"
condition:
- condition: state
entity_id: input_boolean.light_automations
state: "on"
action:
- service: homeassistant.turn_off
data_template:
entity_id: "{{ trigger.entity_id }}"
- alias: Master Bathroom Shower Exhaust WatchDog
initial_state: true
trigger:
- platform: state
entity_id:
- switch.master_bathroom_shower_exhaust
to: "on"
for:
minutes: "{{ states('input_number.master_bathroom_shower_exhaust_timer_duration')|int }}"
condition:
- condition: state
entity_id: input_boolean.light_automations
state: "on"
action:
- service: homeassistant.turn_off
data_template:
entity_id: "{{ trigger.entity_id }}"
- alias: Master Bathroom Toilet Exhaust WatchDog
initial_state: true
trigger:
- platform: state
entity_id:
- switch.master_bathroom_toilet_exhaust
to: "on"
for:
minutes: "{{ states('input_number.master_bathroom_toilet_exhaust_timer_duration')|int }}"
condition:
- condition: state
entity_id: input_boolean.light_automations
state: "on"
action:
- service: homeassistant.turn_off
data_template:
entity_id: "{{ trigger.entity_id }}"
#############################################################################
# CLOSET LIGHTS WATCH DOG
#############################################################################
- alias: Srinika Bedroom Closet WatchDog
initial_state: true
trigger:
- platform: state
entity_id:
- switch.srinika_bedroom_closet
to: "on"
for:
minutes: "{{ states('input_number.srinika_bedroom_closet_lights')|int }}"
condition:
- condition: state
entity_id: input_boolean.light_automations
state: "on"
action:
- service: homeassistant.turn_off
data_template:
entity_id: "{{ trigger.entity_id }}"
- alias: Hasika Bedroom Closet WatchDog
initial_state: true
trigger:
- platform: state
entity_id:
- switch.hasika_bedroom_closet
to: "on"
for:
minutes: "{{ states('input_number.hasika_bedroom_closet_lights')|int }}"
condition:
- condition: state
entity_id: input_boolean.light_automations
state: "on"
action:
- service: homeassistant.turn_off
data_template:
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

@@ -115,6 +115,7 @@ binary_sensor:
weather:
- platform: darksky
api_key: !secret darksky_api_key
mode: daily
sensor:
- platform: darksky

View File

@@ -1,87 +0,0 @@
###############################################################################
# @author : Mahasri Kalavala
# @date : 11/07/2017
# @package : Work From Home (wfh)
# @description : Reminds me to Get Up and Walk around the house once
# every 30 minutes during Work From Home days
###############################################################################
homeassistant:
customize:
timer.wfh_timer:
hidden: true
timer:
wfh_timer:
duration: "00:30:00"
###############################################################################
# _ _ _
# /\ | | | | (_)
# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
# / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \/ __|
# / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | \__ \
# /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_|___/
#
###############################################################################
automation:
# Start WFH timer if Suresh is HOME during weekdays between 10 AM and 5 PM
###############################################################################
- alias: WFH Timer Start
initial_state: false
trigger:
- platform: time_pattern
minutes: "/5"
seconds: 00
condition:
- condition: template
value_template: "{{ states('binary_sensor.workday_sensor') == 'on' }}"
- condition: template
value_template: "{{ now().hour|int >= 10 and now().hour|int < 17 }}"
- condition: template
value_template: "{{ states('timer.wfh_timer') == 'idle' }}"
- condition: template
value_template: "{{ states('device_tracker.life360_suresh') == 'home' }}"
action:
- service: timer.start
entity_id: timer.wfh_timer
# Timer elapsed... Remind Suresh to take a quick walk
# Restart the timer ONLY if the time is betwen office hours (10 AM and 5 PM)
###############################################################################
- alias: Timer Elapsed - Take a walk
initial_state: false
trigger:
- platform: event
event_type: timer.finished
event_data:
entity_id: timer.wfh_timer
action:
- service_template: >
{% if now().hour | int >= 10 and now().hour | int < 17 %}
timer.start
{% else %}
timer.cancel
{% endif %}
entity_id: timer.wfh_timer
- condition: template
value_template: "{{ now().hour|int >= 10 and now().hour|int < 17 }}"
- service: script.voice_notify
data_template:
message: "It is time to stand up and walk around!"
# Cancel timer (if active) When Suresh left home
###############################################################################
- alias: Cancel WFH Timer When Suresh Leaves Home
initial_state: false
trigger:
- platform: zone
entity_id: device_tracker.life360_suresh
zone: zone.home
event: leave
condition:
- condition: template
value_template: "{{ states('timer.wfh_timer') == 'active' }}"
action:
- service: timer.cancel
entity_id: timer.wfh_timer

View File

@@ -75,7 +75,7 @@ automation:
state: "on"
action:
- service: switch.toggle
entity_id: switch.kitchen
entity_id: switch.kitchen_switch
# Double Tap: Turn OFF Downstairs Lights
- alias: Family Room Cube Event Tap Twice
@@ -186,7 +186,7 @@ automation:
state: "on"
action:
- service_template: switch.toggle
entity_id: switch.guest_bedroom
entity_id: switch.srinika_bedroom
# Shake: Toggle Do Not Disturb Mode
- alias: Srinika Room Cube Event Shake
@@ -227,7 +227,7 @@ automation:
state: "on"
action:
- service_template: switch.toggle
entity_id: switch.kids_bedroom
entity_id: switch.hasika_bedroom
# Shake: Toggle Do Not Disturb Mode
- alias: Hasika Room Cube Event Shake
@@ -270,7 +270,7 @@ automation:
state: "on"
action:
- service: switch.toggle
entity_id: switch.prayer_room
entity_id: switch.study_room
# Shake: Toggle Do Not Disturb Mode
- alias: Study Room Cube Event Shake
@@ -311,9 +311,11 @@ automation:
state: "on"
action:
- service: homeassistant.turn_off
entity_id: group.downstairs_lights
data:
entity_id: group.downstairs_lights
- service: homeassistant.turn_off
entity_id: group.upstairs_lights
data:
entity_id: group.upstairs_lights
# Flip 180: Toggle Lights
- alias: Master Bedroom Cube Event Flip180
@@ -428,6 +430,7 @@ automation:
{% else %}
script.play_dog_sounds
{% endif %}
- service: script.doorbell_camera_pics
- alias: Doorbell Double Press
initial_state: true
@@ -444,6 +447,7 @@ automation:
{% else %}
script.play_dog_sounds
{% endif %}
- service: script.doorbell_camera_pics
- alias: Doorbell Long Press
initial_state: true
@@ -460,3 +464,43 @@ automation:
{% else %}
script.play_dog_sounds
{% endif %}
- service: script.doorbell_camera_pics
################################################################################
# Script for sending camera snapshots when doorbell is pressed
################################################################################
script:
doorbell_camera_pics:
sequence:
- service: script.notify_me
data:
message: "ALERT! Someone is at the front door!"
- service: camera.snapshot
data_template:
entity_id: "camera.frontdoor_camera"
filename:
"{{ '/config/www/downloads/camera/frontdoor/frontdoor_' ~
(state_attr('script.doorbell_camera_pics', 'last_triggered') ~ '').replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- service: camera.snapshot
data_template:
entity_id: "camera.driveway_camera"
filename:
"{{ '/config/www/downloads/camera/driveway/driveway_' ~
(state_attr('script.doorbell_camera_pics', 'last_triggered') ~ '').replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- service: notify.telegram
data_template:
title: "Door Bell"
message: "Someone rang door bell!"
data:
photo:
- file: "{{ '/config/www/downloads/camera/frontdoor/frontdoor_' ~
(state_attr('script.doorbell_camera_pics', 'last_triggered') ~ '').replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
caption: "Someone rang door bell!"
- file: "{{ '/config/www/downloads/camera/driveway/driveway_' ~
(state_attr('script.doorbell_camera_pics', 'last_triggered') ~ '').replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
caption: "Someone rang door bell!"

View File

@@ -10,18 +10,9 @@ homeassistant:
friendly_name: Away Mode
zone.home:
friendly_name: Home
zone.work:
friendly_name: Office
group.zone_alerts:
order: 40
zone:
- name: work
latitude: !secret work_latitude
longitude: !secret work_longitude
radius: 200
icon: mdi:briefcase
input_boolean:
home_mode_away:
name: Away
@@ -29,11 +20,7 @@ input_boolean:
proximity:
home:
devices: device_tracker.life360_suresh
tolerance: 50
unit_of_measurement: mi
work:
devices: device_tracker.life360_suresh
devices: device_tracker.suresh
tolerance: 50
unit_of_measurement: mi
@@ -56,16 +43,12 @@ automation:
trigger:
- platform: zone
entity_id:
- device_tracker.life360_hasika
- device_tracker.life360_mallika
- device_tracker.life360_srinika
- device_tracker.life360_suresh
- device_tracker.hasika
- device_tracker.mallika
- device_tracker.srinika
- device_tracker.suresh
zone: zone.home
event: enter
- platform: zone
entity_id: device_tracker.life360_suresh
zone: zone.work
event: enter
condition:
- condition: template
value_template: "{{ states('input_boolean.zone_alerts') == 'on' }}"
@@ -85,16 +68,12 @@ automation:
trigger:
- platform: zone
entity_id:
- device_tracker.life360_hasika
- device_tracker.life360_mallika
- device_tracker.life360_srinika
- device_tracker.life360_suresh
- device_tracker.hasika
- device_tracker.mallika
- device_tracker.srinika
- device_tracker.suresh
zone: zone.home
event: leave
- platform: zone
entity_id: device_tracker.life360_suresh
zone: zone.work
event: leave
condition:
- condition: template
value_template: "{{ states('input_boolean.zone_alerts') == 'on' }}"
@@ -119,10 +98,10 @@ automation:
trigger:
- platform: state
entity_id:
- device_tracker.life360_mallika
- device_tracker.life360_suresh
- device_tracker.life360_srinika
- device_tracker.life360_hasika
- device_tracker.mallika
- device_tracker.suresh
- device_tracker.srinika
- device_tracker.hasika
from: "not_home"
to: "home"
for: "00:02:00"
@@ -142,32 +121,25 @@ automation:
greeting: "no"
- service: input_boolean.turn_off
entity_id: input_boolean.home_mode_away
- service: switch.turn_on
entity_id: switch.chromecast_monitor
##############################################################################
# Alert when every one is away
##############################################################################
- alias: Alert when everyone is AWAY
- alias: Poll Home Away Mode
initial_state: true
trigger:
platform: time_pattern
minutes: 00
seconds: "/30"
condition:
- condition: template
value_template: "{{ states('input_boolean.home_mode_away') == 'off' }}"
- condition: template
value_template: >
{% set suresh = states('device_tracker.life360_suresh') %}
{% set mallika = states('device_tracker.life360_mallika') %}
{% set srinika = states('device_tracker.life360_srinika') %}
{% set hasika = states('device_tracker.life360_hasika') %}
{% if suresh != "home" and mallika != "home" and srinika != "home" and hasika != "home" %}
True
{% else %}
False
{% endif %}
action:
- service: input_boolean.turn_on
- service_template: >-
{%- set suresh = states('device_tracker.suresh') -%}
{%- set mallika = states('device_tracker.mallika') -%}
{%- set srinika = states('device_tracker.srinika') -%}
{%- set hasika = states('device_tracker.hasika') -%}
{{ 'input_boolean.turn_on' if suresh != "home" and mallika != "home" and srinika != "home" and hasika != "home" else 'input_boolean.turn_off' }}
entity_id: input_boolean.home_mode_away
- alias: Home Mode Away ON
@@ -196,21 +168,3 @@ automation:
- service: script.notify_me
data_template:
message: "Suresh is on his way home, he is within the 5 miles range. Should be home soon!"
- condition: template
value_template: >
{% set suresh = states('device_tracker.life360_suresh') %}
{% set mallika = states('device_tracker.life360_mallika') %}
{% set srinika = states('device_tracker.life360_srinika') %}
{% set hasika = states('device_tracker.life360_hasika') %}
{% if suresh != "home" and mallika != "home" and srinika != "home" and hasika != "home" %}
True
{% else %}
False
{% endif %}
- service: climate.set_away_mode
data:
entity_id: climate.dining_room
away_mode: "false"
- service: script.notify_me
data_template:
message: "Your Nest thermostat is set to HOME mode. Thank you!"

View File

@@ -1,222 +0,0 @@
# ###############################################################################
# # @author : Mahasri Kalavala
# # @date : 04/20/2018
# # @package : zwave batteries
# # @description : Zwave batteries using input_label & MQTT
# ###############################################################################
# input_label:
# audio_detector:
# back_door_sensor:
# basement_door_sensor:
# downstairs_multi_sensor:
# zwave_front_door_sensor:
# front_room_multi_sensor:
# garage_door_sensor:
# guest_bedroom_multi_sensor:
# kitchen_motion_sensor:
# single_car_garage_door_tilt_sensor:
# stairs_motion_sensor:
# tv_multi_sensor:
# two_car_garage_door_tilt_sensor:
# upstairs_multi_sensor:
# wallmote:
# ecolink_motion_detector:
# ecolink_firefighter:
# ecolink_door_window_sensor_2:
# aeon_labs_zw100_multisensor_6_2:
# aeon_labs_zw100_multisensor_6:
# ecolink_door_window_sensor:
# ecolink_garage_door_tilt_sensor:
# suresh_battery:
# mallika_battery:
# srinika_battery:
# hasika_battery:
# suresh_charging:
# mallika_charging:
# srinika_charging:
# hasika_charging:
# suresh_wifi:
# mallika_wifi:
# srinika_wifi:
# hasika_wifi:
# ###############################################################################
# # _ _ _
# # /\ | | | | (_)
# # / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
# # / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \/ __|
# # / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | \__ \
# # /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_|___/
# #
# ###############################################################################
# automation:
# - alias: Update ZWave Battery Levels
# initial_state: true
# trigger:
# - platform: event
# event_type: state_changed
# condition:
# - condition: template
# value_template: "{{ trigger.event.data.entity_id is not none }}"
# - condition: template
# value_template: "{{ trigger.event.data.entity_id.split('.')[0] == 'zwave' }}"
# - condition: template
# value_template: "{{ trigger.event.data.new_state.attributes is not none }}"
# - condition: template
# value_template: "{{ trigger.event.data.new_state.attributes.battery_level | trim != '' }}"
# - condition: template
# value_template: "{{ trigger.event.data.new_state.attributes.battery_level | default(999) | int != 999 }}"
# action:
# - service: input_label.set_value
# data_template:
# entity_id: "input_label.{{- trigger.event.data.entity_id.split('.')[1] -}}"
# value: "{{ trigger.event.data.new_state.attributes.battery_level }}"
# - service: input_label.set_name
# data_template:
# entity_id: "input_label.{{- trigger.event.data.entity_id.split('.')[1] -}}"
# value: "{{ trigger.event.data.new_state.attributes.friendly_name }}'s Battery"
# - service: input_label.set_icon
# data_template:
# entity_id: "input_label.{{- trigger.event.data.entity_id.split('.')[1] -}}"
# value: >
# {% set battery_level = trigger.event.data.new_state.attributes.battery_level | int %}
# {% set battery_round = (battery_level / 10)|int * 10 %}
# {% if battery_round >= 100 %}
# mdi:battery
# {% elif battery_round > 0 %}
# mdi:battery-{{ battery_round }}
# {% else %}
# mdi:battery-alert
# {% endif %}
# # - alias: Update Phone Battery Levels
# # initial_state: true
# # trigger:
# # platform: mqtt
# # topic: "owntracks/+/+"
# # action:
# # - service: input_label.set_value
# # data_template:
# # entity_id: "input_label.{{trigger.topic.split('/')[-1]}}_wifi"
# # value: "{{ 'Yes' if trigger.payload_json.conn == 'w' else 'No' }}"
# # - service: input_label.set_icon
# # data_template:
# # entity_id: "input_label.{{trigger.topic.split('/')[-1]}}_wifi"
# # value: "{{ 'mdi:wifi' if trigger.payload_json.conn == 'w' else 'mdi:wifi-off' }}"
# # - service: input_label.set_name
# # data_template:
# # entity_id: "input_label.{{trigger.topic.split('/')[-1]}}_wifi"
# # value: "{{trigger.topic.split('/')[-1] | title }}'s phone wifi enabled?"
# # - service: input_label.set_value
# # data_template:
# # entity_id: "input_label.{{trigger.topic.split('/')[-1]}}_battery"
# # value: "{{ trigger.payload_json.batt | int }}"
# # - service: input_label.set_name
# # data_template:
# # entity_id: "input_label.{{trigger.topic.split('/')[-1]}}_battery"
# # value: "{{trigger.topic.split('/')[-1] | title }}'s Battery"
# # - service: input_label.set_icon
# # data_template:
# # entity_id: "input_label.{{trigger.topic.split('/')[-1]}}_battery"
# # value: >
# # {% set battery_level = trigger.payload_json.batt | int %}
# # {% set battery_round = (battery_level / 10)|int * 10 %}
# # {% if trigger.payload_json.charging == 1 %}
# # {% if battery_round >= 100 %}
# # mdi:battery-charging-100
# # {% elif battery_round > 0 %}
# # mdi:battery-charging-{{ battery_round }}
# # {% else %}
# # mdi:battery-alert
# # {% endif %}
# # {% else %}
# # {% if battery_round >= 100 %}
# # mdi:battery
# # {% elif battery_round > 0 %}
# # mdi:battery-{{ battery_round }}
# # {% else %}
# # mdi:battery-alert
# # {% endif %}
# # {% endif %}
# - alias: Update Phone Battery Levels From Life360
# initial_state: true
# trigger:
# - platform: event
# event_type: state_changed
# condition:
# - condition: template
# value_template: "{{ trigger.event.data.entity_id is not none }}"
# - condition: template
# value_template: "{{ 'life360_' in trigger.event.data.entity_id }}"
# - condition: template
# value_template: "{{ trigger.event.data.new_state.attributes is not none }}"
# action:
# - service: input_label.set_name
# data_template:
# entity_id: "input_label.{{- trigger.event.data.entity_id.split('.')[1].split('_')[1] -}}_battery"
# value: "{{- trigger.event.data.entity_id.split('.')[1].split('_')[1] |title -}}'s Battery"
# - service: input_label.set_value
# data_template:
# entity_id: "input_label.{{- trigger.event.data.entity_id.split('.')[1].split('_')[1] -}}_battery"
# value: "{{ trigger.event.data.new_state.attributes.battery }}"
# - service: input_label.set_icon
# data_template:
# entity_id: "input_label.{{- trigger.event.data.entity_id.split('.')[1].split('_')[1] -}}_battery"
# value: >
# {% set battery_level = trigger.event.data.new_state.attributes.battery | int %}
# {% set battery_round = (battery_level / 10)|int * 10 %}
# {% if trigger.event.data.new_state.attributes.battery_charging == "true" %}
# {% if battery_round >= 100 %}
# mdi:battery-charging-100
# {% elif battery_round > 0 %}
# mdi:battery-charging-{{ battery_round }}
# {% else %}
# mdi:battery-alert
# {% endif %}
# {% else %}
# {% if battery_round >= 100 %}
# mdi:battery
# {% elif battery_round > 0 %}
# mdi:battery-{{ battery_round }}
# {% else %}
# mdi:battery-alert
# {% endif %}
# {% endif %}
# - service: input_label.set_value
# data_template:
# entity_id: "input_label.{{- trigger.event.data.entity_id.split('.')[1].split('_')[1] -}}_wifi"
# value: "{{ 'WiFi' if trigger.event.data.new_state.attributes.wifi_on |string |lower == 'true' else 'LTE' }}"
# - service: input_label.set_value
# data_template:
# entity_id: "input_label.{{- trigger.event.data.entity_id.split('.')[1].split('_')[1] -}}_charging"
# value: "{{ 'Charging' if trigger.event.data.new_state.attributes.battery_charging |string |lower == 'true' else 'Not Charging' }}"
# - service: input_label.set_icon
# data_template:
# entity_id: "input_label.{{- trigger.event.data.entity_id.split('.')[1].split('_')[1] -}}_charging"
# value: >
# {% set battery_level = trigger.event.data.new_state.attributes.battery | int %}
# {% set battery_round = (battery_level / 10)|int * 10 %}
# {% if trigger.event.data.new_state.attributes.battery_charging == "true" %}
# {% if battery_round >= 100 %}
# mdi:battery-charging-100
# {% elif battery_round > 0 %}
# mdi:battery-charging-{{ battery_round }}
# {% else %}
# mdi:battery-alert
# {% endif %}
# {% else %}
# {% if battery_round >= 100 %}
# mdi:battery
# {% elif battery_round > 0 %}
# mdi:battery-{{ battery_round }}
# {% else %}
# mdi:battery-alert
# {% endif %}
# {% endif %}

View File

@@ -1,318 +0,0 @@
# #################################################################
# # @author : Mahasri Kalavala
# # @date : 09/18/17
# # @package : Z-Wave package
# # @description : Z-Wave Still and it's configuration stuff
# #
# # This entire page is auto generated by the script (link below):
# # https://github.com/skalavala/mysmarthome/blob/master/jinja_helpers/zwave_auto_gen.md
# #################################################################
# homeassistant:
# customize:
# # ZWave Binary Sensors
# binary_sensor.audio_detector_sensor:
# friendly_name: Audio Detector Sensor
# binary_sensor.basement_door_sensor_sensor:
# friendly_name: Basement Door Sensor
# binary_sensor.downstairs_multi_sensor_sensor:
# friendly_name: Downstairs Multi Sensor
# binary_sensor.front_door_sensor_sensor:
# friendly_name: Front Door Sensor
# binary_sensor.front_room_multi_sensor_sensor:
# friendly_name: Front Room Multi Sensor
# binary_sensor.garage_door_sensor_sensor:
# friendly_name: Garage Door Sensor
# binary_sensor.guest_bedroom_multi_sensor_sensor:
# friendly_name: Guest Bedroom Multi Sensor
# binary_sensor.kitchen_motion_sensor_sensor:
# friendly_name: Kitchen Motion Sensor
# binary_sensor.door_window_sensor_158d0004248d5b:
# friendly_name: Single Car Garage Door
# binary_sensor.stairs_motion_sensor_sensor:
# friendly_name: Stairs Motion Sensor
# binary_sensor.tv_multi_sensor_sensor:
# friendly_name: TV Multi Sensor
# binary_sensor.door_window_sensor_158d0004231f7b:
# friendly_name: Double Car Garage Door
# binary_sensor.upstairs_multi_sensor_sensor:
# friendly_name: Upstairs Multi Sensor
# # ZWave Sensors
# sensor.audio_detector_alarm_level:
# friendly_name: Audio Detector Alarm Level
# sensor.audio_detector_alarm_type:
# friendly_name: Audio Detector Alarm Type
# sensor.audio_detector_burglar:
# friendly_name: Audio Detector Burglar
# sensor.audio_detector_carbon_monoxide:
# friendly_name: Audio Detector Carbon Monoxide
# sensor.audio_detector_power_management:
# friendly_name: Audio Detector Power Management
# sensor.audio_detector_smoke:
# friendly_name: Audio Detector Smoke
# sensor.audio_detector_sourcenodeid:
# friendly_name: Audio Detector SourceNodeId
# sensor.audio_detector_temperature:
# friendly_name: Audio Detector Temperature
# sensor.back_door_sensor_access_control:
# friendly_name: Back Door Sensor Access Control
# sensor.back_door_sensor_alarm_level:
# friendly_name: Back Door Sensor Alarm Level
# sensor.back_door_sensor_alarm_type:
# friendly_name: Back Door Sensor Alarm Type
# sensor.back_door_sensor_burglar:
# friendly_name: Back Door Sensor Burglar
# sensor.back_door_sensor_power_management:
# friendly_name: Back Door Sensor Power Management
# sensor.back_door_sensor_sourcenodeid:
# friendly_name: Back Door Sensor SourceNodeId
# sensor.basement_door_sensor_access_control:
# friendly_name: Basement Door Sensor Access Control
# sensor.basement_door_sensor_alarm_level:
# friendly_name: Basement Door Sensor Alarm Level
# sensor.basement_door_sensor_alarm_type:
# friendly_name: Basement Door Sensor Alarm Type
# sensor.basement_door_sensor_burglar:
# friendly_name: Basement Door Sensor Burglar
# sensor.basement_door_sensor_power_management:
# friendly_name: Basement Door Sensor Power Management
# sensor.basement_door_sensor_sourcenodeid:
# friendly_name: Basement Door Sensor SourceNodeId
# sensor.downstairs_multi_sensor_alarm_level:
# friendly_name: Downstairs Multi Sensor Alarm Level
# sensor.downstairs_multi_sensor_alarm_type:
# friendly_name: Downstairs Multi Sensor Alarm Type
# sensor.downstairs_multi_sensor_burglar:
# friendly_name: Downstairs Multi Sensor Burglar
# sensor.downstairs_multi_sensor_luminance:
# friendly_name: Downstairs Multi Sensor Luminance
# sensor.downstairs_multi_sensor_power:
# friendly_name: Downstairs Multi Sensor Power
# sensor.downstairs_multi_sensor_relative_humidity:
# friendly_name: Downstairs Multi Sensor Relative Humidity
# sensor.downstairs_multi_sensor_sourcenodeid:
# friendly_name: Downstairs Multi Sensor SourceNodeId
# sensor.downstairs_multi_sensor_temperature:
# friendly_name: Downstairs Multi Sensor Temperature
# sensor.front_room_multi_sensor_alarm_level:
# friendly_name: Front Room Multi Sensor Alarm Level
# sensor.front_room_multi_sensor_alarm_type:
# friendly_name: Front Room Multi Sensor Alarm Type
# sensor.front_room_multi_sensor_burglar:
# friendly_name: Front Room Multi Sensor Burglar
# sensor.front_room_multi_sensor_luminance:
# friendly_name: Front Room Multi Sensor Luminance
# sensor.front_room_multi_sensor_relative_humidity:
# friendly_name: Front Room Multi Sensor Relative Humidity
# sensor.front_room_multi_sensor_sourcenodeid:
# friendly_name: Front Room Multi Sensor SourceNodeId
# sensor.front_room_multi_sensor_temperature:
# friendly_name: Front Room Multi Sensor Temperature
# sensor.front_room_multi_sensor_ultraviolet:
# friendly_name: Front Room Multi Sensor Ultraviolet
# sensor.garage_door_sensor_access_control:
# friendly_name: Garage Door Sensor Access Control
# sensor.garage_door_sensor_alarm_level:
# friendly_name: Garage Door Sensor Alarm Level
# sensor.garage_door_sensor_alarm_type:
# friendly_name: Garage Door Sensor Alarm Type
# sensor.garage_door_sensor_burglar:
# friendly_name: Garage Door Sensor Burglar
# sensor.garage_door_sensor_power_management:
# friendly_name: Garage Door Sensor Power Management
# sensor.garage_door_sensor_sourcenodeid:
# friendly_name: Garage Door Sensor SourceNodeId
# sensor.single_car_garage_door_sensor_status:
# friendly_name: Single Car Garage Door Sensor Status
# sensor.two_car_garage_door_sensor_status:
# friendly_name: Double Car Garage Door Sensor Status
# sensor.guest_bedroom_multi_sensor_alarm_level:
# friendly_name: Guest Bedroom Multi Sensor Alarm Level
# sensor.guest_bedroom_multi_sensor_alarm_type:
# friendly_name: Guest Bedroom Multi Sensor Alarm Type
# sensor.guest_bedroom_multi_sensor_burglar:
# friendly_name: Guest Bedroom Multi Sensor Burglar
# sensor.guest_bedroom_multi_sensor_luminance:
# friendly_name: Guest Bedroom Multi Sensor Luminance
# sensor.guest_bedroom_multi_sensor_relative_humidity:
# friendly_name: Guest Bedroom Multi Sensor Relative Humidity
# sensor.guest_bedroom_multi_sensor_sourcenodeid:
# friendly_name: Guest Bedroom Multi Sensor SourceNodeId
# sensor.guest_bedroom_multi_sensor_temperature:
# friendly_name: Guest Bedroom Multi Sensor Temperature
# sensor.guest_bedroom_multi_sensor_ultraviolet:
# friendly_name: Guest Bedroom Multi Sensor Ultraviolet
# sensor.kitchen_motion_sensor_alarm_level:
# friendly_name: Kitchen Motion Sensor Alarm Level
# sensor.kitchen_motion_sensor_alarm_type:
# friendly_name: Kitchen Motion Sensor Alarm Type
# sensor.kitchen_motion_sensor_burglar:
# friendly_name: Kitchen Motion Sensor Burglar
# sensor.kitchen_motion_sensor_power_management:
# friendly_name: Kitchen Motion Sensor Power Management
# sensor.kitchen_motion_sensor_sourcenodeid:
# friendly_name: Kitchen Motion Sensor SourceNodeId
# sensor.single_car_garage_door_tilt_sensor_access_control:
# friendly_name: Single Car Garage Door Tilt Sensor Access Control
# sensor.single_car_garage_door_tilt_sensor_alarm_level:
# friendly_name: Single Car Garage Door Tilt Sensor Alarm Level
# sensor.single_car_garage_door_tilt_sensor_alarm_type:
# friendly_name: Single Car Garage Door Tilt Sensor Alarm Type
# sensor.single_car_garage_door_tilt_sensor_burglar:
# friendly_name: Single Car Garage Door Tilt Sensor Burglar
# sensor.single_car_garage_door_tilt_sensor_power_management:
# friendly_name: Single Car Garage Door Tilt Sensor Power Management
# sensor.single_car_garage_door_tilt_sensor_sourcenodeid:
# friendly_name: Single Car Garage Door Tilt Sensor SourceNodeId
# sensor.stairs_motion_sensor_alarm_level:
# friendly_name: Stairs Motion Sensor Alarm Level
# sensor.stairs_motion_sensor_alarm_type:
# friendly_name: Stairs Motion Sensor Alarm Type
# sensor.stairs_motion_sensor_burglar:
# friendly_name: Stairs Motion Sensor Burglar
# sensor.stairs_motion_sensor_power_management:
# friendly_name: Stairs Motion Sensor Power Management
# sensor.stairs_motion_sensor_sourcenodeid:
# friendly_name: Stairs Motion Sensor SourceNodeId
# sensor.tv_multi_sensor_alarm_level:
# friendly_name: TV Multi Sensor Alarm Level
# sensor.tv_multi_sensor_alarm_type:
# friendly_name: TV Multi Sensor Alarm Type
# sensor.tv_multi_sensor_burglar:
# friendly_name: TV Multi Sensor Burglar
# sensor.tv_multi_sensor_luminance:
# friendly_name: TV Multi Sensor Luminance
# sensor.tv_multi_sensor_relative_humidity:
# friendly_name: TV Multi Sensor Relative Humidity
# sensor.tv_multi_sensor_sourcenodeid:
# friendly_name: TV Multi Sensor SourceNodeId
# sensor.tv_multi_sensor_temperature:
# friendly_name: TV Multi Sensor Temperature
# sensor.tv_multi_sensor_ultraviolet:
# friendly_name: TV Multi Sensor Ultraviolet
# sensor.two_car_garage_door_tilt_sensor_access_control:
# friendly_name: Two Car Garage Door Tilt Sensor Access Control
# sensor.two_car_garage_door_tilt_sensor_alarm_level:
# friendly_name: Two Car Garage Door Tilt Sensor Alarm Level
# sensor.two_car_garage_door_tilt_sensor_alarm_type:
# friendly_name: Two Car Garage Door Tilt Sensor Alarm Type
# sensor.two_car_garage_door_tilt_sensor_burglar:
# friendly_name: Two Car Garage Door Tilt Sensor Burglar
# sensor.two_car_garage_door_tilt_sensor_power_management:
# friendly_name: Two Car Garage Door Tilt Sensor Power Management
# sensor.two_car_garage_door_tilt_sensor_sourcenodeid:
# friendly_name: Two Car Garage Door Tilt Sensor SourceNodeId
# sensor.upstairs_multi_sensor_alarm_level:
# friendly_name: Upstairs Multi Sensor Alarm Level
# sensor.upstairs_multi_sensor_alarm_type:
# friendly_name: Upstairs Multi Sensor Alarm Type
# sensor.upstairs_multi_sensor_burglar:
# friendly_name: Upstairs Multi Sensor Burglar
# sensor.upstairs_multi_sensor_luminance:
# friendly_name: Upstairs Multi Sensor Luminance
# sensor.upstairs_multi_sensor_relative_humidity:
# friendly_name: Upstairs Multi Sensor Relative Humidity
# sensor.upstairs_multi_sensor_sourcenodeid:
# friendly_name: Upstairs Multi Sensor SourceNodeId
# sensor.upstairs_multi_sensor_temperature:
# friendly_name: Upstairs Multi Sensor Temperature
# sensor.upstairs_multi_sensor_ultraviolet:
# friendly_name: Upstairs Multi Sensor Ultraviolet
# sensor.wallmote_alarm_level:
# friendly_name: Wallmote Alarm Level
# sensor.wallmote_alarm_type:
# friendly_name: Wallmote Alarm Type
# sensor.wallmote_power_management:
# friendly_name: Wallmote Power Management
# sensor.wallmote_sourcenodeid:
# friendly_name: Wallmote SourceNodeId
# sensor.zwave_smart_switch_current:
# friendly_name: ZWave Smart Switch Current
# sensor.zwave_smart_switch_energy:
# friendly_name: ZWave Smart Switch Energy
# sensor.zwave_smart_switch_power:
# friendly_name: ZWave Smart Switch Power
# sensor.zwave_smart_switch_previous_reading:
# friendly_name: ZWave Smart Switch Previous Reading
# sensor.zwave_smart_switch_voltage:
# friendly_name: ZWave Smart Switch Voltage
# # ZWave Switches
# switch.kitchen_siren_switch:
# friendly_name: Kitchen Siren Switch 1
# switch.kitchen_siren_switch_2:
# friendly_name: Kitchen Siren Switch 2
# switch.kitchen_siren_switch_3:
# friendly_name: Kitchen Siren Switch 3
# switch.kitchen_siren_switch_4:
# friendly_name: Kitchen Siren Switch 4
# switch.kitchen_siren_switch_5:
# friendly_name: Kitchen Siren Switch 5
# switch.wallmote_switch:
# friendly_name: Wallmote Switch
# zwave:
# usb_path: /dev/ttyACM0
# network_key: !secret zwave_network_key
# ###############################################################################
# # _ _ _
# # /\ | | | | (_)
# # / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
# # / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \/ __|
# # / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | \__ \
# # /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_|___/
# #
# ###############################################################################
# automation:
# - alias: WallMote Button 1 Pressed
# trigger:
# - platform: event
# event_type: zwave.scene_activated
# event_data:
# entity_id: zwave.wallmote
# scene_id: 1
# action:
# - service: light.toggle
# entity_id: light.master_bedroom_1
# - service: light.toggle
# entity_id: light.master_bedroom_2
# - alias: WallMote Button 2 Pressed
# trigger:
# - platform: event
# event_type: zwave.scene_activated
# event_data:
# entity_id: zwave.wallmote
# scene_id: 2
# action:
# - service: homeassistant.turn_off
# entity_id: group.upstairs_lights
# - alias: WallMote Button 3 Pressed
# trigger:
# - platform: event
# event_type: zwave.scene_activated
# event_data:
# entity_id: zwave.wallmote
# scene_id: 3
# action:
# - service: climate.set_away_mode
# data_template:
# entity_id: climate.dining_room
# away_mode: "false"
# - alias: WallMote Button 4 Pressed
# trigger:
# - platform: event
# event_type: zwave.scene_activated
# event_data:
# entity_id: zwave.wallmote
# scene_id: 4
# action:
# - service: climate.set_away_mode
# data_template:
# entity_id: climate.dining_room
# away_mode: "true"