Compare commits

..

12 Commits

Author SHA1 Message Date
Mahasri Kalavala
04c001d2f3 Create traefik.yaml 2023-05-06 10:01:47 -04:00
Mahasri Kalavala
16e9576404 Create dynamic.yaml 2023-05-06 10:01:15 -04:00
Mahasri Kalavala
a347599b50 Create .env-sample 2023-05-06 09:55:45 -04:00
Mahasri Kalavala
890a2b1c81 Update docker-compose.yaml 2023-05-06 09:52:42 -04:00
Mahasri Kalavala
1da8b4c837 minor updates and fixes 2022-12-06 17:52:48 -05:00
Mahasri Kalavala
97c8ced097 clean up 2022-12-04 19:02:34 -05:00
Mahasri Kalavala
2d312aaf11 cleanup 2022-12-04 14:33:29 -05:00
Mahasri Kalavala
6a55c0f49f cleanup 2022-12-04 14:20:32 -05:00
Mahasri Kalavala
bb0cf6db6b reorganized code 2022-12-04 12:38:48 -05:00
Mahasri Kalavala
20bdf8ed76 changed notification system 2022-12-03 11:28:12 -05:00
Mahasri Kalavala
b9cfeeeea2 added notifications code 2022-12-02 21:44:37 -05:00
Mahasri Kalavala
dafef91d88 minor updates 2022-11-30 20:27:26 -05:00
41 changed files with 1774 additions and 1992 deletions

76
docker/.env-sample Normal file
View File

@@ -0,0 +1,76 @@
#
# SERVER & COMMON VARIABLES
#
ENV_PUID=1000
ENV_PGID=1000
SERVER_IP=192.168.x.x
ENV_TIMEZONE=America/New_York
#
# SECRETS
#
MQTT_USERNAME=
MQTT_PASSWORD=
RCLONE_USERNAME=
RCLONE_PASSWORD=
PIHOLE_WEBPASSWORD=
FRIGATE_RTSP_PASSWORD=
CONTAINERMON_NOTIFICATION_URL="telegram://1234567890:AAESL_DeadB33f_c4t-asdfasdfasfdasdf@telegram?chats=-987654321"
STREAMER_PARAMETERS=rtsp://192.168.x.x:8554/frontyard_camera frontyard
CLOUDFLARE_TOKEN=abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
#
# VOLUMES
#
VOL_MOSQUITTO_CONFIG_PATH=/home/suresh/mosquitto/config
VOL_MOSQUITTO_LOG_PATH=/home/suresh/mosquitto/log
VOL_MOSQUITTO_DATA_PATH=/home/suresh/mosquitto/data
VOL_HOME_ASSISTANT_CUSTOM_COMP_PATH=/home/suresh/homeassistant/custom_components
VOL_STREAMER_TEMP_STREAM_PATH=/tmp/stream
VOL_PORTAINER_DATA=/home/suresh/portainer_data
VOL_PIHOLE_CONFIG_PATH=/home/suresh/etc-pihole
VOL_PIHOLE_DNSMASQ_CONFIG_PATH=/home/suresh/etc-dnsmasq.d
VOL_HEIMDALL_CONFIG_PATH=/home/suresh/heimdall
VOL_NETBOOT_CONFIG_PATH=/home/suresh/netbootxyz/config
VOL_NETBOOT_ASSETS_PATH=/home/suresh/netbootxyz/assets
VOL_RCLONE_CONFIG_PATH=/home/suresh/docker/rclone_rclone
VOL_DASHY_CONFIG_PATH=/home/suresh/dashy/conf.yml
VOL_FRIGATE_MEDIA_PATH=/home/suresh/frigate
VOL_FRIGATE_CONFIG_YAML_PATH=/home/suresh/frigate/config.yml
VOL_HOME_ASSISTANT_CONFIG_PATH=/home/suresh/homeassistant
VOL_GO2RTC_PATH=/home/suresh/go2rtc
VOL_TRAEFIK_DYNAMIC_YAML=/home/suresh/traefik/dynamic.yaml
VOL_AIRSONIC_CONFIG=/home/suresh/airsonic/config
VOL_AIRSONIC_MUSIC=/home/suresh/airsonic/music
VOL_AIRSONIC_PLAYLISTS=/home/suresh/airsonic/playlists
VOL_AIRSONIC_PODCASTS=/home/suresh/airsonic/podcasts
#
# PORTS
#
PORT_HOME_ASSISTANT=
PORT_DOCKER_MON=
PORT_STREAMER=
PORT_PORTAINER=
PORT_GLANCES=
PORT_PIHOLE=
PORT_HEIMDALL=
PORT_HEIMDALL_SECURE=
PORT_DOZZLE=
PORT_NETBOOTXYZ=
PORT_TFTP=
PORT_NETBOOTXYZ_GUI=
PORT_RCLONE_GUI=
PORT_DASHY=

View File

@@ -1,84 +1,467 @@
version: '2' ##################################################################################
services: # _ _
mqtt: # | | | |
image: eclipse-mosquitto:latest # __| | ___ ___| | _____ _ __ ___ ___ _ __ ___ _ __ ___ ___ ___
container_name: "MQTT" # / _` |/ _ \ / __| |/ / _ \ '__| / __/ _ \| '_ ` _ \| '_ \ / _ \/ __|/ _ \
restart: always # | (_| | (_) | (__| < __/ | | (_| (_) | | | | | | |_) | (_) \__ \ __/
network_mode: "host" # \__,_|\___/ \___|_|\_\___|_| \___\___/|_| |_| |_| .__/ \___/|___/\___|
ports: # | |
- "1883:1883" # |_|
- "9001:9001" ##################################################################################
volumes: version: "3.0"
- /home/suresh/docker/mqtt/data:/mosquitto/data
- /home/suresh/docker/mqtt/config:/mosquitto/config
- /home/suresh/docker/mqtt/log:/mosquitto/log
home-assistant: services:
image: homeassistant/home-assistant:latest
container_name: "home_assistant" ##################################################################################
# Cloudflare Tunnel
##################################################################################
cloudflare:
image: cloudflare/cloudflared:latest
container_name: cloudflared-tunnel
command: tunnel run
environment:
- TUNNEL_TOKEN=${CLOUDFLARE_TOKEN}
restart: unless-stopped
##################################################################################
# MQTT Server
##################################################################################
mqtt:
container_name: mqtt
image: eclipse-mosquitto:latest
restart: always restart: always
network_mode: "host" volumes:
- ${VOL_MOSQUITTO_CONFIG_PATH}:/mosquitto/config
- ${VOL_MOSQUITTO_LOG_PATH}:/mosquitto/log
- ${VOL_MOSQUITTO_DATA_PATH}:/mosquitto/data
ports:
- 1883:1883
- 9001:9001
- 8585:8585
healthcheck:
test:
[
"CMD",
"mosquitto_sub",
"-u",
"${MQTT_USERNAME}",
"-P",
"${MQTT_PASSWORD}",
"-h",
"${SERVER_IP}",
"-t",
"$$SYS/broker/uptime",
"-C",
"1",
"-i",
"healthcheck",
"-W",
"3"
]
interval: 30s
timeout: 10s
retries: 3
##################################################################################
# Home Assistant
##################################################################################
homeassistant:
container_name: home-assistant
image: homeassistant/home-assistant:stable
restart: unless-stopped
network_mode: host
devices: devices:
- /dev/ttyACM0 - /dev/ttyUSB0
volumes:
- ${VOL_HOME_ASSISTANT_CONFIG_PATH}:/config
- ${VOL_HOME_ASSISTANT_CUSTOM_COMP_PATH}:/config/custom_components:ro
environment:
- TZ=${ENV_TIMEZONE}
depends_on: depends_on:
- mqtt - mqtt
healthcheck:
test:
[
"CMD",
"curl",
"-f",
"http://${SERVER_IP}:${PORT_HOME_ASSISTANT}"
]
interval: 1m
timeout: 10s
retries: 3
##################################################################################
# DockerMon
##################################################################################
docker_mon:
container_name: ha_dockermon
image: philhawthorne/ha-dockermon
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports: ports:
- "8123:8123" - ${PORT_DOCKER_MON}:${PORT_DOCKER_MON}
volumes: healthcheck:
- /home/homeassistant/.homeassistant/:/config test: wget --no-verbose --tries=1 --spider http://${SERVER_IP}:${PORT_DOCKER_MON}/container/ha_dockermon/ || exit 1
interval: 1m
timeout: 10s
start_period: 20s
retries: 3
homebridge: ##################################################################################
image: oznu/homebridge:latest # Camera Streamer (RTSP to HLS Streaming for Chromecasts)
container_name: "homebridge_docker" ##################################################################################
restart: always streamer:
network_mode: host container_name: streamer
image: skalavala/streamer
restart: unless-stopped
environment: environment:
- TZ=America/New_York - PARAMETERS=${STREAMER_PARAMETERS}
- PGID=1000
- PUID=1000
volumes: volumes:
- /home/suresh/docker/homebridge:/homebridge - ${VOL_STREAMER_TEMP_STREAM_PATH}:/tmp/stream
ports:
- ${PORT_STREAMER}:80
healthcheck:
test:
[
"CMD",
"curl",
"-f",
"http://${SERVER_IP}:${PORT_STREAMER}/frontyard.m3u8"
]
interval: 1m
timeout: 10s
retries: 3
depends_on: depends_on:
- home-assistant - go2rtc
##################################################################################
# Portainer
##################################################################################
portainer:
container_name: portainer
image: portainer/portainer-ce:latest
restart: unless-stopped
command: -H unix:///var/run/docker.sock
ports:
- "${PORT_PORTAINER}:${PORT_PORTAINER}"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "${VOL_PORTAINER_DATA}:/data"
##################################################################################
# Glances - https://glances.readthedocs.io/en/latest/docker.html
##################################################################################
glances:
container_name: glances
image: nicolargo/glances:latest
restart: unless-stopped
pid: host
secrets:
- source: glances_password
target: /root/.config/glances/glances.pwd
ports:
- ${PORT_GLANCES}:${PORT_GLANCES}
environment:
- TZ=${ENV_TIMEZONE}
- GLANCES_OPT=--webserver
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /var/docker/glances:/glances/conf
healthcheck:
test:
[
"CMD",
"curl",
"-f",
"http://${SERVER_IP}:${PORT_GLANCES}"
]
interval: 1m
timeout: 10s
retries: 3
##################################################################################
# Pi-Hole
##################################################################################
pihole:
container_name: pihole
image: pihole/pihole:latest
restart: unless-stopped
hostname: pihole-container
ports:
- "${PORT_PIHOLE}:${PORT_PIHOLE}/tcp"
environment:
TZ: ${ENV_TIMEZONE}
WEBPASSWORD: ${PIHOLE_WEBPASSWORD}
volumes:
- '${VOL_PIHOLE_CONFIG_PATH}:/etc/pihole'
- '${VOL_PIHOLE_DNSMASQ_CONFIG_PATH}:/etc/dnsmasq.d'
##################################################################################
# heimdall
##################################################################################
heimdall:
container_name: heimdall
image: linuxserver/heimdall:latest
ports:
- '${PORT_HEIMDALL}:80'
- '${PORT_HEIMDALL_SECURE}:443'
volumes:
- '/var/run/docker.sock:/tmp/docker.sock:ro'
- '${VOL_HEIMDALL_CONFIG_PATH}:/config'
restart: unless-stopped
logging:
options:
max-size: 1g
healthcheck:
test:
[
"CMD",
"/usr/bin/wget",
"-q",
"-O -",
"http://${SERVER_IP}:${PORT_HEIMDALL}"
]
interval: 30s
timeout: 5s
retries: 3
##################################################################################
# Dozzle for logs
##################################################################################
dozzle:
container_name: dozzle
image: amir20/dozzle:latest
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- ${PORT_DOZZLE}:8080
##################################################################################
# Netbootxyz - PXE Server in Docker
##################################################################################
netbootxyz:
image: lscr.io/linuxserver/netbootxyz:latest
container_name: netbootxyz
environment:
- PUID=${ENV_PUID}
- PGID=${ENV_PGID}
- TZ=${ENV_TIMEZONE}
- MENU_VERSION=1.9.9 #optional
- PORT_RANGE=30000:30010 #optional
- SUBFOLDER=/ #optional
volumes:
- ${VOL_NETBOOT_CONFIG_PATH}:/config
- ${VOL_NETBOOT_ASSETS_PATH}:/assets #optional
ports:
- ${PORT_NETBOOTXYZ}:3000
- ${PORT_TFTP}:69/udp
- ${PORT_NETBOOTXYZ_GUI}:80 #optional
restart: unless-stopped
##################################################################################
# rclone web gui
##################################################################################
rclone_rclone:
image: rclone/rclone
container_name: rclone_rclone
restart: always
command: rcd --rc-web-gui --rc-addr :${PORT_RCLONE_GUI} --rc-user ${RCLONE_USERNAME} --rc-pass ${RCLONE_PASSWORD}
ports:
- "${PORT_RCLONE_GUI}:${PORT_RCLONE_GUI}"
volumes:
- ${VOL_RCLONE_CONFIG_PATH}:/config/rclone
- ${VOL_RCLONE_CONFIG_PATH}:/logs
environment:
- PHP_TZ=${ENV_TIMEZONE}
- PUID=${ENV_PUID}
- PGID=${ENV_PUID}
##################################################################################
# dashy - Homelab Dashboard GUI
##################################################################################
dashy:
image: lissy93/dashy:latest
container_name: dashy
volumes:
- ${VOL_DASHY_CONFIG_PATH}:/app/public/conf.yml
environment:
- UID=${ENV_PUID}
- GID=${ENV_PGID}
restart: unless-stopped
ports:
- ${PORT_DASHY}:80
healthcheck:
test: [ 'CMD', 'node', '/app/services/healthcheck' ]
interval: 1m30s
timeout: 10s
retries: 3
start_period: 40s
networks:
- default
##################################################################################
# Frigate
##################################################################################
frigate:
container_name: frigate
restart: always
privileged: true
shm_size: "1g" # should work for 8 cameras
image: blakeblackshear/frigate:stable
# devices:
# - /dev/bus/usb:/dev/bus/usb # passes the USB Coral
# - /dev/apex_0:/dev/apex_0 # passes a PCIe Coral
# - /dev/dri/renderD128 # for intel hwaccel, needs to be updated for your hardware
volumes:
- /etc/localtime:/etc/localtime:ro
- ${VOL_HOME_ASSISTANT_CONFIG_PATH}:/config
- ${VOL_FRIGATE_MEDIA_PATH}:/media/frigate
- ${VOL_FRIGATE_CONFIG_YAML_PATH}:/config/config.yml
- type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
target: /tmp/cache
tmpfs:
size: 1000000000
ports:
- "5000:5000" # Console
- "1935:1935" # RTMP feeds
# - "8554:8554" # RTSP feeds
# - "8555:8555/tcp" # WebRTC over tcp
# - "8555:8555/udp" # WebRTC over udp
environment:
FRIGATE_RTSP_PASSWORD: ${FRIGATE_RTSP_PASSWORD}
LIBVA_DRIVER_NAME: i965
depends_on:
- go2rtc
##################################################################################
# go2rtc
##################################################################################
go2rtc:
container_name: go2rtc
image: alexxit/go2rtc:latest
network_mode: host # important for WebRTC, HomeKit, UDP cameras
privileged: true # only for FFmpeg hardware transcoding
restart: unless-stopped # autorestart on fail or config change from WebUI
environment:
- TZ=${ENV_TIMEZONE} # timezone in logs
volumes:
- "${VOL_GO2RTC_PATH}:/config" # folder for go2rtc.yaml file (edit from WebUI)
##################################################################################
# Influxdb
##################################################################################
influxdb: influxdb:
image: influxdb:latest image: influxdb:latest
container_name: influxdb container_name: influxdb
restart: always restart: always
network_mode: host environment:
- INFLUXDB_DB=influx
- INFLUXDB_ADMIN_USER=admin
- INFLUXDB_ADMIN_PASSWORD=admin
stdin_open: true
tty: true
ports: ports:
- 8086:8086 - '8086:8086'
- 8083:8083
volumes: volumes:
- /home/suresh/docker/influxdb/:/var/lib/influxdb - influxdb_data:/var/lib/influxdb
##################################################################################
# Grafana
##################################################################################
grafana: grafana:
image: grafana/grafana:latest image: grafana/grafana
container_name: grafana container_name: grafana
network_mode: host restart: always
ports:
- 3000:3000
volumes:
- /home/suresh/docker/grafana/:/var/lib/grafana
depends_on: depends_on:
- influxdb - influxdb
restart: always
docker_mon:
image: philhawthorne/ha-dockermon
container_name: ha_dockermon
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /path/to/config:/config
ports:
- 8126:8126
docker_machinebox:
image: machinebox/tagbox
container_name: machine_box
restart: always
ports:
- 8080:8080
environment: environment:
MB_KEY: !secret MB_KEY - GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_INSTALL_PLUGINS=
links:
- influxdb
ports:
- '3000:3000'
volumes:
- grafana_data:/var/lib/grafana
##################################################################################
# Traefik
##################################################################################
traefik:
image: traefik:latest
container_name: "traefik"
command:
- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"
- "--entrypoints.web.address=:80"
- "--entrypoints.traefik.address=8080"
labels:
- "traefik.enable=true"
- "traefik.http.routers.api.service=api@internal"
- "traefik.http.routers.api.rule=Host(`subdomain.domain.com`)"
ports:
- "80:80"
- "8082:8080"
networks:
- web
volumes:
- "/home/suresh/traefik/config:/config:ro"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "/home/suresh/traefik/config/traefik.yml:/etc/traefik/traefik.yaml:ro"
- "/home/suresh/traefik/config/dynamic.yaml:/etc/traefik/dynamic.yaml:ro"
##################################################################################
# Airsonic Audio Server
##################################################################################
airsonic:
container_name: airsonic
image: lscr.io/linuxserver/airsonic
environment:
- PUID=${ENV_PUID}
- PGID=${ENV_PGID}
- TZ=${ENV_TIMEZONE}
volumes:
- ${VOL_AIRSONIC_MUSIC}:/music
- ${VOL_AIRSONIC_CONFIG}:/config
- ${VOL_AIRSONIC_PODCASTS}:/podcasts
- ${VOL_AIRSONIC_PLAYLISTS}:/playlists
ports:
- 4040:4040
labels:
- "traefik.http.routers.airsonic.entrypoints=web"
- "traefik.http.routers.airsonic.rule=Host(`subdomain.domain.com`)"
devices:
- /dev/snd:/dev/snd #optional
depends_on:
- traefik
restart: unless-stopped
##########################################################################
# Secrets
##########################################################################
secrets:
glances_password:
file: ./secrets/glances_password
##########################################################################
# Volumes
##########################################################################
volumes:
influxdb_data: {}
grafana_data: {}
##########################################################################
# Networks
#
# Create networks by using following command:
# $ docker network create web
##########################################################################
networks:
default:
web:
external: true

View File

@@ -292,7 +292,7 @@
"369": "sensor.suresh_battery_level", "369": "sensor.suresh_battery_level",
"37": "sensor.queries_forwarded", "37": "sensor.queries_forwarded",
"370": "group.light_levels", "370": "group.light_levels",
"371": "input_boolean.battery_notifications", "371": "input_boolean.battery_alerts",
"372": "calendar.holidays_in_india", "372": "calendar.holidays_in_india",
"373": "sensor.kalavalanas_network_up_eth0", "373": "sensor.kalavalanas_network_up_eth0",
"374": "sensor.ups_nominal_input_voltage", "374": "sensor.ups_nominal_input_voltage",
@@ -405,7 +405,7 @@
"472": "sensor.dark_sky_precip", "472": "sensor.dark_sky_precip",
"473": "group.upstairs_multi_sensor", "473": "group.upstairs_multi_sensor",
"474": "group.always_on", "474": "group.always_on",
"475": "input_boolean.trash_reminders", "475": "input_boolean.trash_alerts",
"476": "sensor.pws_uv", "476": "sensor.pws_uv",
"477": "sensor.garage_pi_available_disk", "477": "sensor.garage_pi_available_disk",
"478": "binary_sensor.patio_camera_tamper_detection", "478": "binary_sensor.patio_camera_tamper_detection",

View File

@@ -63,15 +63,15 @@ automation:
value_template: "{{ trigger.event.data.new_state.attributes.battery_level | default(999) | int != 999 }}" value_template: "{{ trigger.event.data.new_state.attributes.battery_level | default(999) | int != 999 }}"
action: action:
- service: input_label.set_value - service: input_label.set_value
data_template: data:
entity_id: "input_label.{{- trigger.event.data.entity_id.split('.')[1] -}}" entity_id: "input_label.{{- trigger.event.data.entity_id.split('.')[1] -}}"
value: "{{ trigger.event.data.new_state.attributes.battery_level }}" value: "{{ trigger.event.data.new_state.attributes.battery_level }}"
- service: input_label.set_name - service: input_label.set_name
data_template: data:
entity_id: "input_label.{{- trigger.event.data.entity_id.split('.')[1] -}}" entity_id: "input_label.{{- trigger.event.data.entity_id.split('.')[1] -}}"
value: "{{ trigger.event.data.new_state.attributes.friendly_name }}'s Battery" value: "{{ trigger.event.data.new_state.attributes.friendly_name }}'s Battery"
- service: input_label.set_icon - service: input_label.set_icon
data_template: data:
entity_id: "input_label.{{- trigger.event.data.entity_id.split('.')[1] -}}" entity_id: "input_label.{{- trigger.event.data.entity_id.split('.')[1] -}}"
value: > value: >
{% set battery_level = trigger.event.data.new_state.attributes.battery_level | int %} {% set battery_level = trigger.event.data.new_state.attributes.battery_level | int %}
@@ -91,28 +91,28 @@ automation:
topic: "owntracks/+/+" topic: "owntracks/+/+"
action: action:
- service: input_label.set_value - service: input_label.set_value
data_template: data:
entity_id: "input_label.{{trigger.topic.split('/')[-1]}}_wifi" entity_id: "input_label.{{trigger.topic.split('/')[-1]}}_wifi"
value: "{{ 'Yes' if trigger.payload_json.conn == 'w' else 'No' }}" value: "{{ 'Yes' if trigger.payload_json.conn == 'w' else 'No' }}"
- service: input_label.set_icon - service: input_label.set_icon
data_template: data:
entity_id: "input_label.{{trigger.topic.split('/')[-1]}}_wifi" entity_id: "input_label.{{trigger.topic.split('/')[-1]}}_wifi"
value: "{{ 'mdi:wifi' if trigger.payload_json.conn == 'w' else 'mdi:wifi-off' }}" value: "{{ 'mdi:wifi' if trigger.payload_json.conn == 'w' else 'mdi:wifi-off' }}"
- service: input_label.set_name - service: input_label.set_name
data_template: data:
entity_id: "input_label.{{trigger.topic.split('/')[-1]}}_wifi" entity_id: "input_label.{{trigger.topic.split('/')[-1]}}_wifi"
value: "{{trigger.topic.split('/')[-1] | title }}'s phone wifi enabled?" value: "{{trigger.topic.split('/')[-1] | title }}'s phone wifi enabled?"
- service: input_label.set_value - service: input_label.set_value
data_template: data:
entity_id: "input_label.{{trigger.topic.split('/')[-1]}}_battery" entity_id: "input_label.{{trigger.topic.split('/')[-1]}}_battery"
value: '{{ trigger.payload_json.batt | int }}' value: '{{ trigger.payload_json.batt | int }}'
- service: input_label.set_name - service: input_label.set_name
data_template: data:
entity_id: "input_label.{{trigger.topic.split('/')[-1]}}_battery" entity_id: "input_label.{{trigger.topic.split('/')[-1]}}_battery"
value: "{{trigger.topic.split('/')[-1] | title }}'s Battery" value: "{{trigger.topic.split('/')[-1] | title }}'s Battery"
- service: input_label.set_icon - service: input_label.set_icon
data_template: data:
entity_id: "input_label.{{trigger.topic.split('/')[-1]}}_battery" entity_id: "input_label.{{trigger.topic.split('/')[-1]}}_battery"
value: > value: >
{% set battery_level = trigger.payload_json.batt | int %} {% set battery_level = trigger.payload_json.batt | int %}

View File

@@ -34,7 +34,7 @@ automation:
{%- endfor %} {%- endfor %}
action: action:
service: group.set_visibility service: group.set_visibility
data_template: data:
entity_id: '{{- '{{' }} "group_" ~ trigger.entity_id.split(".")[1] {{ '}}' }}' entity_id: '{{- '{{' }} "group_" ~ trigger.entity_id.split(".")[1] {{ '}}' }}'
visible: '{{- '{{' }} trigger.to_state.state | lower == "on" {{ '}}' }}' visible: '{{- '{{' }} trigger.to_state.state | lower == "on" {{ '}}' }}'
``` ```

View File

@@ -360,7 +360,7 @@ Hope you find it useful!
entity_id: light.dinette entity_id: light.dinette
action: action:
- service: mqtt.publish - service: mqtt.publish
data_template: data:
topic: '/dump/{{ trigger.platform }}' topic: '/dump/{{ trigger.platform }}'
retain: false retain: false
payload: >- payload: >-

View File

@@ -156,10 +156,10 @@ cards:
show_state: true show_state: true
title: Fitness title: Fitness
entities: entities:
- entity: sensor.yo_mama_steps - entity: sensor.suresh_steps
icon: "mdi:run" icon: "mdi:run"
name: Suresh Steps name: Suresh Steps
- entity: sensor.yo_mama_floors_ascended - entity: sensor.suresh_floors_ascended
icon: "mdi:run" icon: "mdi:run"
name: Suresh Floors Ascended name: Suresh Floors Ascended
- entity: sensor.mallika_steps - entity: sensor.mallika_steps
@@ -229,7 +229,6 @@ cards:
- type: tile - type: tile
entity: weather.dark_sky entity: weather.dark_sky
- type: entities - type: entities
title: Xiaomi Motion Sensors title: Xiaomi Motion Sensors
show_header_toggle: false show_header_toggle: false
@@ -358,26 +357,3 @@ cards:
type: entities type: entities
title: Motion Sensors title: Motion Sensors
show_header_toggle: false show_header_toggle: false
- type: entities
title: Motion Counters
show_header_toggle: false
entities:
- input_label.motion_sensor_158d00016c2d0e
- input_label.motion_sensor_158d00016db6d2
- input_label.motion_sensor_158d0001a25041
- input_label.motion_sensor_158d0001a662fe
- input_label.motion_sensor_158d00024e57d3
- input_label.motion_sensor_158d00024e57fb
- input_label.motion_sensor_158d00024e842c
- input_label.motion_sensor_158d00024ee084
- input_label.motion_sensor_158d000272bed1
- input_label.motion_sensor_158d00047b6f69
- input_label.motion_sensor_158d000272bf48
- input_label.motion_sensor_158d000272bfd7
- input_label.garage_motion
- input_label.door_window_sensor_158d0004231f7b
- input_label.door_window_sensor_158d0004248d5b
- input_label.door_window_sensor_158d00040ad8fc
- input_label.door_window_sensor_158d0004880f30 # garage entry door
- input_label.door_window_sensor_158d000424a6d6

View File

@@ -1,7 +1,6 @@
title: Multi Room Audio & TTS title: Multi Room Audio & TTS
icon: mdi:television icon: mdi:television
cards: cards:
- type: entities - type: entities
title: Text To Speech title: Text To Speech
show_header_toggle: false show_header_toggle: false
@@ -14,13 +13,13 @@ cards:
- input_text.tts - input_text.tts
- type: entities - type: entities
title: Media Players title: SONOS Speakers
show_header_toggle: false show_header_toggle: false
entities: entities:
- media_player.attic_tv - entity: media_player.living_room # sonos
- media_player.living_room # sonos name: SONOS Speaker 1
- media_player.upstairs # sonos - entity: media_player.upstairs # sonos
- media_player.smart_tv name: SONOS Speaker 2
- type: vertical-stack - type: vertical-stack
cards: cards:
@@ -28,8 +27,6 @@ cards:
entity: media_player.living_room entity: media_player.living_room
- type: media-control - type: media-control
entity: media_player.upstairs entity: media_player.upstairs
- type: media-control
entity: media_player.attic_tv
- type: media-control - type: media-control
entity: media_player.chromecastultra7021 entity: media_player.chromecastultra7021
name: ChromeCast Ultra

View File

@@ -251,18 +251,26 @@ cards:
- input_number.hasika_bedroom_closet_lights - input_number.hasika_bedroom_closet_lights
- type: entities - type: entities
title: Alerts & Notifications title: Notifications
show_header_toggle: false
entities:
- input_boolean.telegram_notifications
- input_boolean.led_notifications
- input_boolean.voice_notifications
- input_boolean.email_notifications
- input_boolean.firetv_notifications
- type: entities
title: Alerts
show_header_toggle: false show_header_toggle: false
entities: entities:
- input_boolean.garage_door_notifications - input_boolean.garage_door_notifications
- input_boolean.battery_notifications - input_boolean.battery_alerts
- input_boolean.text_alerts - input_boolean.zone_alerts
- input_boolean.led_alerts
- input_boolean.security_system_alerts - input_boolean.security_system_alerts
- input_boolean.notify_camera_alerts - input_boolean.camera_alerts
- input_boolean.trash_reminders - input_boolean.zone_alerts
- automation.family_room_motion_timer - input_boolean.trash_alerts
- automation.family_room_timer_elapsed
- type: entities - type: entities
title: Bed & Wakeup Times title: Bed & Wakeup Times

View File

@@ -62,45 +62,3 @@ cards:
name: Pill Taken name: Pill Taken
- entity: script.remind_pill - entity: script.remind_pill
name: Remind Me To Take Pill name: Remind Me To Take Pill
# - type: entities
# title: All Scripts
# show_header_toggle: false
# entities:
# - script.all_indoor_lights_off
# - script.driveway_cam
# - script.driveway_camera_text_overlay
# - script.frontdoor_cam
# - script.frontdoor_camera_text_overlay
# - script.good_night_tts
# - script.home_mode_away
# - script.home_status
# - script.led_message
# - script.notify_me
# - script.notify_me_with_picture
# - script.patio_cam
# - script.patio_camera_text_overlay
# - script.pill_taken
# - script.play_dog_sounds
# - script.play_fav_song
# - script.play_ringtone
# - script.playarea_cam
# - script.playarea_camera_text_overlay
# - script.query_disk_info
# - script.query_wifi_info
# - script.remind_pill
# - script.restart_all_raspberrypis
# - script.restart_all_snapclients
# - script.restart_hass
# - script.shutdown_all_raspberrypis
# - script.stop_hass
# - script.stream2chromecast
# - script.stream_driveway_camera_to_chromecast
# - script.stream_frontdoor_camera_to_chromecast
# - script.stream_patio_camera_to_chromecast
# - script.stream_playarea_camera_to_chromecast
# - script.toggle_climate
# - script.toggle_do_not_disturb
# - script.update_hass
# - script.voice_greeting
# - script.voice_notify

View File

@@ -27,7 +27,6 @@ cards:
title: Zone Based Alerts title: Zone Based Alerts
show_header_toggle: false show_header_toggle: false
entities: entities:
- automation.alert_when_everyone_is_away
- automation.alert_when_someone_enters_a_zone - automation.alert_when_someone_enters_a_zone
- automation.alert_when_someone_leaves_a_zone - automation.alert_when_someone_leaves_a_zone
- automation.send_a_message_as_i_get_closer_to_home - automation.send_a_message_as_i_get_closer_to_home
@@ -84,7 +83,6 @@ cards:
- automation.home_security_system_watchdog_10_minutes - automation.home_security_system_watchdog_10_minutes
- automation.home_security_system_watchdog_30_minutes - automation.home_security_system_watchdog_30_minutes
- automation.notify_home_security_status_change - automation.notify_home_security_status_change
- automation.turn_on_thermostat_upon_reaching_home
- type: conditional - type: conditional
conditions: conditions:
@@ -112,7 +110,7 @@ cards:
title: Trash & Recycle Automations title: Trash & Recycle Automations
show_header_toggle: false show_header_toggle: false
entities: entities:
- automation.reset_trash_reminders - automation.reset_trash_alerts
- automation.restore_trash_recycle_settings_on_startup - automation.restore_trash_recycle_settings_on_startup
- automation.trash_and_recycle_pickup_reminder - automation.trash_and_recycle_pickup_reminder
- automation.trash_pickup_day_changed - automation.trash_pickup_day_changed
@@ -183,11 +181,3 @@ cards:
show_header_toggle: false show_header_toggle: false
entities: entities:
- automation.season_change_notification - automation.season_change_notification
- automation.turn_off_ac_after_3_hours_of_cooling
- type: entities
title: Misc Automations
show_header_toggle: false
entities:
- automation.count_motions
- automation.reset_motion_counters_at_midnight

View File

@@ -157,7 +157,7 @@
# from: "Printing" # from: "Printing"
# action: # action:
# - service: script.notify_me # - service: script.notify_me
# data_template: # data:
# message: "3D Printer Status Changed from 'Printing' to '{{ trigger.to_state.state }}'." # message: "3D Printer Status Changed from 'Printing' to '{{ trigger.to_state.state }}'."
# # # #
@@ -169,7 +169,7 @@
# entity_id: "binary_sensor.octoprint_printing" # entity_id: "binary_sensor.octoprint_printing"
# action: # action:
# - service: script.notify_me # - service: script.notify_me
# data_template: # data:
# message: "3D Printer Status changed from '{{ trigger.from_state.state }}' to '{{ trigger.to_state.state }}'." # message: "3D Printer Status changed from '{{ trigger.from_state.state }}' to '{{ trigger.to_state.state }}'."
# # # #
@@ -182,7 +182,7 @@
# to: "on" # to: "on"
# action: # action:
# - service: script.notify_me # - service: script.notify_me
# data_template: # data:
# message: "3D Printer Status changed to 'ERROR'. Please check the printer!" # message: "3D Printer Status changed to 'ERROR'. Please check the printer!"
# # # #
@@ -213,7 +213,7 @@
# from: "off" # from: "off"
# action: # action:
# - service: script.notify_me # - service: script.notify_me
# data_template: # data:
# message: >- # message: >-
# 3D Printer job is now {{ trigger.to_state.attributes.friendly_name }} complete. # 3D Printer job is now {{ trigger.to_state.attributes.friendly_name }} complete.
@@ -235,7 +235,7 @@
# - service: switch.turn_off # - service: switch.turn_off
# entity_id: switch.3d_printer # entity_id: switch.3d_printer
# - service: script.notify_me # - service: script.notify_me
# data_template: # data:
# message: "3D Printer is now switched off!" # message: "3D Printer is now switched off!"
# - service_template: input_boolean.turn_off # - service_template: input_boolean.turn_off
# entity_id: input_boolean.twenty_five_percent # entity_id: input_boolean.twenty_five_percent
@@ -265,7 +265,7 @@
# entity_id: camera.3d_printer_camera # entity_id: camera.3d_printer_camera
# filename: "/config/www/downloads/camera/3dprinter/print_latest.jpg" # filename: "/config/www/downloads/camera/3dprinter/print_latest.jpg"
# - service: notify.telegram # - service: notify.telegram
# data_template: # data:
# title: "3D Printer" # title: "3D Printer"
# message: "Print Progress" # message: "Print Progress"
# data: # data:

View File

@@ -1,473 +1,73 @@
# ############################################################################### ###############################################################################
# # @author : Mahasri Kalavala # @author : Mahasri Kalavala
# # @date : 04/15/2017 # @date : 04/15/2017
# # @package : Batteries # @package : Batteries
# # @description : Status about various baterries (iphones, sensors...etc) # @description : Status about various baterries (iphones, sensors...etc)
# ############################################################################### ###############################################################################
# homeassistant: 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_ot: automation:
# hidden: true ###############################################################################
# sensor.mallika_iphone_battery_ot: # Automation: Notify of iPhone Low Battery
# hidden: true ###############################################################################
# sensor.srinika_iphone_battery_ot: - alias: Notify Low battery
# hidden: true initial_state: true
# sensor.hasika_iphone_battery_ot: trigger:
# hidden: true 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_level }}"
below: 25
condition:
- condition: template
value_template: "{{ states('input_boolean.battery_alerts') == 'on' }}"
action:
- service: script.notify_family
data:
message: "{{ trigger.to_state.attributes.friendly_name | title }}'s phone battery is : {{ trigger.to_state.attributes.battery_level }}%."
notify_options:
- telegram
- led
- voice
- tv
# sensor.hasika_iphone_wifi_state: - alias: Alert Low Battery of Sensors
# friendly_name: Hasika Phone Wi-Fi Status trigger:
# sensor.mallika_iphone_wifi_state: platform: time
# friendly_name: Mallika Phone Wi-Fi Status at: "10:10:10"
# sensor.srinika_iphone_wifi_state: condition:
# friendly_name: Srinika Phone Wi-Fi Status - condition: template
# sensor.suresh_iphone_wifi_state: value_template: >
# friendly_name: Suresh Phone Wi-Fi Status {% set ns = namespace(lowBattery=false) %}
{%- for x in states if "battery_level" in x["attributes"] and x.attributes.battery_level |int <= 25 %}
# sensor: {% set ns.lowBattery = true %}{% endfor %}
# - platform: mqtt {{ ns.lowBattery }}
# state_topic: "owntracks/mallika/mallika" - condition: template
# name: "Mallika iPhone Battery (OT)" value_template: "{{ states('input_boolean.battery_alerts') == 'on' }}"
# unit_of_measurement: "%" action:
# value_template: "{{ value_json.batt }}" - service: script.notify_family
data:
# - platform: mqtt message: >
# state_topic: "owntracks/suresh/suresh" Sensors with low batteries (<25):
# name: "Suresh iPhone Battery (OT)" {% set ns = namespace(lowBattery="") -%}
# unit_of_measurement: "%" {%- for x in states if "battery_level" in x["attributes"] and x.attributes["battery_level"] |int <= 25 -%}
# value_template: "{{ value_json.batt }}" {%- set ns.lowBattery = ns.lowBattery + x.name + "- " + x.attributes["battery_level"]|round|string + "\n" -%}
{%- endfor -%}
# - platform: mqtt {{- ns.lowBattery -}}
# state_topic: "owntracks/srinika/srinika" notify_options:
# name: "Srinika iPhone Battery (OT)" - telegram
# unit_of_measurement: "%" - tv
# value_template: "{{ value_json.batt }}" - led
# - 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/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/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/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/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/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/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:
# 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:
# 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: 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 }}%."
# # - 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!

View File

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

View File

@@ -270,14 +270,14 @@ automation:
to: "on" to: "on"
action: action:
- service: camera.snapshot - service: camera.snapshot
data_template: data:
entity_id: "camera.porch_camera" entity_id: "camera.porch_camera"
filename: filename:
"{{ '/config/www/downloads/camera/porch/porch_' ~ "{{ '/config/www/downloads/camera/porch/porch_' ~
(states.binary_sensor.porch_motion.last_updated ~ '').replace('-','_') (states.binary_sensor.porch_motion.last_updated ~ '').replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}" .replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- service: image_processing.scan - service: image_processing.scan
data_template: data:
entity_id: image_processing.doods_porch_camera entity_id: image_processing.doods_porch_camera
# #
@@ -293,15 +293,15 @@ automation:
to: "on" to: "on"
action: action:
- condition: template - condition: template
value_template: "{{ states('input_boolean.notify_camera_alerts') == 'on' }}" value_template: "{{ states('input_boolean.camera_alerts') == 'on' }}"
- service: script.frontdoor_cam # change to front door camera stream on chromecast - service: script.frontdoor_cam # change to front door camera stream on chromecast
- condition: template - condition: template
value_template: "{{ states('alarm_control_panel.home') == 'armed_home' or states('alarm_control_panel.home') == 'armed_away' }}" value_template: "{{ states('alarm_control_panel.home') == 'armed_home' or states('alarm_control_panel.home') == 'armed_away' }}"
- service: image_processing.scan - service: image_processing.scan
data_template: data:
entity_id: image_processing.doods_frontdoor_camera entity_id: image_processing.doods_frontdoor_camera
- service: image_processing.scan - service: image_processing.scan
data_template: data:
entity_id: image_processing.doods_driveway_camera entity_id: image_processing.doods_driveway_camera
- condition: template - condition: template
value_template: >- value_template: >-
@@ -316,7 +316,7 @@ automation:
{% endif %} {% endif %}
- service: script.voice_notify - service: script.voice_notify
data_template: data:
message: >- message: >-
{%- set e_id = "image_processing.doods_frontdoor_camera" -%} {%- set e_id = "image_processing.doods_frontdoor_camera" -%}
{%- if state_attr(e_id, 'summary') -%} {%- if state_attr(e_id, 'summary') -%}
@@ -330,7 +330,7 @@ automation:
greeting: "no" greeting: "no"
- service: notify.notify_smtp - service: notify.notify_smtp
data_template: data:
title: 'Front door motion {{ now().strftime("%d %h %Y, %I:%M:%S %p") }}' title: 'Front door motion {{ now().strftime("%d %h %Y, %I:%M:%S %p") }}'
message: > message: >
{%- set e_id = "image_processing.doods_frontdoor_camera" -%} {%- set e_id = "image_processing.doods_frontdoor_camera" -%}
@@ -348,8 +348,8 @@ automation:
images: images:
- "/config/www/downloads/camera/frontdoor/frontdoor_latest.jpg" - "/config/www/downloads/camera/frontdoor/frontdoor_latest.jpg"
- service: script.notify_me_with_picture - service: script.notify_family
data_template: data:
title: "Front Door Motion" title: "Front Door Motion"
message: > message: >
{%- set e_id = "image_processing.doods_frontdoor_camera" -%} {%- set e_id = "image_processing.doods_frontdoor_camera" -%}
@@ -363,8 +363,10 @@ automation:
{% else %} {% else %}
Motion detected at the front door on {{ now().strftime("%d %h %Y, at %I:%M:%S %p") }}. Please see the images below. Motion detected at the front door on {{ now().strftime("%d %h %Y, at %I:%M:%S %p") }}. Please see the images below.
{%- endif %} {%- endif %}
file: "/config/www/downloads/camera/frontdoor/frontdoor_latest.jpg" url: "/config/www/downloads/camera/frontdoor/frontdoor_latest.jpg"
caption: "Front Door Motion" notify_options:
- telegram
- tv
- condition: template - condition: template
value_template: > value_template: >
@@ -375,7 +377,7 @@ automation:
False False
{% endif %} {% endif %}
- service: image_processing.scan - service: image_processing.scan
data_template: data:
entity_id: image_processing.doods_garage entity_id: image_processing.doods_garage
# #
# Scan driveway and frontdoor cameras when motion detected # Scan driveway and frontdoor cameras when motion detected
@@ -390,18 +392,18 @@ automation:
to: "on" to: "on"
action: action:
- condition: template - condition: template
value_template: "{{ states('input_boolean.notify_camera_alerts') == 'on' }}" value_template: "{{ states('input_boolean.camera_alerts') == 'on' }}"
- service: script.stream2chromecast - service: script.stream2chromecast
data_template: data:
url: !secret driveway_camera_stream_url url: !secret driveway_camera_stream_url
name: "driveway" name: "driveway"
- condition: template - condition: template
value_template: "{{ states('alarm_control_panel.home') == 'armed_home' or states('alarm_control_panel.home') == 'armed_away' }}" value_template: "{{ states('alarm_control_panel.home') == 'armed_home' or states('alarm_control_panel.home') == 'armed_away' }}"
- service: image_processing.scan - service: image_processing.scan
data_template: data:
entity_id: image_processing.doods_driveway_camera entity_id: image_processing.doods_driveway_camera
- service: image_processing.scan - service: image_processing.scan
data_template: data:
entity_id: image_processing.doods_frontdoor_camera entity_id: image_processing.doods_frontdoor_camera
- condition: template - condition: template
value_template: >- value_template: >-
@@ -416,7 +418,7 @@ automation:
{% endif %} {% endif %}
- service: script.voice_notify - service: script.voice_notify
data_template: data:
message: >- message: >-
{%- set e_id = "image_processing.doods_driveway_camera" -%} {%- set e_id = "image_processing.doods_driveway_camera" -%}
{%- if state_attr(e_id, 'summary') -%} {%- if state_attr(e_id, 'summary') -%}
@@ -428,8 +430,8 @@ automation:
{{ " detected in the driveway" }} {{ " detected in the driveway" }}
{%- endif -%} {%- endif -%}
- service: script.notify_me_with_picture - service: script.notify_family
data_template: data:
title: "Driveway Motion" title: "Driveway Motion"
message: > message: >
{%- set e_id = "image_processing.doods_driveway_camera" -%} {%- set e_id = "image_processing.doods_driveway_camera" -%}
@@ -443,11 +445,13 @@ automation:
{% else %} {% else %}
Motion detected at the driveway on {{ now().strftime("%d %h %Y, at %I:%M:%S %p") }}. Please see the images below. Motion detected at the driveway on {{ now().strftime("%d %h %Y, at %I:%M:%S %p") }}. Please see the images below.
{%- endif -%} {%- endif -%}
file: "/config/www/downloads/camera/driveway/driveway_latest.jpg" url: "/config/www/downloads/camera/driveway/driveway_latest.jpg"
caption: "Driveway Motion" notify_options:
- telegram
- tv
- service: notify.notify_smtp - service: notify.notify_smtp
data_template: data:
title: 'Driveway motion {{ now().strftime("%d %h %Y, %I:%M:%S %p") }}' title: 'Driveway motion {{ now().strftime("%d %h %Y, %I:%M:%S %p") }}'
message: > message: >
{%- set e_id = "image_processing.doods_driveway_camera" -%} {%- set e_id = "image_processing.doods_driveway_camera" -%}
@@ -475,7 +479,7 @@ automation:
{% endif %} {% endif %}
- service: image_processing.scan - service: image_processing.scan
data_template: data:
entity_id: image_processing.doods_garage entity_id: image_processing.doods_garage
# #
@@ -491,12 +495,12 @@ automation:
to: "on" to: "on"
condition: condition:
- condition: template - condition: template
value_template: "{{ states('input_boolean.notify_camera_alerts') == 'on' }}" value_template: "{{ states('input_boolean.camera_alerts') == 'on' }}"
- condition: template - condition: template
value_template: "{{ states('alarm_control_panel.home') == 'armed_home' or states('alarm_control_panel.home') == 'armed_away' }}" value_template: "{{ states('alarm_control_panel.home') == 'armed_home' or states('alarm_control_panel.home') == 'armed_away' }}"
action: action:
- service: image_processing.scan - service: image_processing.scan
data_template: data:
entity_id: image_processing.doods_garage entity_id: image_processing.doods_garage
- condition: template - condition: template
value_template: > value_template: >
@@ -507,10 +511,10 @@ automation:
False False
{% endif %} {% endif %}
- service: image_processing.scan - service: image_processing.scan
data_template: data:
entity_id: image_processing.doods_driveway_camera entity_id: image_processing.doods_driveway_camera
- service: image_processing.scan - service: image_processing.scan
data_template: data:
entity_id: image_processing.doods_frontdoor_camera entity_id: image_processing.doods_frontdoor_camera
- condition: template - condition: template
value_template: >- value_template: >-
@@ -525,7 +529,7 @@ automation:
{% endif %} {% endif %}
- service: script.voice_notify - service: script.voice_notify
data_template: data:
message: >- message: >-
{%- set e_id = "image_processing.doods_garage" -%} {%- set e_id = "image_processing.doods_garage" -%}
{%- if state_attr(e_id, 'summary') -%} {%- if state_attr(e_id, 'summary') -%}
@@ -537,8 +541,8 @@ automation:
{{ " detected in the garage." }} {{ " detected in the garage." }}
{%- endif -%} {%- endif -%}
- service: script.notify_me_with_picture - service: script.notify_family
data_template: data:
title: "Garage Motion" title: "Garage Motion"
message: > message: >
{%- set e_id = "image_processing.doods_garage" -%} {%- set e_id = "image_processing.doods_garage" -%}
@@ -552,11 +556,13 @@ automation:
{% else %} {% else %}
Motion detected in the garage on {{ now().strftime("%d %h %Y, at %I:%M:%S %p") }}. Please see the images below. Motion detected in the garage on {{ now().strftime("%d %h %Y, at %I:%M:%S %p") }}. Please see the images below.
{%- endif -%} {%- endif -%}
file: "/config/www/downloads/camera/garage/garage_latest.jpg" url: "/config/www/downloads/camera/garage/garage_latest.jpg"
caption: "Garage Motion" notify_options:
- telegram
- tv
- service: notify.notify_smtp - service: notify.notify_smtp
data_template: data:
title: 'Garage motion {{ now().strftime("%d %h %Y, %I:%M:%S %p") }}' title: 'Garage motion {{ now().strftime("%d %h %Y, %I:%M:%S %p") }}'
message: > message: >
{%- set e_id = "image_processing.doods_garage" -%} {%- set e_id = "image_processing.doods_garage" -%}
@@ -585,18 +591,18 @@ automation:
to: "on" to: "on"
action: action:
- condition: template - condition: template
value_template: "{{ states('input_boolean.notify_camera_alerts') == 'on' }}" value_template: "{{ states('input_boolean.camera_alerts') == 'on' }}"
- service: script.stream2chromecast - service: script.stream2chromecast
data_template: data:
url: !secret playarea_camera_stream_url url: !secret playarea_camera_stream_url
name: "backyard" name: "backyard"
- condition: template - condition: template
value_template: "{{ states('alarm_control_panel.home') == 'armed_home' or states('alarm_control_panel.home') == 'armed_away' }}" value_template: "{{ states('alarm_control_panel.home') == 'armed_home' or states('alarm_control_panel.home') == 'armed_away' }}"
- service: image_processing.scan - service: image_processing.scan
data_template: data:
entity_id: image_processing.doods_patio_camera entity_id: image_processing.doods_patio_camera
- service: image_processing.scan - service: image_processing.scan
data_template: data:
entity_id: image_processing.doods_playarea_camera entity_id: image_processing.doods_playarea_camera
- condition: template - condition: template
value_template: >- value_template: >-
@@ -611,7 +617,7 @@ automation:
{% endif %} {% endif %}
- service: script.voice_notify - service: script.voice_notify
data_template: data:
message: >- message: >-
{%- set e_id = "image_processing.doods_patio_camera" -%} {%- set e_id = "image_processing.doods_patio_camera" -%}
{%- if state_attr(e_id, 'summary') -%} {%- if state_attr(e_id, 'summary') -%}
@@ -623,9 +629,9 @@ automation:
{{ " detected in the backyard." }} {{ " detected in the backyard." }}
{%- endif -%} {%- endif -%}
- service: script.notify_me_with_picture - service: script.notify_family
data_template: data:
title: "Backyardge Motion" title: "Backyard Motion"
message: > message: >
{%- set e_id = "image_processing.doods_patio_camera" -%} {%- set e_id = "image_processing.doods_patio_camera" -%}
{%- if state_attr(e_id, 'summary') -%} {%- if state_attr(e_id, 'summary') -%}
@@ -638,11 +644,13 @@ automation:
{% else %} {% else %}
Motion detected in the backyard on {{ now().strftime("%d %h %Y, at %I:%M:%S %p") }}. Please see the images below. Motion detected in the backyard on {{ now().strftime("%d %h %Y, at %I:%M:%S %p") }}. Please see the images below.
{%- endif -%} {%- endif -%}
file: "/config/www/downloads/camera/patio/patio_latest.jpg" url: "/config/www/downloads/camera/patio/patio_latest.jpg"
caption: "Backyard Motion" notify_options:
- telegram
- tv
- service: notify.notify_smtp - service: notify.notify_smtp
data_template: data:
title: 'Backyard motion {{ now().strftime("%d %h %Y, %I:%M:%S %p") }}' title: 'Backyard motion {{ now().strftime("%d %h %Y, %I:%M:%S %p") }}'
message: > message: >
{%- set e_id = "image_processing.doods_patio_camera" -%} {%- set e_id = "image_processing.doods_patio_camera" -%}
@@ -703,34 +711,34 @@ automation:
to: "on" to: "on"
condition: condition:
- condition: template - condition: template
value_template: "{{ states('input_boolean.notify_camera_alerts') == 'on' }}" value_template: "{{ states('input_boolean.camera_alerts') == 'on' }}"
- condition: template - condition: template
value_template: "{{ states('alarm_control_panel.home') == 'armed_home' or states('alarm_control_panel.home') == 'armed_away' }}" value_template: "{{ states('alarm_control_panel.home') == 'armed_home' or states('alarm_control_panel.home') == 'armed_away' }}"
action: action:
- delay: "{{ '00:00:08' if states('binary_sensor.door_window_sensor_158d000424a6d6') == 'on' else '0:0:0' }}" - delay: "{{ '00:00:08' if states('binary_sensor.door_window_sensor_158d000424a6d6') == 'on' else '0:0:0' }}"
- service: camera.snapshot - service: camera.snapshot
data_template: data:
entity_id: "camera.frontdoor_camera" entity_id: "camera.frontdoor_camera"
filename: filename:
"{{ '/config/www/downloads/camera/frontdoor/frontdoor_' ~ "{{ '/config/www/downloads/camera/frontdoor/frontdoor_' ~
(states.binary_sensor.motion_sensor_158d00024ee084.last_updated ~ '').replace('-','_') (states.binary_sensor.motion_sensor_158d00024ee084.last_updated ~ '').replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}" .replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- service: camera.snapshot - service: camera.snapshot
data_template: data:
entity_id: "camera.porch_camera" entity_id: "camera.porch_camera"
filename: filename:
"{{ '/config/www/downloads/camera/porch/porch_' ~ "{{ '/config/www/downloads/camera/porch/porch_' ~
(states.binary_sensor.motion_sensor_158d00024ee084.last_updated ~ '').replace('-','_') (states.binary_sensor.motion_sensor_158d00024ee084.last_updated ~ '').replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}" .replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- service: camera.snapshot - service: camera.snapshot
data_template: data:
entity_id: "camera.driveway_camera" entity_id: "camera.driveway_camera"
filename: filename:
"{{ '/config/www/downloads/camera/driveway/driveway_' ~ "{{ '/config/www/downloads/camera/driveway/driveway_' ~
(states.binary_sensor.motion_sensor_158d00024ee084.last_updated ~ '').replace('-','_') (states.binary_sensor.motion_sensor_158d00024ee084.last_updated ~ '').replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}" .replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- service: camera.snapshot - service: camera.snapshot
data_template: data:
entity_id: "camera.garage" entity_id: "camera.garage"
filename: filename:
"{{ '/config/www/downloads/camera/garage/garage_' ~ "{{ '/config/www/downloads/camera/garage/garage_' ~
@@ -738,7 +746,7 @@ automation:
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}" .replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- service: notify.telegram - service: notify.telegram
data_template: data:
title: "Front Door Motion" title: "Front Door Motion"
message: "Motion Detected At Front Door, Check images:" message: "Motion Detected At Front Door, Check images:"
data: data:
@@ -761,7 +769,7 @@ automation:
caption: Porch caption: Porch
- service: notify.notify_smtp - service: notify.notify_smtp
data_template: data:
title: 'Front door motion {{ now().strftime("%d %h %Y, %I:%M:%S %p") }}' title: 'Front door motion {{ now().strftime("%d %h %Y, %I:%M:%S %p") }}'
message: 'Motion detected at the front door on {{ now().strftime("%d %h %Y, at %I:%M:%S %p") -}}. Please see the images below.' message: 'Motion detected at the front door on {{ now().strftime("%d %h %Y, at %I:%M:%S %p") -}}. Please see the images below.'
data: data:
@@ -783,7 +791,7 @@ automation:
value_template: "{{ states('device_tracker.life360_suresh') == 'home' }}" value_template: "{{ states('device_tracker.life360_suresh') == 'home' }}"
- service: notify.ios_devices - service: notify.ios_devices
data_template: data:
message: "Check Front Door camera!" message: "Check Front Door camera!"
data: data:
push: push:
@@ -810,26 +818,26 @@ automation:
to: "on" to: "on"
condition: condition:
- condition: template - condition: template
value_template: "{{ states('input_boolean.notify_camera_alerts') == 'on' }}" value_template: "{{ states('input_boolean.camera_alerts') == 'on' }}"
- condition: template - condition: template
value_template: "{{ states('alarm_control_panel.home') == 'armed_home' or states('alarm_control_panel.home') == 'armed_away' }}" value_template: "{{ states('alarm_control_panel.home') == 'armed_home' or states('alarm_control_panel.home') == 'armed_away' }}"
action: action:
- service: camera.snapshot - service: camera.snapshot
data_template: data:
entity_id: "camera.frontdoor_camera" entity_id: "camera.frontdoor_camera"
filename: filename:
"{{ '/config/www/downloads/camera/frontdoor/frontdoor_' ~ "{{ '/config/www/downloads/camera/frontdoor/frontdoor_' ~
(states.binary_sensor.motion_sensor_158d00024e57fb.last_updated ~ '').replace('-','_') (states.binary_sensor.motion_sensor_158d00024e57fb.last_updated ~ '').replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}" .replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- service: camera.snapshot - service: camera.snapshot
data_template: data:
entity_id: "camera.driveway_camera" entity_id: "camera.driveway_camera"
filename: filename:
"{{ '/config/www/downloads/camera/driveway/driveway_' ~ "{{ '/config/www/downloads/camera/driveway/driveway_' ~
(states.binary_sensor.motion_sensor_158d00024e57fb.last_updated ~ '').replace('-','_') (states.binary_sensor.motion_sensor_158d00024e57fb.last_updated ~ '').replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}" .replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- service: camera.snapshot - service: camera.snapshot
data_template: data:
entity_id: "camera.garage" entity_id: "camera.garage"
filename: filename:
"{{ '/config/www/downloads/camera/garage/garage_' ~ "{{ '/config/www/downloads/camera/garage/garage_' ~
@@ -837,7 +845,7 @@ automation:
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}" .replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- service: notify.telegram - service: notify.telegram
data_template: data:
title: "Driveway Motion" title: "Driveway Motion"
message: "Motion Detected At Driveway, Check images:" message: "Motion Detected At Driveway, Check images:"
data: data:
@@ -856,7 +864,7 @@ automation:
caption: "Garage" caption: "Garage"
- service: notify.notify_smtp - service: notify.notify_smtp
data_template: data:
title: 'Driveway motion {{ now().strftime("%d %h %Y, %I:%M:%S %p") }}' title: 'Driveway motion {{ now().strftime("%d %h %Y, %I:%M:%S %p") }}'
message: 'Motion detected at the Driveway on {{ now().strftime("%d %h %Y, at %I:%M:%S %p") }}. Please see the images below.' message: 'Motion detected at the Driveway on {{ now().strftime("%d %h %Y, at %I:%M:%S %p") }}. Please see the images below.'
data: data:
@@ -874,7 +882,7 @@ automation:
- condition: template - condition: template
value_template: "{{ states('device_tracker.life360_suresh') == 'home' }}" value_template: "{{ states('device_tracker.life360_suresh') == 'home' }}"
- service: notify.ios_devices - service: notify.ios_devices
data_template: data:
message: "Check Driveway camera!" message: "Check Driveway camera!"
data: data:
push: push:
@@ -901,7 +909,7 @@ automation:
to: "on" to: "on"
condition: condition:
- condition: template - condition: template
value_template: "{{ states('input_boolean.notify_camera_alerts') == 'on' }}" value_template: "{{ states('input_boolean.camera_alerts') == 'on' }}"
- condition: template - condition: template
value_template: "{{ states('alarm_control_panel.home') == 'armed_home' or states('alarm_control_panel.home') == 'armed_away' }}" value_template: "{{ states('alarm_control_panel.home') == 'armed_home' or states('alarm_control_panel.home') == 'armed_away' }}"
action: action:
@@ -918,7 +926,7 @@ automation:
{% endif %} {% endif %}
- service: camera.snapshot - service: camera.snapshot
data_template: data:
entity_id: "camera.patio_camera" entity_id: "camera.patio_camera"
filename: filename:
"{{ '/config/www/downloads/camera/patio/patio_' ~ "{{ '/config/www/downloads/camera/patio/patio_' ~
@@ -926,7 +934,7 @@ automation:
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}" .replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- service: camera.snapshot - service: camera.snapshot
data_template: data:
entity_id: "camera.playarea_camera" entity_id: "camera.playarea_camera"
filename: filename:
"{{ '/config/www/downloads/camera/playarea/playarea_' ~ "{{ '/config/www/downloads/camera/playarea/playarea_' ~
@@ -934,7 +942,7 @@ automation:
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}" .replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- service: notify.telegram - service: notify.telegram
data_template: data:
title: "Backyard Motion" title: "Backyard Motion"
message: "Motion Detected in the Backyard, Check images:" message: "Motion Detected in the Backyard, Check images:"
data: data:
@@ -949,7 +957,7 @@ automation:
caption: "Playarea" caption: "Playarea"
- service: notify.notify_smtp - service: notify.notify_smtp
data_template: data:
title: 'Backyard motion {{ now().strftime("%d %h %Y, %I:%M:%S %p") }}' title: 'Backyard motion {{ now().strftime("%d %h %Y, %I:%M:%S %p") }}'
message: 'Motion detected in the Backyard on {{ now().strftime("%d %h %Y, at %I:%M:%S %p") }}. Please see the images below.' message: 'Motion detected in the Backyard on {{ now().strftime("%d %h %Y, at %I:%M:%S %p") }}. Please see the images below.'
data: data:
@@ -964,7 +972,7 @@ automation:
- condition: template - condition: template
value_template: "{{ states('device_tracker.life360_suresh') == 'home' }}" value_template: "{{ states('device_tracker.life360_suresh') == 'home' }}"
- service: notify.ios_devices - service: notify.ios_devices
data_template: data:
message: "Check Patio camera!" message: "Check Patio camera!"
data: data:
push: push:
@@ -1004,28 +1012,28 @@ automation:
{% endif %} {% endif %}
action: action:
- service: script.frontdoor_camera_text_overlay - service: script.frontdoor_camera_text_overlay
data_template: data:
text: > text: >
{{ '* ' if states('alarm_control_panel.home') == 'armed_home' or {{ '* ' if states('alarm_control_panel.home') == 'armed_home' or
states('alarm_control_panel.home') == 'armed_away' -}} states('alarm_control_panel.home') == 'armed_away' -}}
{{- states('sensor.dark_sky_temperature')|int}} °F, Feels like {{- states('sensor.dark_sky_temperature')|int}} °F, Feels like
{{- ' ' ~ states('sensor.dark_sky_apparent_temperature') |int -}} {{- ' ' ~ states('sensor.dark_sky_apparent_temperature') |int -}}
- service: script.driveway_camera_text_overlay - service: script.driveway_camera_text_overlay
data_template: data:
text: > text: >
{{ '* ' if states('alarm_control_panel.home') == 'armed_home' or {{ '* ' if states('alarm_control_panel.home') == 'armed_home' or
states('alarm_control_panel.home') == 'armed_away' -}} states('alarm_control_panel.home') == 'armed_away' -}}
{{- states('sensor.dark_sky_temperature')|int}} °F, Feels like {{- states('sensor.dark_sky_temperature')|int}} °F, Feels like
{{- ' ' ~ states('sensor.dark_sky_apparent_temperature') |int -}} {{- ' ' ~ states('sensor.dark_sky_apparent_temperature') |int -}}
- service: script.playarea_camera_text_overlay - service: script.playarea_camera_text_overlay
data_template: data:
text: > text: >
{{ '* ' if states('alarm_control_panel.home') == 'armed_home' or {{ '* ' if states('alarm_control_panel.home') == 'armed_home' or
states('alarm_control_panel.home') == 'armed_away' -}} states('alarm_control_panel.home') == 'armed_away' -}}
{{- states('sensor.dark_sky_temperature')|int}} °F, Feels like {{- states('sensor.dark_sky_temperature')|int}} °F, Feels like
{{- ' ' ~ states('sensor.dark_sky_apparent_temperature') |int -}} {{- ' ' ~ states('sensor.dark_sky_apparent_temperature') |int -}}
- service: script.patio_camera_text_overlay - service: script.patio_camera_text_overlay
data_template: data:
text: > text: >
{{ '* ' if states('alarm_control_panel.home') == 'armed_home' or {{ '* ' if states('alarm_control_panel.home') == 'armed_home' or
states('alarm_control_panel.home') == 'armed_away' -}} states('alarm_control_panel.home') == 'armed_away' -}}
@@ -1047,25 +1055,25 @@ automation:
- alias: Keep Chromecast On - alias: Keep Chromecast On
trigger: trigger:
- platform: state - platform: state
entity_id: media_player.attic_tv entity_id: media_player.chromecast_monitor
to: "off" to: "off"
for: for:
seconds: 30 seconds: 30
- platform: state - platform: state
entity_id: media_player.attic_tv entity_id: media_player.chromecast_monitor
to: "idle" to: "idle"
for: for:
seconds: 30 seconds: 30
action: action:
- service: media_player.turn_on - service: media_player.turn_on
entity_id: media_player.attic_tv entity_id: media_player.chromecast_monitor
- service: media_player.play_media - service: media_player.play_media
data: data:
entity_id: media_player.attic_tv entity_id: media_player.chromecast_monitor
media_content_id: !secret frontdoor_camera_stream_url media_content_id: !secret frontdoor_camera_stream_url
media_content_type: video media_content_type: video
- service: input_label.set_value - service: input_label.set_value
data_template: data:
entity_id: input_label.current_stream entity_id: input_label.current_stream
value: "frontyard" value: "frontyard"
@@ -1102,31 +1110,31 @@ script:
frontdoor_cam: frontdoor_cam:
sequence: sequence:
- service: script.stream2chromecast - service: script.stream2chromecast
data_template: data:
url: !secret frontdoor_camera_stream_url url: !secret frontdoor_camera_stream_url
name: "frontyard" name: "frontyard"
driveway_cam: driveway_cam:
sequence: sequence:
- service: script.stream2chromecast - service: script.stream2chromecast
data_template: data:
url: !secret driveway_camera_stream_url url: !secret driveway_camera_stream_url
name: "driveway" name: "driveway"
patio_cam: patio_cam:
sequence: sequence:
- service: script.stream2chromecast - service: script.stream2chromecast
data_template: data:
url: !secret patio_camera_stream_url url: !secret patio_camera_stream_url
name: "patio" name: "patio"
playarea_cam: playarea_cam:
sequence: sequence:
- service: script.stream2chromecast - service: script.stream2chromecast
data_template: data:
url: !secret playarea_camera_stream_url url: !secret playarea_camera_stream_url
name: "playarea" name: "playarea"
porch_cam: porch_cam:
sequence: sequence:
- service: script.stream2chromecast - service: script.stream2chromecast
data_template: data:
url: !secret porch_camera_stream_url url: !secret porch_camera_stream_url
name: "porch" name: "porch"
@@ -1144,7 +1152,7 @@ script:
- condition: template - condition: template
value_template: "{{ states('input_boolean.stream_camera2chromecast') == 'on' }}" value_template: "{{ states('input_boolean.stream_camera2chromecast') == 'on' }}"
- service: script.stream2chromecast - service: script.stream2chromecast
data_template: data:
url: !secret frontdoor_camera_stream_url url: !secret frontdoor_camera_stream_url
name: "frontyard" name: "frontyard"
@@ -1153,7 +1161,7 @@ script:
- condition: template - condition: template
value_template: "{{ states('input_boolean.stream_camera2chromecast') == 'on' }}" value_template: "{{ states('input_boolean.stream_camera2chromecast') == 'on' }}"
- service: script.stream2chromecast - service: script.stream2chromecast
data_template: data:
url: !secret driveway_camera_stream_url url: !secret driveway_camera_stream_url
name: "driveway" name: "driveway"
@@ -1162,7 +1170,7 @@ script:
- condition: template - condition: template
value_template: "{{ states('input_boolean.stream_camera2chromecast') == 'on' }}" value_template: "{{ states('input_boolean.stream_camera2chromecast') == 'on' }}"
- service: script.stream2chromecast - service: script.stream2chromecast
data_template: data:
url: !secret patio_camera_stream_url url: !secret patio_camera_stream_url
name: "patio" name: "patio"
@@ -1171,7 +1179,7 @@ script:
- condition: template - condition: template
value_template: "{{ states('input_boolean.stream_camera2chromecast') == 'on' }}" value_template: "{{ states('input_boolean.stream_camera2chromecast') == 'on' }}"
- service: script.stream2chromecast - service: script.stream2chromecast
data_template: data:
url: !secret playarea_camera_stream_url url: !secret playarea_camera_stream_url
name: "playarea" name: "playarea"
@@ -1180,7 +1188,7 @@ script:
- condition: template - condition: template
value_template: "{{ states('input_boolean.stream_camera2chromecast') == 'on' }}" value_template: "{{ states('input_boolean.stream_camera2chromecast') == 'on' }}"
- service: script.stream2chromecast - service: script.stream2chromecast
data_template: data:
url: !secret porch_camera_stream_url url: !secret porch_camera_stream_url
name: "porch" name: "porch"
@@ -1199,25 +1207,25 @@ script:
frontdoor_camera_text_overlay: frontdoor_camera_text_overlay:
sequence: sequence:
- service: rest_command.set_frontdoor_camera_text_left_bottom - service: rest_command.set_frontdoor_camera_text_left_bottom
data_template: data:
message: "{{text}}" message: "{{text}}"
driveway_camera_text_overlay: driveway_camera_text_overlay:
sequence: sequence:
- service: rest_command.set_driveway_camera_text_left_bottom - service: rest_command.set_driveway_camera_text_left_bottom
data_template: data:
message: "{{text}}" message: "{{text}}"
patio_camera_text_overlay: patio_camera_text_overlay:
sequence: sequence:
- service: rest_command.set_patio_camera_text_left_bottom - service: rest_command.set_patio_camera_text_left_bottom
data_template: data:
message: "{{text}}" message: "{{text}}"
playarea_camera_text_overlay: playarea_camera_text_overlay:
sequence: sequence:
- service: rest_command.set_playarea_camera_text_left_bottom - service: rest_command.set_playarea_camera_text_left_bottom
data_template: data:
message: "{{text}}" message: "{{text}}"
############################################################################### ###############################################################################
@@ -1231,11 +1239,11 @@ script:
- condition: template - condition: template
value_template: "{{ states('input_label.current_stream') != name }}" value_template: "{{ states('input_label.current_stream') != name }}"
- service: media_player.play_media - service: media_player.play_media
data_template: data:
entity_id: media_player.attic_tv entity_id: media_player.chromecast_monitor
media_content_id: "{{ url }}" media_content_id: "{{ url }}"
media_content_type: "video" media_content_type: "video"
- service: input_label.set_value - service: input_label.set_value
data_template: data:
entity_id: input_label.current_stream entity_id: input_label.current_stream
value: "{{ name }}" value: "{{ name }}"

View File

@@ -156,7 +156,7 @@ automation:
# Turn outdoor lights on 15 minutes before sunset # Turn outdoor lights on 15 minutes before sunset
############################################################################### ###############################################################################
- alias: Evening Outdoor Lights ON (At Sunset) - alias: Evening Outdoor Lights ON (At Sunset)
# initial_state: true # initial_state: true
trigger: trigger:
platform: sun platform: sun
event: sunset event: sunset
@@ -171,6 +171,37 @@ automation:
- service: switch.turn_on - service: switch.turn_on
entity_id: switch.backyard_light entity_id: switch.backyard_light
- alias: Christmas Lights ON (At Sunset)
trigger:
platform: sun
event: sunset
offset: "+00:00:00"
condition:
- condition: state
entity_id: input_boolean.light_automations
state: "on"
action:
- service: switch.turn_on
entity_id: switch.left
- service: switch.turn_on
entity_id: switch.backyard_light
- alias: Christmas Lights OFF (At Sunrise)
initial_state: true
trigger:
platform: sun
event: sunrise
offset: "00:15:00"
condition:
- condition: state
entity_id: input_boolean.light_automations
state: "on"
action:
- service: switch.turn_off
entity_id: switch.left
- service: switch.turn_off
entity_id: switch.backyard_light
############################################################################### ###############################################################################
# Turn indoor lights on 30 minutes before sunset # Turn indoor lights on 30 minutes before sunset
############################################################################### ###############################################################################
@@ -284,9 +315,6 @@ automation:
state: "on" state: "on"
action: action:
- service: script.all_indoor_lights_off - service: script.all_indoor_lights_off
# - service: script.notify_me
# data:
# message: "It is bed time, turned lights off!"
############################################################################### ###############################################################################
# Provide Bed time Report via TTS # Provide Bed time Report via TTS
@@ -302,10 +330,9 @@ automation:
action: action:
- service: script.good_night_tts - service: script.good_night_tts
###############################################################################
############################################################################### # TOGGLE WORKING IN OFFICE BOOLEAN
# TOGGLE WORKING IN OFFICE BOOLEAN ###############################################################################
###############################################################################
- alias: Suresh Working in Office Start - alias: Suresh Working in Office Start
initial_state: true initial_state: true

View File

@@ -1,24 +1,6 @@
homeassistant: homeassistant:
customize: customize:
package.door_sensors: package.door_sensors:
door_notification_script: &door_notification_script
message: >
{% set doors = "" %}
{% if states('binary_sensor.door_window_sensor_158d0004231f7b') == "on" and
states('binary_sensor.door_window_sensor_158d0004248d5b') == "on" %}
{% set doors = "Attention! Both Garage Doors are OPEN" %}
{% elif states('binary_sensor.door_window_sensor_158d0004231f7b') == "off" and
states('binary_sensor.door_window_sensor_158d0004248d5b') == "off" %}
{% set doors = "Both Garage Doors are now CLOSED" %}
{% else %}
{% if trigger.from_state.state != trigger.to_state.state and trigger.to_state.state | lower == "on" %}
Attention! Your {{ trigger.to_state.attributes.friendly_name }} is now OPENED!
{% elif trigger.from_state.state != trigger.to_state.state and trigger.to_state.state | lower == "off" %}
Your {{ trigger.to_state.attributes.friendly_name }} is now CLOSED!
{% endif %}
{% endif %}
{{ doors }}
sensor: sensor:
- platform: template - platform: template
sensors: sensors:
@@ -77,7 +59,6 @@ binary_sensor:
payload_off: "off" payload_off: "off"
value_template: "{{ value }}" value_template: "{{ value }}"
############################################################################### ###############################################################################
# _ _ _ # _ _ _
# /\ | | | | (_) # /\ | | | | (_)
@@ -119,104 +100,77 @@ automation:
entity_id: switch.garage entity_id: switch.garage
################################################################################ ################################################################################
# Notifies when either of the garage door is opened or closed # Notifies when either of the garage doors is opened or closed
############################################################################### ################################################################################
- alias: Notify Garage Door Status - alias: Notify Garage Door Status
initial_state: true initial_state: true
trigger: trigger:
platform: state platform: state
entity_id: entity_id:
- binary_sensor.door_window_sensor_158d0004231f7b # 2 Car Garage
- binary_sensor.door_window_sensor_158d0004248d5b # Single car garage - binary_sensor.door_window_sensor_158d0004248d5b # Single car garage
- binary_sensor.door_window_sensor_158d0004231f7b # 2 Car Garage
condition: condition:
- condition: template
value_template: "{{ trigger.from_state.state != trigger.to_state.state }}"
- condition: template - condition: template
value_template: "{{ trigger.from_state.state not in ['unavailable', 'unknown'] }}" value_template: "{{ trigger.from_state.state not in ['unavailable', 'unknown'] }}"
- condition: template - condition: template
value_template: "{{ trigger.to_state.state not in ['unavailable', 'unknown'] }}" value_template: "{{ trigger.from_state.state != trigger.to_state.state }}"
- condition: template
value_template: "{{ states('input_boolean.garage_door_notifications') == 'on' }}"
action: action:
- service: switch.turn_on - service: switch.turn_on
entity_id: switch.garage entity_id: switch.garage
- service: script.notify_me - service: camera.snapshot
data_template: data:
entity_id: "camera.garage"
filename: "{{ '/config/www/downloads/camera/garage/garage_' ~
((state_attr('automation.notify_garage_door_status', 'last_triggered') |string).replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg') }}"
################################################################################
# Notify devices
################################################################################
- service: script.notify_family
data:
title: "{{ 'Garage Door Open' if trigger.to_state.state | lower == 'on' else 'Garage Door Closed' }}"
message: > message: >
{% if trigger.to_state.state | lower == "on" %} {% if trigger.to_state.state | lower == "on" %}
{{ trigger.to_state.attributes.friendly_name }} is now OPENED! {{ trigger.to_state.attributes.friendly_name.replace('Sensor', '') -}} is OPEN
{% elif trigger.to_state.state | lower == "off" %} {% elif trigger.to_state.state | lower == "off" %}
{{ trigger.to_state.attributes.friendly_name }} is now CLOSED! {{ trigger.to_state.attributes.friendly_name.replace('Sensor', '') -}} is CLOSED
{% endif %} {% endif %}
- service: script.led_message url: !secret garage_camera_snapshot_url
data_template: notify_options:
<<: *door_notification_script - tv
- service: script.voice_notify - led
data_template: - voice
<<: *door_notification_script
- delay: "00:00:05" ################################################################################
- service: camera.snapshot # SEND PICTURES AS ATTACHMENTS TO EMAIL AND TELEGRAM
data_template: ################################################################################
entity_id: "camera.garage" - service: script.notify_family_with_picture
filename: data:
title: "{{ 'Garage Door Open' if trigger.to_state.state | lower == 'on' else 'Garage Door Closed' }}"
message: >
{% if trigger.to_state.state | lower == "on" %}
{{ trigger.to_state.attributes.friendly_name.replace('Sensor', '') }} is OPEN
{% elif trigger.to_state.state | lower == "off" %}
{{ trigger.to_state.attributes.friendly_name.replace('Sensor', '') }} is CLOSED
{% endif %}
url: !secret garage_camera_snapshot_url
path: >
"{{ '/config/www/downloads/camera/garage/garage_' ~ "{{ '/config/www/downloads/camera/garage/garage_' ~
((state_attr('automation.notify_garage_door_status', 'last_triggered') |string).replace('-','_') ((state_attr('automation.notify_garage_door_status', 'last_triggered') |string).replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg') }}" .replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg') }}"
notify_options:
- telegram
# - email
- service: script.notify_me_with_picture - delay: "00:00:05"
data_template: - service: switch.turn_off
title: 'Garage Door Status {{ now().strftime("%d %h %Y, %I:%M:%S %p") }}'
message: >-
{%- set doors = "" -%}
{%- if states('binary_sensor.door_window_sensor_158d0004231f7b') == "on" and
states('binary_sensor.door_window_sensor_158d0004248d5b') == "on" -%}
{% set doors = "Both Garage Doors are OPEN" -%}
{%- elif states('binary_sensor.door_window_sensor_158d0004231f7b') == "off" and
states('binary_sensor.door_window_sensor_158d0004248d5b') == "off" -%}
{% set doors = "Both Garage Doors are CLOSED" -%}
{%- else -%}
{% set doors = states.binary_sensor.door_window_sensor_158d0004248d5b.name ~ " is " ~
('Closed' if states('binary_sensor.door_window_sensor_158d0004248d5b') == 'off' else 'OPEN')
~ " and " ~ state_attr('binary_sensor.door_window_sensor_158d0004231f7b', 'friendly_name') ~ " is " ~
('Closed' if states('binary_sensor.door_window_sensor_158d0004231f7b') == 'off' else 'OPEN') %}
{%- endif %}
Your {{doors}} on {{ now().strftime("%d %h %Y, at %I:%M:%S %p") }}. Please check the garage snapshot below.
file: >
{{ '/config/www/downloads/camera/garage/garage_' ~
((state_attr('automation.notify_garage_door_status', 'last_triggered') |string).replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg') }}
caption: "{{ trigger.to_state.attributes.friendly_name }}: {{ 'OPEN' if trigger.to_state.state == 'on' else 'CLOSED' }}"
- service: notify.notify_smtp
data_template:
title: 'Garage Door Status {{ now().strftime("%d %h %Y, %I:%M:%S %p") }}'
message: >-
{%- set doors = "" -%}
{%- if states('binary_sensor.door_window_sensor_158d0004231f7b') == "on" and
states('binary_sensor.door_window_sensor_158d0004248d5b') == "on" -%}
{%- set doors = "Both Garage Doors are OPEN" -%}
{%- elif states('binary_sensor.door_window_sensor_158d0004231f7b') == "off" and
states('binary_sensor.door_window_sensor_158d0004248d5b') == "off" -%}
{%- set doors = "Both Garage Doors are CLOSED" -%}
{%- else -%}
{%- set doors = states.binary_sensor.door_window_sensor_158d0004248d5b.name ~ " is " ~
('Closed' if states('binary_sensor.door_window_sensor_158d0004248d5b') == 'off' else 'OPEN')
~ " and " ~ state_attr('binary_sensor.door_window_sensor_158d0004231f7b', 'friendly_name') ~ " is " ~
('Closed' if states('binary_sensor.door_window_sensor_158d0004231f7b') == 'off' else 'OPEN') -%}
{%- endif -%}
Your {{doors}} on {{ now().strftime("%d %h %Y, at %I:%M:%S %p") }}. Please check the garage snapshot below.
data:
images:
- "{{ '/config/www/downloads/camera/garage/garage_' ~
((state_attr('automation.notify_garage_door_status', 'last_triggered') |string).replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg') }}"
- service_template: "switch.turn_{{- trigger.to_state.state }}"
entity_id: switch.garage entity_id: switch.garage
###############################################################################
# Notify Entry Door Status # Notify Entry Door Status
############################################################################### ###############################################################################
- alias: Voice Notify Entry Door Status - alias: Notify Entry Door Status
initial_state: true initial_state: true
trigger: trigger:
platform: state platform: state
@@ -230,33 +184,26 @@ automation:
- condition: template - condition: template
value_template: "{{ trigger.from_state.state != trigger.to_state.state }}" value_template: "{{ trigger.from_state.state != trigger.to_state.state }}"
action: action:
- service: script.voice_notify - service: script.notify_family
data_template: data:
message: > message: >
{% if trigger.to_state.state | lower == "on" %} {% if trigger.to_state.state | lower == "on" %}
Your {{ trigger.to_state.attributes.friendly_name.replace('Sensor', '') }} is OPEN, Your {{ trigger.to_state.attributes.friendly_name.replace(' Sensor', '') }} is OPEN
{% if states('alarm_control_panel.home') == 'armed_home' or {% if states('alarm_control_panel.home') == 'armed_home' or
states('alarm_control_panel.home') == 'armed_away' %} states('alarm_control_panel.home') == 'armed_away' %}
But your home security system is ON. But your home security system is ON.
{% endif %} {% endif %}
{% elif trigger.to_state.state | lower == "off" %} {% elif trigger.to_state.state | lower == "off" %}
Your {{ trigger.to_state.attributes.friendly_name.replace('Sensor', '') }} is CLOSED! Your {{ trigger.to_state.attributes.friendly_name.replace(' Sensor', '') }} is CLOSED
{% endif %}
greeting: "no"
only_at_night: >
{% if states('alarm_control_panel.home') == 'armed_home' %}
no
{% else %}
yes
{% endif %}
- service: script.led_message
data_template:
message: >
{% if trigger.to_state.state | lower == "on" %}
Your {{ trigger.to_state.attributes.friendly_name.replace('Sensor', '') |lower -}} is open.
{% else %}
Your {{ trigger.to_state.attributes.friendly_name.replace('Sensor', '') |lower -}} is closed.
{% endif %} {% endif %}
notify_options:
# - telegram
- tv
- led
###############################################################################
# Light automations when doors are opened
###############################################################################
- alias: When Front Door Opens Turn Front Room Lights ON - alias: When Front Door Opens Turn Front Room Lights ON
initial_state: true initial_state: true
@@ -324,12 +271,12 @@ automation:
- service: timer.start - service: timer.start
entity_id: timer.timer_garage entity_id: timer.timer_garage
############################################################################### ###############################################################################
# MASTER BATHROOM AUTOMATIONS # MASTER BATHROOM AUTOMATIONS
############################################################################### ###############################################################################
# #
# Only turn ON lights at 25% at night # Only turn ON lights at 25% at night
# #
- alias: Master Bathroom Door Opened After Dark - alias: Master Bathroom Door Opened After Dark
initial_state: true initial_state: true
trigger: trigger:
@@ -396,12 +343,12 @@ automation:
state: "on" state: "on"
action: action:
- service: switch.turn_off - service: switch.turn_off
data_template: data:
entity_id: switch.master_bathroom_toilet_light entity_id: switch.master_bathroom_toilet_light
############################################################################### ###############################################################################
# GUEST BATHROOM AUTOMATIONS # GUEST BATHROOM AUTOMATIONS
############################################################################### ###############################################################################
- alias: Guest Bathroom Door Opened - alias: Guest Bathroom Door Opened
initial_state: true initial_state: true

View File

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

View File

@@ -55,11 +55,11 @@ automation:
script.xiaomi_red script.xiaomi_red
{% endif %} {% endif %}
# #
# This automation will trigger when the Home Security System is "Triggered" # This automation will trigger when the Home Security System is "Triggered"
# This will send all relevant information - Door Statuses and Camera snapshots around the home # This will send all relevant information - Door Statuses and Camera snapshots around the home
# Meanwhile Home Security Company will be calling and/or dispatching Police over to the house. # Meanwhile Home Security Company will be calling and/or dispatching Police over to the house.
# This should give you enough information to have a good conversation with the Home Security System company when not at home # This should give you enough information to have a good conversation with the Home Security System company when not at home
- alias: Home Security Triggered - alias: Home Security Triggered
initial_state: true initial_state: true
@@ -67,9 +67,12 @@ automation:
platform: state platform: state
entity_id: alarm_control_panel.home entity_id: alarm_control_panel.home
to: "triggered" to: "triggered"
condition:
- condition: template
value_template: "{{ states('input_boolean.security_system_alerts') == 'on' }}"
action: action:
- service: script.notify_me - service: script.notify_family
data_template: data:
message: > message: >
{% set ns = namespace(openDoorCount=0, doorNames="") %} {% set ns = namespace(openDoorCount=0, doorNames="") %}
{%- set sensors = [ {%- set sensors = [
@@ -89,45 +92,45 @@ automation:
Your Home Security System is triggered. {{ "But ALL Doors are CLOSED! Must be a spider on one of the sensor(s) triggered it!" if ns.openDoorCount == 0 else 'Following sensors are ON currently:' }} Your Home Security System is triggered. {{ "But ALL Doors are CLOSED! Must be a spider on one of the sensor(s) triggered it!" if ns.openDoorCount == 0 else 'Following sensors are ON currently:' }}
{{ ns.doorNames }} {{ ns.doorNames }}
notify_options:
- telegram
- tv
- led
- voice
- service: camera.snapshot - service: camera.snapshot
data_template: data:
entity_id: "camera.frontdoor_camera" entity_id: "camera.frontdoor_camera"
filename: filename: "{{ '/config/www/downloads/camera/frontdoor/frontdoor_' ~
"{{ '/config/www/downloads/camera/frontdoor/frontdoor_' ~
(states.binary_sensor.motion_sensor_158d00024ee084.last_updated ~ '').replace('-','_') (states.binary_sensor.motion_sensor_158d00024ee084.last_updated ~ '').replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}" .replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- service: camera.snapshot - service: camera.snapshot
data_template: data:
entity_id: "camera.driveway_camera" entity_id: "camera.driveway_camera"
filename: filename: "{{ '/config/www/downloads/camera/driveway/driveway_' ~
"{{ '/config/www/downloads/camera/driveway/driveway_' ~
(states.binary_sensor.motion_sensor_158d00024ee084.last_updated ~ '').replace('-','_') (states.binary_sensor.motion_sensor_158d00024ee084.last_updated ~ '').replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}" .replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- service: camera.snapshot - service: camera.snapshot
data_template: data:
entity_id: "camera.garage" entity_id: "camera.garage"
filename: filename: "{{ '/config/www/downloads/camera/garage/garage_' ~
"{{ '/config/www/downloads/camera/garage/garage_' ~
(states.binary_sensor.motion_sensor_158d00024ee084.last_updated ~ '').replace('-','_') (states.binary_sensor.motion_sensor_158d00024ee084.last_updated ~ '').replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}" .replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- service: camera.snapshot - service: camera.snapshot
data_template: data:
entity_id: "camera.patio_camera" entity_id: "camera.patio_camera"
filename: filename: "{{ '/config/www/downloads/camera/patio/patio_' ~
"{{ '/config/www/downloads/camera/patio/patio_' ~
(states.binary_sensor.motion_sensor_158d00024e842c.last_updated ~ '').replace('-','_') (states.binary_sensor.motion_sensor_158d00024e842c.last_updated ~ '').replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}" .replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- service: camera.snapshot - service: camera.snapshot
data_template: data:
entity_id: "camera.playarea_camera" entity_id: "camera.playarea_camera"
filename: filename: "{{ '/config/www/downloads/camera/playarea/playarea_' ~
"{{ '/config/www/downloads/camera/playarea/playarea_' ~
(states.binary_sensor.motion_sensor_158d00024e842c.last_updated ~ '').replace('-','_') (states.binary_sensor.motion_sensor_158d00024e842c.last_updated ~ '').replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}" .replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- service: notify.telegram - service: notify.telegram
data_template: data:
title: "Camera Snapshots" title: "Camera Snapshots"
message: "Please check the camera images just to be sure!" message: "Please check the camera images just to be sure!"
data: data:
@@ -164,28 +167,16 @@ automation:
condition: condition:
- condition: template - condition: template
value_template: "{{ states('input_boolean.security_system_alerts') == 'on' }}" value_template: "{{ states('input_boolean.security_system_alerts') == 'on' }}"
# - condition: template - condition: template
# value_template: > value_template: >
# {%- if state_attr('automation.notify_home_security_status_change', 'last_triggered') -%} {%- if state_attr('automation.notify_home_security_status_change', 'last_triggered') -%}
# {{ (as_timestamp(now()) - as_timestamp(state_attr('automation.notify_home_security_status_change', 'last_triggered'))) > 90 }} {{ (as_timestamp(now()) - as_timestamp(state_attr('automation.notify_home_security_status_change', 'last_triggered'))) > 90 }}
# {%- else -%} {%- else -%}
# true true
# {%- endif -%} {%- endif -%}
action: action:
- service: script.notify_me - service: script.notify_family
data_template: data:
message: >
{% if states('alarm_control_panel.home') == "armed_home" %}
Your home is now secured!
{% elif states('alarm_control_panel.home') == "armed_away" %}
Your Home Security System is now set to Away mode!
{% elif states('alarm_control_panel.home') == "triggered" %}
Attention!: Your Home Security System is triggered! It has been notified to the authorities.
{% elif states('alarm_control_panel.home') == "disarmed" %}
Attention!: Your Home Security System is turned OFF.
{% endif %}
- service: script.voice_notify
data_template:
message: > message: >
{% if states('alarm_control_panel.home') == "armed_home" %} {% if states('alarm_control_panel.home') == "armed_home" %}
Your home is now secured! Your home is now secured!
@@ -196,10 +187,16 @@ automation:
{% elif states('alarm_control_panel.home') == "disarmed" %} {% elif states('alarm_control_panel.home') == "disarmed" %}
Attention!: Your Home Security System is turned OFF. Attention!: Your Home Security System is turned OFF.
{% endif %} {% endif %}
notify_options:
- telegram
- tv
- led
- voice
- condition: template - condition: template
value_template: "{{ states('alarm_control_panel.home') != 'disarmed' }}" value_template: "{{ states('alarm_control_panel.home') != 'disarmed' }}"
- service: input_boolean.turn_on - service: input_boolean.turn_on
entity_id: input_boolean.notify_camera_alerts entity_id: input_boolean.camera_alerts
############################################################################### ###############################################################################
# A gentle 10 minute reminder that the Home Security system is OFF # A gentle 10 minute reminder that the Home Security system is OFF
@@ -212,10 +209,16 @@ automation:
to: "disarmed" to: "disarmed"
for: for:
minutes: 10 minutes: 10
condition:
- condition: template
value_template: "{{ states('input_boolean.security_system_alerts') == 'on' }}"
action: action:
- service: script.notify_me - service: script.notify_family
data: data:
message: "Home Security System is OFF for more than 10 minutes!" message: "Home Security System is OFF for more than 10 minutes!"
notify_options:
- tv
- led
############################################################################### ###############################################################################
# A gentle reminder that the home security is OFF for more than 30 minutes # A gentle reminder that the home security is OFF for more than 30 minutes
@@ -232,33 +235,12 @@ automation:
- condition: template - condition: template
value_template: "{{ states('input_boolean.security_system_alerts') == 'on' }}" value_template: "{{ states('input_boolean.security_system_alerts') == 'on' }}"
action: action:
- service: script.notify_me - service: script.notify_family
data: data:
message: "Home Security System is OFF for more than 30 minutes!" message: "Home Security System is OFF for more than 30 minutes!"
notify_options:
############################################################################### - tv
# When home security system is turned OFF or turned to Home mode from "away" - led
# means, someone reached home from outside
###############################################################################
- alias: Turn ON Thermostat upon reaching home
initial_state: true
trigger:
platform: state
entity_id: alarm_control_panel.home
condition:
- condition: template
value_template: >
{% if trigger.from_state.state == 'armed_away' and
(trigger.to_state.state == 'armed_home' or trigger.to_state.state == 'disarmed') %}
true
{% else %}
false
{% endif %}
action:
- service: climate.set_away_mode
data_template:
entity_id: climate.dining_room
away_mode: "false"
############################################################################### ###############################################################################
# TURN HOME SECURITY SYSTEM ON AT BED TIME # TURN HOME SECURITY SYSTEM ON AT BED TIME
@@ -284,22 +266,28 @@ automation:
- service: alarm_control_panel.alarm_arm_home - service: alarm_control_panel.alarm_arm_home
data: data:
entity_id: alarm_control_panel.home entity_id: alarm_control_panel.home
- service: script.notify_me - service: script.notify_family
data: data:
message: "It's bedtime, you forgot to turn ON Home Security System. Turned it ON for you." message: "It's bedtime, you forgot to turn ON Home Security System. Turned it ON for you."
notify_options:
- telegram
- tv
- led
############################################################################### ###############################################################################
# Check for Garage Door Status when Home Security System State changes # Check for Garage Door Status when Home Security System State changes
############################################################################### ###############################################################################
- alias: Home Security System And Garage Door Check - alias: Home Security System And Garage Door Check
initial_state: true initial_state: true
trigger: trigger:
- platform: time_pattern - platform: time_pattern
minutes: '/15' minutes: "/15"
seconds: 00 seconds: 00
condition: condition:
condition: and condition: and
conditions: conditions:
- condition: template
value_template: "{{ states('input_boolean.security_system_alerts') == 'on' }}"
- condition: template - condition: template
value_template: "{{ states('alarm_control_panel.home') == 'armed_home' or states('alarm_control_panel.home') == 'armed_away' }}" value_template: "{{ states('alarm_control_panel.home') == 'armed_home' or states('alarm_control_panel.home') == 'armed_away' }}"
- condition: or - condition: or
@@ -311,139 +299,19 @@ automation:
action: action:
- service: switch.turn_on - service: switch.turn_on
entity_id: switch.garage entity_id: switch.garage
- service: script.notify_me
data_template:
message: >
Attention! Your home Security system is set to {{ states('alarm_control_panel.home').split('_')[1] | upper }} mode. BUT THE {% if states('binary_sensor.door_window_sensor_158d0004231f7b') == "on" -%}DOUBLE CAR {%- else %}SINGLE CAR {% endif %}GARAGE DOOR IS STILL OPEN!
- service: camera.snapshot - service: camera.snapshot
data_template: data:
entity_id: "camera.garage" entity_id: "camera.garage"
filename: "{{ '/config/www/downloads/camera/garage/garage_' ~ (state_attr('automation.home_security_system_and_garage_door_check','last_updated') ~ '').replace('-','_').replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}" filename: "{{ '/config/www/downloads/camera/garage/garage_' ~ (state_attr('automation.home_security_system_and_garage_door_check','last_updated') ~ '').replace('-','_').replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- service: script.notify_family
- service: notify.telegram
data_template:
title: "Garage"
message: "Home Security System is ON, but Garage Doors are OPEN!"
data: data:
photo: message: >
- file: "{{ '/config/www/downloads/camera/garage/garage_' ~ Attention! Your home Security system is set to {{ states('alarm_control_panel.home').split('_')[1] | upper }} mode. BUT THE {% if states('binary_sensor.door_window_sensor_158d0004231f7b') == "on" -%}DOUBLE CAR {%- else %}SINGLE CAR {% endif %}GARAGE DOOR IS STILL OPEN!
url: "{{ '/config/www/downloads/camera/garage/garage_' ~
(states.binary_sensor.motion_sensor_158d00024ee084.last_updated ~ '').replace('-','_') (states.binary_sensor.motion_sensor_158d00024ee084.last_updated ~ '').replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}" .replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
caption: "Garage" notify_options:
- telegram
- condition: template - tv
value_template: "{{ states('alarm_control_panel.home') == 'armed_home' }}" - led
- voice
- service: script.voice_notify
data_template:
message: >
{%- set doors = "" %}
{%- if states('binary_sensor.door_window_sensor_158d0004231f7b') == "on" and states('binary_sensor.door_window_sensor_158d0004248d5b') == "on" %}
{%- set doors = "Both garage doors" %}
{%- elif states('binary_sensor.door_window_sensor_158d0004248d5b') == "on"%}
{%- set doors = state_attr('binary_sensor.door_window_sensor_158d0004248d5b', 'friendly_name') %}
{%- elif states('binary_sensor.door_window_sensor_158d0004248d5b') == "on" %}
{%- set doors = state_attr('binary_sensor.door_window_sensor_158d0004231f7b', 'friendly_name') %}
{%- endif %}
Attention! Your home Security system is set to {{ states('alarm_control_panel.home').split('_')[1] | upper }} mode.
BUT the {{ doors }} {{ 'are' if doors.endswith('s') else 'is' }} open.
###############################################################################
# Turn Home Security System ON at sunset time
###############################################################################
# - alias: Turn On Home Security System At Sunset
# initial_state: true
# trigger:
# platform: sun
# event: sunset
# offset: '+00:00:00'
# condition:
# - condition: state
# entity_id: alarm_control_panel.home
# state: 'disarmed'
# action:
# - service_template: >-
# {% if states('binary_sensor.back_door_sensor_sensor') == "off" and
# states('binary_sensor.aeotec_zw120_door_window_sensor_gen5_sensor') == "off" and
# states('binary_sensor.door_window_sensor_158d0004231f7b') == "off" and
# states('binary_sensor.door_window_sensor_158d0004248d5b') == "off" %}
# alarm_control_panel.alarm_arm_home
# {% else %}
# alarm_control_panel.disarm
# {% endif %}
# data:
# entity_id: alarm_control_panel.home
# - service: script.voice_notify
# data_template:
# message: >
# {% if states('binary_sensor.back_door_sensor_sensor') == "off" and
# states('binary_sensor.aeotec_zw120_door_window_sensor_gen5_sensor') == "off" and
# states('binary_sensor.door_window_sensor_158d0004231f7b') == "off" and
# states('binary_sensor.door_window_sensor_158d0004248d5b') == "off" %}
# It's getting dark outside, and your home security system is now set to HOME mode.
# {% else %}
# It is getting dark outside.
# {%- if states('binary_sensor.back_door_sensor_sensor') == "on" -%}
# {%- set doors = doors ~ " Back Door" -%}
# {%- endif -%}
# {%- if states('binary_sensor.aeotec_zw120_door_window_sensor_gen5_sensor') == "on" -%}
# {% if doors | trim != "" %}
# {%- set doors = doors ~ " and Front Door" -%}
# {% else %}
# {%- set doors = doors ~ " Front Door" -%}
# {% endif %}
# {%- endif -%}
# {%- if states('binary_sensor.door_window_sensor_158d0004231f7b') == "on" -%}
# {% if doors | trim != "" %}
# {%- set doors = doors ~ " and Two Car Garage Door" -%}
# {% else %}
# {%- set doors = doors ~ " Two Car Garage Door" -%}
# {% endif %}
# {%- endif -%}
# {%- if states('binary_sensor.door_window_sensor_158d0004248d5b') == "on" -%}
# {% if doors | trim != "" %}
# {%- set doors = doors ~ " and Single Car Garage Door" -%}
# {% else %}
# {%- set doors = doors ~ " Single Car Garage Door" -%}
# {% endif %}
# {%- endif -%}
# Your{{ doors }} {%- if 'and' in doors -%}s are {%- else %} is {%- endif %} open. Home Security System could not be turned on.
# {% endif %}
# - service: script.notify_me
# data_template:
# message: >
# {% if states('binary_sensor.back_door_sensor_sensor') == "off" and
# states('binary_sensor.aeotec_zw120_door_window_sensor_gen5_sensor') == "off" and
# states('binary_sensor.door_window_sensor_158d0004231f7b') == "off" and
# states('binary_sensor.door_window_sensor_158d0004248d5b') == "off" %}
# It's getting dark outside, and your home security system is now set to HOME mode.
# {% else %}
# It is getting dark outside.
# {%- if states('binary_sensor.back_door_sensor_sensor') == "on" -%}
# {%- set doors = doors ~ " Back Door" -%}
# {%- endif -%}
# {%- if states('binary_sensor.aeotec_zw120_door_window_sensor_gen5_sensor') == "on" -%}
# {% if doors | trim != "" %}
# {%- set doors = doors ~ " and Front Door" -%}
# {% else %}
# {%- set doors = doors ~ " Front Door" -%}
# {% endif %}
# {%- endif -%}
# {%- if states('binary_sensor.door_window_sensor_158d0004231f7b') == "on" -%}
# {% if doors | trim != "" %}
# {%- set doors = doors ~ " and Two Car Garage Door" -%}
# {% else %}
# {%- set doors = doors ~ " Two Car Garage Door" -%}
# {% endif %}
# {%- endif -%}
# {%- if states('binary_sensor.door_window_sensor_158d0004248d5b') == "on" -%}
# {% if doors | trim != "" %}
# {%- set doors = doors ~ " and Single Car Garage Door" -%}
# {% else %}
# {%- set doors = doors ~ " Single Car Garage Door" -%}
# {% endif %}
# {%- endif -%}
# Your {{ doors}} {%- if 'and' in doors -%}s are {%- else %} is {%- endif %} open. Home Security System could not be turned on.
# {% endif %}

View File

@@ -4,53 +4,60 @@ automation:
############################################################################### ###############################################################################
# Display Weather Information on LED Screen # Display Weather Information on LED Screen
############################################################################### ###############################################################################
- alias: Display Weather Changes on LED Screen - alias: Notify Weather Changes
initial_state: true initial_state: true
trigger: trigger:
- platform: state - platform: state
entity_id: sensor.dark_sky_apparent_temperature, sensor.dark_sky_hourly_summary entity_id: sensor.dark_sky_apparent_temperature, sensor.dark_sky_hourly_summary
action: action:
- service: script.led_message - service: script.notify_family
data_template: data:
message: > message: >
{{ states('sensor.dark_sky_apparent_temperature') |int }} degrees, {{ states('sensor.dark_sky_hourly_summary') }} {{ states('sensor.dark_sky_apparent_temperature') |int }} degrees, {{ states('sensor.dark_sky_hourly_summary') }}
notify_options:
- tv
- led
############################################################################### # ###############################################################################
# Display Garage Door Status on LED Screen # # Display Garage Door Status on LED Screen
############################################################################### # ###############################################################################
- alias: Notify Garage Door Status on LED Screen # - alias: Notify Garage Door Status on LED Screen
initial_state: true # initial_state: true
trigger: # trigger:
platform: state # platform: state
entity_id: # entity_id:
- binary_sensor.door_window_sensor_158d0004231f7b # - binary_sensor.door_window_sensor_158d0004231f7b
- binary_sensor.door_window_sensor_158d0004248d5b # - binary_sensor.door_window_sensor_158d0004248d5b
condition: # condition:
- condition: template # - condition: template
value_template: "{{ trigger.from_state.state not in ['unavailable', 'unknown'] }}" # value_template: "{{ trigger.from_state.state not in ['unavailable', 'unknown'] }}"
- condition: template # - condition: template
value_template: "{{ trigger.to_state.state not in ['unavailable', 'unknown'] }}" # value_template: "{{ trigger.to_state.state not in ['unavailable', 'unknown'] }}"
- condition: template # - condition: template
value_template: "{{ states('input_boolean.garage_door_notifications') == 'on' }}" # value_template: "{{ states('input_boolean.garage_door_notifications') == 'on' }}"
action: # action:
- service: script.led_message # - service: script.notify_family
data_template: # data:
message: > # message: >
{% set doors = "" %} # {% set doors = "" %}
{% if states('binary_sensor.door_window_sensor_158d0004231f7b') == "on" and # {% if states('binary_sensor.door_window_sensor_158d0004231f7b') == "on" and
states('binary_sensor.door_window_sensor_158d0004248d5b') == "on" %} # states('binary_sensor.door_window_sensor_158d0004248d5b') == "on" %}
{% set doors = "Attention! Both Garage Doors are OPEN" %} # {% set doors = "Attention! Both Garage Doors are OPEN" %}
{% elif states('binary_sensor.door_window_sensor_158d0004231f7b') == "off" and # {% elif states('binary_sensor.door_window_sensor_158d0004231f7b') == "off" and
states('binary_sensor.door_window_sensor_158d0004248d5b') == "off" %} # states('binary_sensor.door_window_sensor_158d0004248d5b') == "off" %}
{% set doors = "Both Garage Doors are now CLOSED" %} # {% set doors = "Both Garage Doors are now CLOSED" %}
{% else %} # {% else %}
{% if trigger.to_state.state | lower == "on" %} # {% if trigger.to_state.state | lower == "on" %}
Attention! Your {{ trigger.to_state.attributes.friendly_name }} is now OPENED! # Attention! Your {{ trigger.to_state.attributes.friendly_name }} is now OPENED!
{% elif trigger.to_state.state | lower == "off" %} # {% elif trigger.to_state.state | lower == "off" %}
Your {{ trigger.to_state.attributes.friendly_name }} is now CLOSED! # Your {{ trigger.to_state.attributes.friendly_name }} is now CLOSED!
{% endif %} # {% endif %}
{% endif %} # {% endif %}
{{ doors }} # {{ doors }}
# notify_options:
# - telegram
# - tv
# - led
############################################################################### ###############################################################################
# Display Zone based Messages on LED Screen # Display Zone based Messages on LED Screen
@@ -68,11 +75,14 @@ automation:
to: "home" to: "home"
for: "00:02:00" for: "00:02:00"
action: action:
- service: script.led_message - service: script.notify_family
data_template: data:
message: "Welcome home, {{ trigger.entity_id.split('.')[1].split('_')[1] | title }}" message: "Welcome home, {{ trigger.entity_id.split('.')[1].split('_')[1] | title }}"
notify_options:
- tv
- led
- alias: Alert When Someone Enters a Zone on LED Screen - alias: Alert When Someone Enters Home
initial_state: true initial_state: true
trigger: trigger:
- platform: zone - platform: zone
@@ -87,7 +97,9 @@ automation:
- condition: template - condition: template
value_template: "{{ states('input_boolean.zone_alerts') == 'on' }}" value_template: "{{ states('input_boolean.zone_alerts') == 'on' }}"
action: action:
- service: script.led_message - service: script.notify_family
data_template: data:
message: > message: >
{{ trigger.entity_id.split('.')[1].split('_')[1] | title}} just entered {{ trigger.zone.attributes.friendly_name }}! {{ trigger.entity_id.split('.')[1].split('_')[1] | title}} just entered {{ trigger.zone.attributes.friendly_name }}!
notify_options:
- led

View File

@@ -1,197 +0,0 @@
homeassistant:
customize:
input_label.aeotec_zw120_door_window_sensor_gen5_sensor:
unit_of_measurement: "count"
input_label.back_door_sensor_sensor:
unit_of_measurement: "count"
input_label.basement_door_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.kitchen_motion_sensor_sensor:
unit_of_measurement: "count"
input_label.motion_sensor_158d00016c2d0e:
unit_of_measurement: "count"
input_label.motion_sensor_158d00016db6d2:
unit_of_measurement: "count"
input_label.motion_sensor_158d0001a25041:
unit_of_measurement: "count"
input_label.motion_sensor_158d0001a662fe:
unit_of_measurement: "count"
input_label.motion_sensor_158d00024e57d3:
unit_of_measurement: "count"
input_label.motion_sensor_158d00024e57fb:
unit_of_measurement: "count"
input_label.motion_sensor_158d00024e842c:
unit_of_measurement: "count"
input_label.motion_sensor_158d00024ee084:
unit_of_measurement: "count"
input_label.motion_sensor_158d000272bed1:
unit_of_measurement: "count"
input_label.motion_sensor_158d00047b6f69:
unit_of_measurement: "count"
input_label.motion_sensor_158d000272bf48:
unit_of_measurement: "count"
input_label.motion_sensor_158d000272bfd7:
unit_of_measurement: "count"
input_label.single_car_garage_door_tilt_sensor_sensor:
unit_of_measurement: "count"
input_label.stairs_motion_sensor_sensor:
unit_of_measurement: "count"
input_label.two_car_garage_door_tilt_sensor_sensor:
unit_of_measurement: "count"
input_label.door_window_sensor_158d0004231f7b:
unit_of_measurement: "count"
input_label.door_window_sensor_158d0004248d5b:
unit_of_measurement: "count"
input_label.door_window_sensor_158d00040ad8fc:
unit_of_measurement: "count"
input_label.door_window_sensor_158d0004880f30:
unit_of_measurement: "count"
input_label.door_window_sensor_158d000424a6d6:
unit_of_measurement: "count"
input_label:
door_window_sensor_158d000424a6d6:
name: Front Door
icon: mdi:run-fast
door_window_sensor_158d00040ad8fc:
name: Back Door
icon: mdi:run-fast
door_window_sensor_158d0004880f30:
name: Garage Entry Door
icon: mdi:run-fast
basement_door_sensor_sensor:
name: Basement Door
icon: mdi:run-fast
garage_door_sensor_sensor:
name: Garage Door
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
kitchen_motion_sensor_sensor:
name: Kitchen Motion
icon: mdi:run-fast
motion_sensor_158d00016c2d0e:
name: Dining Room Motion (Xiaomi)
icon: mdi:run-fast
motion_sensor_158d00016db6d2:
name: Front Room Motion (Xiaomi)
icon: mdi:run-fast
motion_sensor_158d0001a25041:
name: Family Room (Xiaomi)
icon: mdi:run-fast
motion_sensor_158d0001a662fe:
name: Kitchen (Xiaomi)
icon: mdi:run-fast
motion_sensor_158d00024e57d3:
name: Master Bedroom (Xiaomi)
icon: mdi:run-fast
motion_sensor_158d00024e57fb:
name: Driveway Motion (Xiaomi)
icon: mdi:run-fast
motion_sensor_158d00024e842c:
name: Backyard Motion (Xiaomi)
icon: mdi:run-fast
motion_sensor_158d00024ee084:
name: Front Door Motion (Xiaomi)
icon: mdi:run-fast
motion_sensor_158d000272bed1:
name: Srinika Bedroom (Xiaomi)
icon: mdi:run-fast
motion_sensor_158d00047b6f69:
name: Hasika Bedroom (Xiaomi)
icon: mdi:run-fast
motion_sensor_158d000272bf48:
name: Garage Motion (Xiaomi)
icon: mdi:run-fast
motion_sensor_158d000272bfd7:
name: Office Room Motion (Xiaomi)
icon: mdi:run-fast
door_window_sensor_158d0004248d5b:
name: Single Car Garage Door
icon: mdi:run-fast
door_window_sensor_158d0004231f7b:
name: Double Car Garage Door
icon: mdi:run-fast
stairs_motion_sensor_sensor:
name: Stairs Motion
icon: mdi:run-fast
automation:
- alias: Count Motions
trigger:
- platform: state
to: "on"
entity_id:
- binary_sensor.door_window_sensor_158d000424a6d6
- binary_sensor.door_window_sensor_158d00040ad8fc
- binary_sensor.door_window_sensor_158d0004880f30 # garage entry door
- binary_sensor.basement_door_sensor_sensor
- binary_sensor.front_room_window_sensor_sensor
- binary_sensor.garage_door_sensor_sensor
- binary_sensor.garage_motion
- binary_sensor.kitchen_motion_sensor_sensor
- binary_sensor.motion_sensor_158d00016c2d0e
- binary_sensor.motion_sensor_158d00016db6d2
- binary_sensor.motion_sensor_158d0001a25041
- binary_sensor.motion_sensor_158d0001a662fe
- binary_sensor.motion_sensor_158d00024e57d3
- binary_sensor.motion_sensor_158d00024e57fb
- binary_sensor.motion_sensor_158d00024e842c
- binary_sensor.motion_sensor_158d00024ee084
- binary_sensor.motion_sensor_158d000272bed1
- binary_sensor.motion_sensor_158d00047b6f69
- binary_sensor.motion_sensor_158d000272bf48
- binary_sensor.motion_sensor_158d000272bfd7
- binary_sensor.stairs_motion_sensor_sensor
- binary_sensor.door_window_sensor_158d0004248d5b # Single Car Garage
- binary_sensor.door_window_sensor_158d0004231f7b # Double Car Garage
action:
- service: input_label.set_value
data_template:
entity_id: "input_label.{{ trigger.entity_id.split('.')[1] }}"
value: >
{% set cur_value = states("input_label." ~ trigger.entity_id.split('.')[1] ) | int %}
{{ cur_value + 1 }}
- alias: Reset Motion Counters At Midnight
trigger:
- platform: time
at: "00:00:00"
action:
- service: input_label.set_value
data:
value: 0
entity_id:
- input_label.basement_door_sensor_sensor
- input_label.front_room_window_sensor_sensor
- input_label.garage_door_sensor_sensor
- input_label.garage_motion
- input_label.kitchen_motion_sensor_sensor
- input_label.motion_sensor_158d00016c2d0e
- input_label.motion_sensor_158d00016db6d2
- input_label.motion_sensor_158d0001a25041
- input_label.motion_sensor_158d0001a662fe
- input_label.motion_sensor_158d00024e57d3
- input_label.motion_sensor_158d00024e57fb
- input_label.motion_sensor_158d00024e842c
- input_label.motion_sensor_158d00024ee084
- input_label.motion_sensor_158d000272bed1
- input_label.motion_sensor_158d00047b6f69
- input_label.motion_sensor_158d000272bf48
- input_label.motion_sensor_158d000272bfd7
- input_label.door_window_sensor_158d000424a6d6
- input_label.door_window_sensor_158d00040ad8fc
- input_label.door_window_sensor_158d0004880f30

View File

@@ -234,7 +234,7 @@ automation:
action: action:
- service: light.turn_on - service: light.turn_on
entity_id: light.hue_color_lamp_1, light.hue_color_lamp_2, light.hue_color_lamp_3 entity_id: light.hue_color_lamp_1, light.hue_color_lamp_2, light.hue_color_lamp_3
data_template: data:
brightness: > brightness: >
{% if states('binary_sensor.sharp_tv') == "on" %} {% if states('binary_sensor.sharp_tv') == "on" %}
25 25

View File

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

View File

@@ -53,15 +53,291 @@ tts:
# Telegram Configuration # Telegram Configuration
# #
telegram_bot: telegram_bot:
# Setup Broadcast for sending messages
- platform: broadcast - platform: broadcast
api_key: !secret telegram_apikey api_key: !secret telegram_apikey
allowed_chat_ids: allowed_chat_ids:
- !secret telegram_chatid - !secret telegram_chatid
# Add Polling
- platform: polling - platform: polling
api_key: !secret telegram_apikey api_key: !secret telegram_apikey
parse_mode: html parse_mode: html
allowed_chat_ids: allowed_chat_ids:
- !secret telegram_chatid - !secret telegram_chatid
###############################################################################
# _ _ _ _ __
# | \ | | | | (_)/ _|
# | \| | ___ | |_ _| |_ _ _
# | . ` |/ _ \| __| | _| | | |
# | |\ | (_) | |_| | | | |_| |
# |_| \_|\___/ \__|_|_| \__, |
# __/ |
# |___/
# Notify Related Scripts
###############################################################################
script:
notify_family_with_picture:
sequence:
- condition: template
value_template: '{{ message | trim != "" }}'
- service: script.notify_telegram_with_picture
data:
url: "{{ url }}"
path: "{{ path }}" # local path
title: "{{ title }}"
message: "{{ message }}"
notify_options: "{{ notify_options }}"
- service: script.notify_email_with_picture
data:
title: "{{ title }}"
message: "{{ message }}"
path: "{{ path }}" # local path
notify_options: "{{ notify_options }}"
notify_family:
sequence:
- condition: template
value_template: '{{ message | trim != "" }}'
- service: script.notify_on_led_screen
data:
message: "{{ message }}"
notify_options: "{{ notify_options }}"
- service: script.notify_firestick
data:
url: "{{ url }}" # local url
path: "{{ file }}" # local path
title: "{{ title }}"
message: "{{ message }}"
notify_options: "{{ notify_options }}"
- service: script.notify_telegram
data:
title: "{{ title }}"
message: "{{ message }}"
notify_options: "{{ notify_options }}"
- service: script.notify_email
data:
title: "{{ title }}"
message: "{{ message }}"
notify_options: "{{ notify_options }}"
- service: script.notify_voice
data:
message: "{{ message }}"
notify_options: "{{ notify_options }}"
###############################################################################
# NOTIFY OPTIONS
# 1. tv
# 2. telegram
# 3. led
# 4. email
# 5. voice
###############################################################################
notify_firestick:
sequence:
- condition: state
entity_id: input_boolean.firetv_notifications
state: "on"
- condition: template
value_template: "{{ 'tv' in notify_options }}"
- service: notify.android_tv_fire_tv
data:
message: "{{ message }}"
title: Mahasri Bot
data:
color: red
duration: 7
url:
path: "{{ url }}" #/config/www/downloads/camera/driveway/driveway_20220604_185216.jpg
image:
url: "{{ url }}" #/config/www/downloads/camera/driveway/driveway_20220604_185216.jpg
icon:
path: >
/config/www/{{- [ "suresh.jpg", "srinika.jpg", "mallika.jpg", "hasika.jpg",
"bob.jpg", "butters.jpg", "eric.jpg", "gene.jpg", "kyle.jpg", "linda.jpg",
"lois.jpg", "louis.jpg", "meg.jpg", "morty.jpg", "peter.jpg", "quagmire.jpg",
"randy.jpg", "tina.jpg" ] | random -}}
notify_telegram:
sequence:
- condition: state
entity_id: input_boolean.telegram_notifications
state: "on"
- condition: template
value_template: "{{ 'telegram' in notify_options }}"
- service: notify.telegram
data:
message: "{{ message }}"
title: "{{ title }}"
notify_email:
sequence:
- condition: state
entity_id: input_boolean.email_notifications
state: "on"
- condition: template
value_template: "{{ 'email' in notify_options }}"
- service: notify.notify_smtp
data:
title: "{{ title }}"
message: "{{ message }}"
notify_voice:
sequence:
- condition: state
entity_id: input_boolean.voice_notifications
state: "on"
- condition: template
value_template: "{{ 'voice' in notify_options }}"
- service: script.voice_notify
data:
message: "{{ message }}"
notify_on_led_screen:
sequence:
- condition: state
entity_id: input_boolean.led_notifications
state: "on"
- condition: template
value_template: "{{ 'led' in notify_options }}"
- service: mqtt.publish
data:
topic: messageboard/messages
payload: "{{ message }}"
notify_telegram_with_picture:
sequence:
- condition: state
entity_id: input_boolean.telegram_notifications
state: "on"
- condition: template
value_template: "{{ 'telegram' in notify_options }}"
- service: notify.telegram
data:
message: "{{ message }}"
title: "{{ title }}"
data:
photo:
- url: "{{ url }}"
caption: "{{ title }}"
notify_email_with_picture:
sequence:
- condition: state
entity_id: input_boolean.email_notifications
state: "on"
- condition: template
value_template: "{{ 'email' in notify_options }}"
- delay: "00:00:20"
- service: notify.notify_smtp
data:
title: "{{ title }}"
message: "{{ message }}"
data:
images:
- "{{- path -}}"
###############################################################################
# Voice Notify
# Conditions:
# => Only Announce when people are home. Except in emergency mode!
# => Only Announce when Music is NOT being played
###############################################################################
voice_notify:
sequence:
- condition: template
value_template: "{{ states('input_boolean.voice_notifications') == 'on' }}"
- condition: template
value_template: "{{ states('input_boolean.do_not_disturb') | lower == 'off' }}"
- condition: template
value_template: "{{ message | trim != '' }}"
- condition: template
value_template: "{{ states('input_boolean.home_mode_away') == 'off' }}"
- condition: template
value_template: >
{% if only_at_night | default('no', true ) == "yes" %}
{% if states('sun.sun') == "above_horizon" %}
false
{% else %}
true
{% endif %}
{% else %}
true
{% endif %}
- service: media_player.volume_set
entity_id: media_player.living_room, media_player.upstairs
data:
volume_level: >
{% if states('input_boolean.emergency_mode') == "on" %}
{{ states('input_number.tts_volume_level_alert') }}
{% else %}
{% if now().hour | int < 12 and now().hour | int > 6 %}
{{ states('input_number.tts_volume_level_morning') }}
{% elif now().hour|int > 12 and now().hour|int < 20 %}
{{ states('input_number.tts_volume_level_afternoon') }}
{% else %}
{{ states('input_number.tts_volume_level_evening') }}
{% endif %}
{% endif %}
- service: tts.amazon_polly_say
entity_id: media_player.living_room, media_player.upstairs
data:
cache: true
message: >
{% set msg = "" %}
{% macro getGreeting() %}
{% if greeting | default('yes', true ) == "yes" %}
{% if now().hour|int < 12 %}
Good morning.
{% elif now().hour|int < 18 %}
Good afternoon.
{% else %}
Good evening.
{% endif %}
{% endif %}
{% endmacro %}
{%- macro getEndGreeting() -%}
{%- if greeting |default('yes', true ) == "yes" -%}
Thank you!
{%- endif -%}
{%- endmacro -%}
{% set msg = msg + "<speak> " %}
{% set msg = msg + getGreeting() %}
{% set msg = msg + ". " + message %}
{% set msg = msg.replace(".", " <break time='0.5s'/> ") %}
{% set msg = msg + " " + getEndGreeting() %}
{% set msg = msg + " </speak>" %}
{{ msg }}
###############################################################################
# Greeting
###############################################################################
voice_greeting:
sequence:
- service: tts.amazon_polly_say
entity_id: media_player.living_room, media_player.upstairs
data:
cache: true
message: >
{% set msg = "" %}
{% macro getGreeting() %}
{% if greeting | default('yes', true ) == "yes" %}
{% if now().hour|int < 12 %}
Good morning.
{% elif now().hour|int < 18 %}
Good afternoon.
{% else %}
Good evening.
{% endif %}
{% endif %}
{% endmacro %}
{% set msg = msg + "<speak> " %}
{% set msg = msg + " " + getGreeting() %}
{% set msg = msg.replace(".", " <break time='0.5s'/> ") %}
{% set msg = msg + " </speak>" %}
{{ msg }}

View File

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

View File

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

View File

@@ -209,7 +209,7 @@ automation:
entity_id: input_select.trash_pickup_day entity_id: input_select.trash_pickup_day
action: action:
- service: mqtt.publish - service: mqtt.publish
data_template: data:
topic: "/home/trashpickupday" topic: "/home/trashpickupday"
retain: true retain: true
payload: "{{ states.input_select.trash_pickup_day.state }}" payload: "{{ states.input_select.trash_pickup_day.state }}"
@@ -221,7 +221,7 @@ automation:
entity_id: input_select.recycle_pickup_day entity_id: input_select.recycle_pickup_day
action: action:
- service: mqtt.publish - service: mqtt.publish
data_template: data:
topic: "/home/recyclepickupday" topic: "/home/recyclepickupday"
retain: true retain: true
payload: "{{ states.input_select.recycle_pickup_day.state }}" payload: "{{ states.input_select.recycle_pickup_day.state }}"
@@ -233,7 +233,7 @@ automation:
entity_id: input_select.recycle_pickup_week entity_id: input_select.recycle_pickup_week
action: action:
- service: mqtt.publish - service: mqtt.publish
data_template: data:
topic: "/home/recyclepickupweek" topic: "/home/recyclepickupweek"
retain: true retain: true
payload: "{{ states.input_select.recycle_pickup_week.state }}" payload: "{{ states.input_select.recycle_pickup_week.state }}"
@@ -247,15 +247,15 @@ automation:
- delay: - delay:
minutes: 1 minutes: 1
- service: input_select.select_option - service: input_select.select_option
data_template: data:
entity_id: input_select.trash_pickup_day entity_id: input_select.trash_pickup_day
option: "{{states.sensor.trash_pickup_day.state}}" option: "{{states.sensor.trash_pickup_day.state}}"
- service: input_select.select_option - service: input_select.select_option
data_template: data:
entity_id: input_select.recycle_pickup_day entity_id: input_select.recycle_pickup_day
option: "{{states.sensor.recycle_pickup_day.state}}" option: "{{states.sensor.recycle_pickup_day.state}}"
- service: input_select.select_option - service: input_select.select_option
data_template: data:
entity_id: input_select.recycle_pickup_week entity_id: input_select.recycle_pickup_week
option: "{{states.sensor.recycle_pickup_week.state}}" option: "{{states.sensor.recycle_pickup_week.state}}"
@@ -282,7 +282,9 @@ automation:
condition: and condition: and
conditions: conditions:
- condition: template - condition: template
value_template: "{{ states('input_boolean.trash_reminders') == 'on' }}" value_template: "{{ states('input_boolean.trash_alerts') == 'on' }}"
- condition: template
value_template: "{{ states('input_boolean.home_mode_away') == 'off' }}"
- condition: or - condition: or
conditions: conditions:
- condition: state - condition: state
@@ -292,8 +294,8 @@ automation:
entity_id: sensor.recycle_day entity_id: sensor.recycle_day
state: "yes" state: "yes"
action: action:
- service: script.notify_me - service: script.notify_family
data_template: data:
message: > message: >
{% if states.sensor.trash_day.state == "yes" and states.sensor.recycle_day.state == "yes" %} {% if states.sensor.trash_day.state == "yes" and states.sensor.recycle_day.state == "yes" %}
Tomorrow is the Trash AND Recycle Pickup day! Tomorrow is the Trash AND Recycle Pickup day!
@@ -302,36 +304,28 @@ automation:
{% elif states.sensor.recycle_day.state == "yes" %} {% elif states.sensor.recycle_day.state == "yes" %}
Attention!: Tomorrow is the Recycle Pickup day. Please don't forget to put the recycle bin outside tonight! Attention!: Tomorrow is the Recycle Pickup day. Please don't forget to put the recycle bin outside tonight!
{% endif %} {% endif %}
notify_options:
- telegram
- tv
- led
- service: script.voice_notify - alias: Reset Trash Alerts
data_template:
message: >
{% if states.sensor.trash_day.state == "yes" and states.sensor.recycle_day.state == "yes" %}
Attention!: Tomorrow is the Trash and Recycle Pickup day.
Please don't forget to leave Trash bin and recycle bin outside tonight!
{% elif states.sensor.trash_day.state == "yes" %}
Attention!: Tomorrow is the Trash Pickup day. Please don't forget to put the Trash bin outside tonight!
{% elif states.sensor.recycle_day.state == "yes" %}
Attention!: Tomorrow is the Recycle Pickup day. Please don't forget to put the recycle bin outside tonight!
{% endif %}
- alias: Reset Trash Reminders
initial_state: true initial_state: true
trigger: trigger:
- platform: time - platform: time
at: "09:00:00" at: "09:00:00"
action: action:
- service: input_boolean.turn_on - service: input_boolean.turn_on
entity_id: input_boolean.trash_reminders entity_id: input_boolean.trash_alerts
- service: input_select.select_option - service: input_select.select_option
data_template: data:
entity_id: input_select.trash_pickup_day entity_id: input_select.trash_pickup_day
option: "{{states.sensor.trash_pickup_day.state}}" option: "{{states.sensor.trash_pickup_day.state}}"
- service: input_select.select_option - service: input_select.select_option
data_template: data:
entity_id: input_select.recycle_pickup_day entity_id: input_select.recycle_pickup_day
option: "{{states.sensor.recycle_pickup_day.state}}" option: "{{states.sensor.recycle_pickup_day.state}}"
- service: input_select.select_option - service: input_select.select_option
data_template: data:
entity_id: input_select.recycle_pickup_week entity_id: input_select.recycle_pickup_week
option: "{{states.sensor.recycle_pickup_week.state}}" option: "{{states.sensor.recycle_pickup_week.state}}"

View File

@@ -2,7 +2,7 @@
# @author : Mahasri Kalavala # @author : Mahasri Kalavala
# @date : 09/20/2018 # @date : 09/20/2018
# @package : scripts # @package : scripts
# @description : All my scripts are here in one place! # @description : All my scripts are here in one place. Well, not ALL!
################################################################################ ################################################################################
# _____ _ _ # _____ _ _
# / ____| (_) | | # / ____| (_) | |
@@ -79,14 +79,16 @@ script:
sequence: sequence:
- service: script.all_indoor_lights_off - service: script.all_indoor_lights_off
- service: input_boolean.turn_on - service: input_boolean.turn_on
entity_id: input_boolean.notify_camera_alerts entity_id: input_boolean.camera_alerts
- service: alarm_control_panel.alarm_arm_away - service: alarm_control_panel.alarm_arm_away
data: data:
entity_id: alarm_control_panel.home entity_id: alarm_control_panel.home
- service: script.notify_me - service: script.notify_family
data: data:
message: > message: >
No one is at home. Cameras rolling, Indoor lights are OFF. Your home security system is turned ON! No one is at home. Cameras rolling, Indoor lights are OFF. Your home security system is turned ON!
notify_options:
- telegram
############################################################################### ###############################################################################
# The following script runs when no one is home. It excludes some lights # The following script runs when no one is home. It excludes some lights
@@ -95,7 +97,7 @@ script:
all_indoor_lights_off: all_indoor_lights_off:
sequence: sequence:
- service: light.turn_off - service: light.turn_off
data_template: data:
entity_id: entity_id:
- light.family_room_lights - light.family_room_lights
- light.hue_color_lamp_1 - light.hue_color_lamp_1
@@ -106,7 +108,7 @@ script:
- light.master_bedroom_lights - light.master_bedroom_lights
- service: switch.turn_off - service: switch.turn_off
data_template: data:
entity_id: entity_id:
- switch.basement_left - switch.basement_left
- switch.basement_right - switch.basement_right
@@ -148,224 +150,20 @@ script:
rgb_color: [0, 255, 0] rgb_color: [0, 255, 0]
############################################################################### ###############################################################################
# A script that toggles Nest Thermostat between eco/away & non-eco/away modes # Status of the house
###############################################################################
toggle_climate:
sequence:
- service: climate.set_away_mode
data_template:
entity_id: climate.dining_room
away_mode: "{{ false if state_attr('climate.dining_room', 'away_mode') == 'on' else true }}"
###############################################################################
# _ _ _ _ __
# | \ | | | | (_)/ _|
# | \| | ___ | |_ _| |_ _ _
# | . ` |/ _ \| __| | _| | | |
# | |\ | (_) | |_| | | | |_| |
# |_| \_|\___/ \__|_|_| \__, |
# __/ |
# |___/
# Notify Related Scripts
###############################################################################
notify_me_with_picture:
sequence:
- condition: state
entity_id: input_boolean.text_alerts
state: "on"
- condition: template
value_template: '{{- message | trim != "" -}}'
- service: telegram_bot.send_message
data:
title: "{{- title -}}"
message: "{{- message -}}"
data:
photo:
- file: "{{- file -}}"
caption: "{{- caption -}}"
notify_me:
sequence:
- condition: state
entity_id: input_boolean.text_alerts
state: "on"
- condition: template
value_template: '{{ message | trim != "" }}'
- service: telegram_bot.send_message
data:
message: "{{ message }}"
- service: notify.android_tv_fire_tv
data:
message: "{{ message }}"
title: "Hello!"
data:
color: red
good_night_tts:
sequence:
- service: script.voice_notify
data_template:
message: !include ../templates/goodnight.yaml
###############################################################################
# Voice Notify
# Conditions:
# => Only Announce when people are home. Except in emergency mode!
# => Only Announce when Music is NOT being played
###############################################################################
voice_notify:
sequence:
- condition: template
value_template: "{{ states('input_boolean.voice_notifications') == 'on' }}"
- condition: template
value_template: "{{ states('input_boolean.do_not_disturb') | lower == 'off' }}"
- condition: template
value_template: "{{ message | trim != '' }}"
- condition: template
value_template: "{{ states('input_boolean.home_mode_away') == 'off' }}"
- condition: template
value_template: >
{% if only_at_night | default('no', true ) == "yes" %}
{% if states('sun.sun') == "above_horizon" %}
false
{% else %}
true
{% endif %}
{% else %}
true
{% endif %}
- service: media_player.volume_set
entity_id: media_player.living_room, media_player.upstairs
data_template:
volume_level: >
{% if states('input_boolean.emergency_mode') == "on" %}
{{ states('input_number.tts_volume_level_alert') }}
{% else %}
{% if now().hour | int < 12 and now().hour | int > 6 %}
{{ states('input_number.tts_volume_level_morning') }}
{% elif now().hour|int > 12 and now().hour|int < 20 %}
{{ states('input_number.tts_volume_level_afternoon') }}
{% else %}
{{ states('input_number.tts_volume_level_evening') }}
{% endif %}
{% endif %}
- service: tts.amazon_polly_say
entity_id: media_player.living_room, media_player.upstairs
data_template:
cache: true
message: >
{% set msg = "" %}
{% macro getGreeting() %}
{% if greeting | default('yes', true ) == "yes" %}
{% if now().hour|int < 12 %}
Good morning.
{% elif now().hour|int < 18 %}
Good afternoon.
{% else %}
Good evening.
{% endif %}
{% endif %}
{% endmacro %}
{%- macro getEndGreeting() -%}
{%- if greeting |default('yes', true ) == "yes" -%}
Thank you!
{%- endif -%}
{%- endmacro -%}
{% set msg = msg + "<speak> " %}
{% set msg = msg + getGreeting() %}
{% set msg = msg + ". " + message %}
{% set msg = msg.replace(".", " <break time='0.5s'/> ") %}
{% set msg = msg + " " + getEndGreeting() %}
{% set msg = msg + " </speak>" %}
{{ msg }}
###############################################################################
# Greeting
###############################################################################
voice_greeting:
sequence:
- service: tts.amazon_polly_say
entity_id: media_player.living_room, media_player.upstairs
data_template:
cache: true
message: >
{% set msg = "" %}
{% macro getGreeting() %}
{% if greeting | default('yes', true ) == "yes" %}
{% if now().hour|int < 12 %}
Good morning.
{% elif now().hour|int < 18 %}
Good afternoon.
{% else %}
Good evening.
{% endif %}
{% endif %}
{% endmacro %}
{% set msg = msg + "<speak> " %}
{% set msg = msg + " " + getGreeting() %}
{% set msg = msg.replace(".", " <break time='0.5s'/> ") %}
{% set msg = msg + " </speak>" %}
{{ msg }}
###############################################################################
# Status around the house
############################################################################### ###############################################################################
home_status: home_status:
sequence: sequence:
- service: script.voice_notify - service: script.notify_family
data_template: data:
message: !include ../templates/home_status.yaml message: !include ../templates/home_status.yaml
notify_options:
- voice
############################################################################### good_night_tts:
# Display message on LED Matrix Screen
###############################################################################
led_message:
sequence: sequence:
- condition: state - service: script.notify_family
entity_id: input_boolean.led_alerts
state: "on"
- service: mqtt.publish
data_template:
topic: messageboard/messages
payload: "{{ message }}"
###############################################################################
# Notifies to take pills, starts timer again!
# Voice notifications at home - only if the option is selected.
###############################################################################
remind_pill:
sequence:
- service: script.notify_me
data: data:
message: "ALERT: PLEASE TAKE YOUR TABLETS!" message: !include ../templates/goodnight.yaml
- service: timer.start notify_options:
entity_id: timer.timer_pill_reminder - voice
- condition: template
value_template: "{{ states('input_boolean.pill_voice_notification') == 'on' }}"
- service: script.voice_notify
data_template:
message: >
Please take the tablets. It looks like you have forgotten to take today's
dose of tablets... Once again, this is a reminder for you to take the tablets.
###############################################################################
# Stops timer, Records that the pills are taken, and notifies!
###############################################################################
pill_taken:
sequence:
- service: timer.cancel
entity_id: timer.timer_pill_reminder
- service: input_boolean.turn_on
entity_id: input_boolean.pill_taken
- service: script.notify_me
data_template:
message: >
Thank you for taking tablets.
{%- if state_attr('sensor.allergy_index_today', 'rating') != None %}
{{- " Today's pollen level is : " ~ state_attr('sensor.allergy_index_today', 'rating') }}.
{%- endif -%}
- condition: template
value_template: "{{ states('input_boolean.pill_voice_notification') == 'on' }}"
- service: script.voice_notify
data:
message: "Thank you for taking tablets on time!"

View File

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

View File

@@ -116,7 +116,7 @@ input_number:
step: 5 step: 5
mode: box mode: box
######################### CLOSET LIGHTS ######################### CLOSET LIGHTS
hasika_bedroom_closet_lights: hasika_bedroom_closet_lights:
name: Hasika Closet Lights Duration name: Hasika Closet Lights Duration
min: 5 min: 5
@@ -194,19 +194,11 @@ sensor:
############################################################################### ###############################################################################
input_boolean: input_boolean:
voice_notifications:
name: Home Assistant Announcements
icon: mdi:volume-off
do_not_disturb: do_not_disturb:
name: Do Not Disturb name: Do Not Disturb
initial: off initial: off
icon: mdi:do-not-disturb icon: mdi:do-not-disturb
led_alerts:
name: LED Messages
icon: mdi:led-strip
movie_time: movie_time:
name: "Movie Time" name: "Movie Time"
icon: mdi:movie-roll icon: mdi:movie-roll
@@ -239,30 +231,34 @@ input_boolean:
name: Nightly Report name: Nightly Report
icon: mdi:file-chart icon: mdi:file-chart
notify_camera_alerts:
name: Notify Camera Alerts
icon: mdi:camera
trash_reminders:
name: Remind Trash Notifications
icon: mdi:recycle
enjoyable_weather_reminders: enjoyable_weather_reminders:
name: Remind me to enjoy Good Weather name: Remind me to enjoy Good Weather
icon: mdi:weather-sunny icon: mdi:weather-sunny
security_system_alerts: security_system_alerts:
name: Notify Security System Status Change name: Security System Alerts
icon: mdi:verified icon: mdi:security
trash_alerts:
name: Trash Alerts
icon: mdi:recycle
garage_door_notifications:
name: Garage Door Alerts
icon: mdi:garage
zone_alerts: zone_alerts:
name: Zone Alerts name: Zone Alerts
icon: mdi:map-marker icon: mdi:map-marker
battery_notifications: battery_alerts:
name: Battery Notifications name: Battery Alerts
icon: mdi:battery icon: mdi:battery
camera_alerts:
name: Camera Alerts
icon: mdi:camera
dummy: dummy:
name: "Dummy Input Boolean!" name: "Dummy Input Boolean!"
icon: mdi:sticker-emoji icon: mdi:sticker-emoji
@@ -272,13 +268,26 @@ input_boolean:
name: Light Automations name: Light Automations
icon: mdi:lightbulb-on icon: mdi:lightbulb-on
text_alerts: # Notifications
name: Text Alerts telegram_notifications:
icon: mdi:map-marker name: Telegram Notifications
icon: mdi:message
garage_door_notifications: firetv_notifications:
name: Garage Door Notifications name: FireTV Notifications
icon: mdi:garage icon: mdi:television
email_notifications:
name: Email Notifications
icon: mdi:email
voice_notifications:
name: Voice Notifications
icon: mdi:volume-off
led_notifications:
name: LED Notifications
icon: mdi:led-strip
############################################################################### ###############################################################################
# _ _ _ # _ _ _
@@ -331,9 +340,11 @@ automation:
- platform: state - platform: state
entity_id: input_boolean.do_not_disturb entity_id: input_boolean.do_not_disturb
action: action:
- service: script.notify_me - service: script.notify_family
data_template: data:
message: "The Do Not Disturb Mode is {{ trigger.to_state.state |upper }}." message: "The Do Not Disturb Mode is {{ trigger.to_state.state |upper }}."
notify_options:
- led
# Hourly Reports # Hourly Reports
###################################################### ######################################################

View File

@@ -1,23 +1,23 @@
homeassistant: homeassistant:
automation: automation:
# this automation runs every day at 9:00 AM, 12 PM, 5PM, and at 10:00 PM # this automation runs every day at 9:00 AM, 12 PM, 5PM, and at 10:00 PM
# and sends an email - only when we are away from the house. # and sends an email - only when we are away from the house.
- alias: Notify Home Status When Away - alias: Notify Home Status When Away
trigger: trigger:
- platform: time - platform: time
at: '09:00:00' at: "09:00:00"
- platform: time - platform: time
at: '12:00:00' at: "12:00:00"
- platform: time - platform: time
at: '17:00:00' at: "17:00:00"
- platform: time - platform: time
at: '10:00:00' at: "10:00:00"
condition: condition:
- condition: template - condition: template
value_template: "{{ states('input_boolean.home_mode_away') == 'on' }}" value_template: "{{ states('input_boolean.home_mode_away') == 'on' }}"
action: action:
- service: notify.notify_smtp - service: notify.notify_smtp
data_template: data:
title: 'Home Status {{ now().strftime("%d %h %Y, %I:%M:%S %p") }}' title: 'Home Status {{ now().strftime("%d %h %Y, %I:%M:%S %p") }}'
message: !include ../templates/away_status.yaml message: !include ../templates/away_status.yaml

View File

@@ -47,7 +47,7 @@
# {% endif %} # {% endif %}
# - delay: '00:00:01' # - delay: '00:00:01'
# - service: script.light_set_color # - service: script.light_set_color
# data_template: # data:
# entity_id: >- # entity_id: >-
# {%- macro get_next_entity_id() -%} # {%- macro get_next_entity_id() -%}
# {%- for item in states.group.input_labels.attributes.entity_id if is_state(item, "no") -%} # {%- for item in states.group.input_labels.attributes.entity_id if is_state(item, "no") -%}
@@ -72,12 +72,12 @@
# - condition: template # - condition: template
# value_template: '{{ brightness | trim != "" }}' # value_template: '{{ brightness | trim != "" }}'
# - service: light.turn_on # - service: light.turn_on
# data_template: # data:
# entity_id: '{{ entity_id }}' # entity_id: '{{ entity_id }}'
# brightness: '{{ brightness }}' # brightness: '{{ brightness }}'
# rgb_color: ['{{"{0:d}".format(range(210, 238)|random)|int}}', '{{"{0:d}".format(range(210, 238)|random)|int}}', '{{"{0:d}".format(range(210, 238)|random)|int}}'] # rgb_color: ['{{"{0:d}".format(range(210, 238)|random)|int}}', '{{"{0:d}".format(range(210, 238)|random)|int}}', '{{"{0:d}".format(range(210, 238)|random)|int}}']
# - service: input_label.set_value # - service: input_label.set_value
# data_template: # data:
# entity_id: "input_label.{{- entity_id.split('.')[1] -}}_random_color" # entity_id: "input_label.{{- entity_id.split('.')[1] -}}_random_color"
# value: 'yes' # value: 'yes'
# - delay: '00:00:01' # - delay: '00:00:01'
@@ -102,7 +102,7 @@
# event_type: my_test_event # event_type: my_test_event
# action: # action:
# - service: script.notify_me # - service: script.notify_me
# data_template: # data:
# message: "Test Event Captured with data foo: {{ trigger.event.data.foo }}" # message: "Test Event Captured with data foo: {{ trigger.event.data.foo }}"
######################################################################################################### #########################################################################################################
@@ -122,7 +122,7 @@
# - binary_sensor.den_motion # - binary_sensor.den_motion
# action: # action:
# - service_template: 'switch.turn_{{ trigger.to_state.state }}' # - service_template: 'switch.turn_{{ trigger.to_state.state }}'
# data_template: # data:
# entity_id: '{{ trigger.entity_id.replace("binary_sensor", "group") }}' # entity_id: '{{ trigger.entity_id.replace("binary_sensor", "group") }}'
######################################################################################################### #########################################################################################################
@@ -142,7 +142,7 @@
# before: '02:00:00' # before: '02:00:00'
# action: # action:
# - service_template: scene.turn_on # - service_template: scene.turn_on
# data_template: # data:
# entity_id: >- # entity_id: >-
# {%set elevation = states.sun.sun.attributes.elevation | int %} # {%set elevation = states.sun.sun.attributes.elevation | int %}
# {% if elevation > -10 and elevation | int < 5 %} # {% if elevation > -10 and elevation | int < 5 %}
@@ -194,7 +194,7 @@
# seconds: 30 # seconds: 30
# action: # action:
# - service: mqtt.publish # - service: mqtt.publish
# data_template: # data:
# payload: '{"state": "open"}' # payload: '{"state": "open"}'
# topic: >- # topic: >-
# {% set mapping = '{ "hallway": "985335", "livingroom": "854267", "kitchen": "699555" }' %} # {% set mapping = '{ "hallway": "985335", "livingroom": "854267", "kitchen": "699555" }' %}
@@ -220,7 +220,7 @@
# test_script: # test_script:
# sequence: # sequence:
# - service_template: light.turn_on # - service_template: light.turn_on
# data_template: # data:
# entity_id: > # entity_id: >
# {% for e in entities_list %} # {% for e in entities_list %}
# {%- if loop.first %}{% elif loop.last %}, {% else %}, {% endif -%} # {%- if loop.first %}{% elif loop.last %}, {% else %}, {% endif -%}
@@ -295,7 +295,7 @@
# alias: Text to Enter on Remote # alias: Text to Enter on Remote
# sequence: # sequence:
# - service_template: script.text_loop # - service_template: script.text_loop
# data_template: # data:
# text: "Netflix" # text: "Netflix"
# text_loop: # text_loop:
@@ -304,7 +304,7 @@
# - condition: template # - condition: template
# value_template: "{{ 'true' if (states.input_number.text_index.state |int < text|length | int) else 'false' }}" # value_template: "{{ 'true' if (states.input_number.text_index.state |int < text|length | int) else 'false' }}"
# - service_template: script.key_input # - service_template: script.key_input
# data_template: # data:
# command: >- # command: >-
# {%- set index = states.input_number.text_index.state | int -%} # {%- set index = states.input_number.text_index.state | int -%}
# {{ text[index:index+1] }} # {{ text[index:index+1] }}
@@ -314,16 +314,16 @@
# alias: Send Key Input # alias: Send Key Input
# sequence: # sequence:
# - service: media_player.firetv_adb_shell # - service: media_player.firetv_adb_shell
# data_template: # data:
# entity_id: media_player.televisione_camera # entity_id: media_player.televisione_camera
# cmd: "input keyevent {{ command | upper }}" # cmd: "input keyevent {{ command | upper }}"
# - delay: '00:00:01' # - delay: '00:00:01'
# - service: input_number.set_value # - service: input_number.set_value
# data_template: # data:
# entity_id: input_number.text_index # entity_id: input_number.text_index
# value: "{{ (states.input_number.text_index.state | int + 1) }}" # value: "{{ (states.input_number.text_index.state | int + 1) }}"
# - service: script.text_loop # - service: script.text_loop
# data_template: # data:
# text: "{{ text }}" # text: "{{ text }}"
######################################################################################################### #########################################################################################################
@@ -341,7 +341,7 @@
# {{ ns.lowBattery }} # {{ ns.lowBattery }}
# action: # action:
# - service: script.voice_notify # - service: script.voice_notify
# data_template: # data:
# message: > # message: >
# {% set ns = namespace(lowBattery) %} # {% set ns = namespace(lowBattery) %}
# {%- for x in states if x.attributes and x.attributes.battery_level and x.attributes.battery_level |int <= 24 %} # {%- for x in states if x.attributes and x.attributes.battery_level and x.attributes.battery_level |int <= 24 %}
@@ -367,11 +367,11 @@
# alias: Run X Times # alias: Run X Times
# sequence: # sequence:
# - service: input_number.set_value # - service: input_number.set_value
# data_template: # data:
# entity_id: input_number.loop_index # entity_id: input_number.loop_index
# value: 0 # value: 0
# - service_template: script.loop_one # - service_template: script.loop_one
# data_template: # data:
# count: "{{ count }}" # count: "{{ count }}"
# loop_one: # loop_one:
@@ -380,13 +380,13 @@
# - condition: template # - condition: template
# value_template: "{{ 'true' if (states.input_number.loop_index.state |int < count | int) else 'false' }}" # value_template: "{{ 'true' if (states.input_number.loop_index.state |int < count | int) else 'false' }}"
# - service: mqtt.publish # - service: mqtt.publish
# data_template: # data:
# topic: "/loop/test" # topic: "/loop/test"
# payload: "{{ states.input_number.loop_index.state | int }}" # payload: "{{ states.input_number.loop_index.state | int }}"
# retain: false # retain: false
# - delay: '00:00:00' # - delay: '00:00:00'
# - service: script.loop_two # - service: script.loop_two
# data_template: # data:
# count: "{{ count |int}}" # count: "{{ count |int}}"
# loop_two: # loop_two:
@@ -394,11 +394,11 @@
# sequence: # sequence:
# - delay: '00:00:00' # - delay: '00:00:00'
# - service: input_number.set_value # - service: input_number.set_value
# data_template: # data:
# entity_id: input_number.loop_index # entity_id: input_number.loop_index
# value: "{{ (states.input_number.loop_index.state | int + 1) |int }}" # value: "{{ (states.input_number.loop_index.state | int + 1) |int }}"
# - service: script.loop_one # - service: script.loop_one
# data_template: # data:
# count: "{{ count|int }}" # count: "{{ count|int }}"
####################################################################### #######################################################################
@@ -781,7 +781,7 @@
# # topic: "robotic_mower/control/mode" # # topic: "robotic_mower/control/mode"
# # action: # # action:
# # - service: input_select.select_option # # - service: input_select.select_option
# # data_template: # # data:
# # entity_id: input_select.bob_command # # entity_id: input_select.bob_command
# # option: "{{ trigger.payload }}" # # option: "{{ trigger.payload }}"
@@ -794,7 +794,7 @@
# to: 'Front Collision' # to: 'Front Collision'
# action: # action:
# - service: notify.leandro # - service: notify.leandro
# data_template: # data:
# message: "Robotgräsklippare har kolliderat" # message: "Robotgräsklippare har kolliderat"
# data: # data:
# priority: '1' # priority: '1'
@@ -807,7 +807,7 @@
# data: # data:
# volume_level: '0.7' # volume_level: '0.7'
# - service: notify.alexa_media # - service: notify.alexa_media
# data_template: # data:
# data: # data:
# type: announce # type: announce
# method: speak # method: speak
@@ -1003,7 +1003,7 @@
# alias: Push Ecobee target temp to the other thermostats # alias: Push Ecobee target temp to the other thermostats
# sequence: # sequence:
# - service: climate.set_temperature # - service: climate.set_temperature
# data_template: # data:
# entity_id: climate.cooler_fan # entity_id: climate.cooler_fan
# temperature: "{{ states.climate.main_floor.temperature |float }}" # temperature: "{{ states.climate.main_floor.temperature |float }}"
@@ -1045,14 +1045,14 @@
# - service: input_boolean.toggle # - service: input_boolean.toggle
# entity_id: input_boolean.dummy # entity_id: input_boolean.dummy
# - service: camera.record # - service: camera.record
# data_template: # data:
# entity_id: camera.fremme # entity_id: camera.fremme
# filename: "/tmp/{{- trigger.entity_id.split('.')[1].split('_')[1] -}}_{{- states.input_boolean.dummy_fremme.last_updated.strftime('%Y%m%d-%H%M%S') -}}.mp4" # filename: "/tmp/{{- trigger.entity_id.split('.')[1].split('_')[1] -}}_{{- states.input_boolean.dummy_fremme.last_updated.strftime('%Y%m%d-%H%M%S') -}}.mp4"
# duration: 20 # duration: 20
# lookback: 10 # lookback: 10
# - delay: "00:00:20" # - delay: "00:00:20"
# - service: notify.eirikz_telegram # - service: notify.eirikz_telegram
# data_template: # data:
# title: "Doods" # title: "Doods"
# message: "fremme" # message: "fremme"
# data: # data:
@@ -1081,16 +1081,15 @@
# - service: input_boolean.toggle # - service: input_boolean.toggle
# entity_id: input_boolean.dummy # entity_id: input_boolean.dummy
# - service: input_label.set_value # - service: input_label.set_value
# data_template: # data:
# entity_id: "input_label.file_1" # entity_id: "input_label.file_1"
# value: "/tmp/{{- trigger.entity_id.split('.')[1] -}}_{{- states.input_boolean.dummy.last_updated.strftime('%Y%m%d-%H%M%S') -}}.mp4" # value: "/tmp/{{- trigger.entity_id.split('.')[1] -}}_{{- states.input_boolean.dummy.last_updated.strftime('%Y%m%d-%H%M%S') -}}.mp4"
# - delay: "00:00:05" # - delay: "00:00:05"
# - service: input_label.set_value # - service: input_label.set_value
# data_template: # data:
# entity_id: "input_label.file_2" # entity_id: "input_label.file_2"
# value: "/tmp/{{- trigger.entity_id.split('.')[1] -}}_{{- states.input_boolean.dummy.last_updated.strftime('%Y%m%d-%H%M%S') -}}.mp4" # value: "/tmp/{{- trigger.entity_id.split('.')[1] -}}_{{- states.input_boolean.dummy.last_updated.strftime('%Y%m%d-%H%M%S') -}}.mp4"
# {% for x in states if 'sensor.illumination_' in x.entity_id %} # {% for x in states if 'sensor.illumination_' in x.entity_id %}
# {{ x.name}} - {{ x.attributes.battery_level }} # {{ x.name}} - {{ x.attributes.battery_level }}
# {%- endfor %} # {%- endfor %}

View File

@@ -44,6 +44,6 @@ automation:
entity_id: input_text.tts entity_id: input_text.tts
action: action:
- service: script.voice_notify - service: script.voice_notify
data_template: data:
message: "{{ trigger.to_state.state }}" message: "{{ trigger.to_state.state }}"
greeting: "{{ 'yes' if states('input_boolean.greeting') == 'on' else 'no' }}" greeting: "{{ 'yes' if states('input_boolean.greeting') == 'on' else 'no' }}"

View File

@@ -22,7 +22,6 @@ binary_sensor:
# #
############################################################################### ###############################################################################
automation: automation:
- alias: TV Status ON - alias: TV Status ON
initial_state: true initial_state: true
trigger: trigger:
@@ -31,7 +30,7 @@ automation:
to: "on" to: "on"
action: action:
- service: mqtt.publish - service: mqtt.publish
data_template: data:
topic: "/home/sharptv" topic: "/home/sharptv"
payload: "on" payload: "on"
retain: true retain: true
@@ -44,12 +43,11 @@ automation:
to: "unavailable" to: "unavailable"
action: action:
- service: mqtt.publish - service: mqtt.publish
data_template: data:
topic: "/home/sharptv" topic: "/home/sharptv"
payload: "off" payload: "off"
retain: true retain: true
# Dim Family Room Lights When TV is Turned ON # Dim Family Room Lights When TV is Turned ON
############################################################################### ###############################################################################
- alias: TV Dim Indoor Lights when TV is ON - alias: TV Dim Indoor Lights when TV is ON

View File

@@ -32,9 +32,12 @@ automation:
entity_id: input_boolean.light_automations entity_id: input_boolean.light_automations
state: "on" state: "on"
action: action:
- service: script.notify_me - service: script.notify_family
data: data:
message: "It has been two hours, are you still working in the garage? Changing the status to 'Not working'!" message: "It has been two hours, are you still working in the garage?"
notify_options:
- telegram
- tv
- service: input_boolean.turn_off - service: input_boolean.turn_off
entity_id: input_boolean.working_in_garage entity_id: input_boolean.working_in_garage
@@ -57,22 +60,19 @@ automation:
state: "off" state: "off"
- condition: template - condition: template
value_template: "{{ states('input_boolean.garage_door_notifications') == 'on' }}" value_template: "{{ states('input_boolean.garage_door_notifications') == 'on' }}"
- condition: state # - condition: state
entity_id: input_boolean.light_automations # entity_id: input_boolean.light_automations
state: "on" # state: "on"
action: action:
- service: script.notify_me - service: script.notify_family
data_template: data:
message: >
Your {{ trigger.to_state.attributes.friendly_name }} is OPEN for more than 5 minutes!
- service: script.voice_notify
data_template:
message: >
Attention! Your {{ trigger.to_state.attributes.friendly_name }} is open for more than 5 minutes.
- service: script.led_message
data_template:
message: > message: >
Your {{ trigger.to_state.attributes.friendly_name }} is OPEN for more than 5 minutes! Your {{ trigger.to_state.attributes.friendly_name }} is OPEN for more than 5 minutes!
notify_options:
- telegram
- voice
- tv
- led
# Outdoor Lights: # Outdoor Lights:
# Keeps and eye on the patio and backyard lights... # Keeps and eye on the patio and backyard lights...
@@ -96,12 +96,16 @@ automation:
state: "on" state: "on"
action: action:
- service: switch.turn_off - service: switch.turn_off
data_template: data:
entity_id: "{{ trigger.entity_id }}" entity_id: "{{ trigger.entity_id }}"
- service: script.notify_me - service: script.notify_family
data_template: data:
message: > message: >
{{ trigger.to_state.attributes.friendly_name }} is ON during the day time. Saving power by turning it off! {{ trigger.to_state.attributes.friendly_name }} is ON during the day time. Saving power by turning it off!
notify_options:
- telegram
- tv
- led
# General Watch Dog automation: # General Watch Dog automation:
# Keeps and eye on the lights & switches, turns off after 10 PM if they are on. # Keeps and eye on the lights & switches, turns off after 10 PM if they are on.
@@ -136,7 +140,7 @@ automation:
state: "on" state: "on"
action: action:
- service: homeassistant.turn_off - service: homeassistant.turn_off
data_template: data:
entity_id: "{{ trigger.entity_id }}" entity_id: "{{ trigger.entity_id }}"
- alias: Guest Bathroom Lights WatchDog - alias: Guest Bathroom Lights WatchDog
@@ -154,7 +158,7 @@ automation:
state: "on" state: "on"
action: action:
- service: homeassistant.turn_off - service: homeassistant.turn_off
data_template: data:
entity_id: "{{ trigger.entity_id }}" entity_id: "{{ trigger.entity_id }}"
- alias: Master Bathroom Lights WatchDog - alias: Master Bathroom Lights WatchDog
@@ -172,7 +176,7 @@ automation:
state: "on" state: "on"
action: action:
- service: homeassistant.turn_off - service: homeassistant.turn_off
data_template: data:
entity_id: "{{ trigger.entity_id }}" entity_id: "{{ trigger.entity_id }}"
- alias: Garage Lights WatchDog - alias: Garage Lights WatchDog
@@ -190,7 +194,7 @@ automation:
state: "on" state: "on"
action: action:
- service: homeassistant.turn_off - service: homeassistant.turn_off
data_template: data:
entity_id: "{{ trigger.entity_id }}" entity_id: "{{ trigger.entity_id }}"
- alias: Garage Shop Lights WatchDog - alias: Garage Shop Lights WatchDog
@@ -208,7 +212,7 @@ automation:
state: "on" state: "on"
action: action:
- service: homeassistant.turn_off - service: homeassistant.turn_off
data_template: data:
entity_id: "{{ trigger.entity_id }}" entity_id: "{{ trigger.entity_id }}"
- alias: Guest Bathroom Exhaust WatchDog - alias: Guest Bathroom Exhaust WatchDog
@@ -226,7 +230,7 @@ automation:
state: "on" state: "on"
action: action:
- service: homeassistant.turn_off - service: homeassistant.turn_off
data_template: data:
entity_id: "{{ trigger.entity_id }}" entity_id: "{{ trigger.entity_id }}"
- alias: Master Bathroom Shower Exhaust WatchDog - alias: Master Bathroom Shower Exhaust WatchDog
@@ -244,7 +248,7 @@ automation:
state: "on" state: "on"
action: action:
- service: homeassistant.turn_off - service: homeassistant.turn_off
data_template: data:
entity_id: "{{ trigger.entity_id }}" entity_id: "{{ trigger.entity_id }}"
- alias: Master Bathroom Toilet Exhaust WatchDog - alias: Master Bathroom Toilet Exhaust WatchDog
@@ -262,13 +266,12 @@ automation:
state: "on" state: "on"
action: action:
- service: homeassistant.turn_off - service: homeassistant.turn_off
data_template: data:
entity_id: "{{ trigger.entity_id }}" entity_id: "{{ trigger.entity_id }}"
#############################################################################
############################################################################# # CLOSET LIGHTS WATCH DOG
# CLOSET LIGHTS WATCH DOG #############################################################################
#############################################################################
- alias: Srinika Bedroom Closet WatchDog - alias: Srinika Bedroom Closet WatchDog
initial_state: true initial_state: true
@@ -285,7 +288,7 @@ automation:
state: "on" state: "on"
action: action:
- service: homeassistant.turn_off - service: homeassistant.turn_off
data_template: data:
entity_id: "{{ trigger.entity_id }}" entity_id: "{{ trigger.entity_id }}"
- alias: Hasika Bedroom Closet WatchDog - alias: Hasika Bedroom Closet WatchDog
@@ -303,116 +306,5 @@ automation:
state: "on" state: "on"
action: action:
- service: homeassistant.turn_off - service: homeassistant.turn_off
data_template: data:
entity_id: "{{ trigger.entity_id }}" entity_id: "{{ trigger.entity_id }}"
- alias: Notify Plex User Status
initial_state: true
trigger:
# - platform: numeric_state
# entity_id: sensor.plex_mahasri_nas
# above: 0
# for:
# minutes: 2
- platform: state
entity_id:
- media_player.plex_adi_bh_plex_for_roku_roku3
- media_player.plex_adi_bh_plex_for_roku_rokuultra
- media_player.plex_prade5_plex_for_roku_roku_express
to: 'playing'
for:
minutes: 2
action:
- service: script.notify_me
data_template:
message: >-
{%- set tag_map = {'adi.bh':'Adi', 'prade5':'Pradeep'} -%}
{% for item in states.media_player if item.state == 'playing' and state_attr(item.entity_id, 'media_title') != None
and state_attr(item.entity_id, 'username') != 'kalavala'
and tag_map[state_attr(item.entity_id, 'username')] |trim != '' %}
{{ tag_map[state_attr(item.entity_id, 'username')] }} is watching {% if state_attr(item.entity_id, 'media_content_type') == "movie" -%}
{{ "a movie, " + state_attr(item.entity_id, 'media_title') |title }}
{% endif %}
{%- if state_attr(item.entity_id, 'media_content_type') == "tvshow" %}
TV Show - {{ state_attr(item.entity_id, 'media_series_title') }}
Season: {{ state_attr(item.entity_id, 'media_season') }}, Episode: {{ state_attr(item.entity_id, 'media_episode') }} ({{ state_attr(item.entity_id, 'media_title') }})
{% endif %}
{% endfor %}
# - alias: Lights And Switches WatchDog 10 Min
# initial_state: true
# trigger:
# - platform: state
# entity_id:
# - switch.guest_bathroom_exhaust
# - switch.master_bathroom_toilet_exhaust
# to: "on"
# for:
# minutes: 10
# condition:
# - condition: state
# entity_id: input_boolean.light_automations
# state: "on"
# action:
# - service: homeassistant.turn_off
# data_template:
# entity_id: "{{ trigger.entity_id }}"
#
# Main master Bathoom has more CFM to vent out... keep it for 20 minutes
#
# - alias: Lights And Switches WatchDog 20 Min
# initial_state: true
# trigger:
# - platform: state
# entity_id:
# - switch.master_bathroom_shower_exhaust
# to: "on"
# for:
# minutes: 20
# condition:
# - condition: state
# entity_id: input_boolean.light_automations
# state: "on"
# action:
# - service: homeassistant.turn_off
# data_template:
# entity_id: "{{ trigger.entity_id }}"
# - alias: Lights And Switches WatchDog 30 Min
# initial_state: true
# trigger:
# - platform: state
# entity_id:
# - switch.guest_bathroom_lights
# - switch.master_bathroom_toilet_light
# to: "on"
# for:
# minutes: 30
# condition:
# - condition: state
# entity_id: input_boolean.light_automations
# state: "on"
# action:
# - service: homeassistant.turn_off
# data_template:
# entity_id: "{{ trigger.entity_id }}"
# - alias: Lights And Switches WatchDog 45 Min
# initial_state: true
# trigger:
# - platform: state
# entity_id:
# - switch.garage_shop_lights
# to: "on"
# for:
# minutes: 45
# condition:
# - condition: state
# entity_id: input_boolean.light_automations
# state: "on"
# action:
# - service: homeassistant.turn_off
# data_template:
# entity_id: "{{ trigger.entity_id }}"

View File

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

View File

@@ -92,7 +92,7 @@ automation:
state: "on" state: "on"
action: action:
- service: light.turn_on - service: light.turn_on
data_template: data:
entity_id: light.hue_color_lamp_1, light.hue_color_lamp_2, light.hue_color_lamp_3 entity_id: light.hue_color_lamp_1, light.hue_color_lamp_2, light.hue_color_lamp_3
rgb_color: rgb_color:
- "{{ range(0,255) |random }}" - "{{ range(0,255) |random }}"
@@ -370,14 +370,14 @@ automation:
state: "on" state: "on"
action: action:
- service: light.turn_on - service: light.turn_on
data_template: data:
entity_id: light.master_bedroom_1 entity_id: light.master_bedroom_1
rgb_color: rgb_color:
- "{{ range(0,255) |random }}" - "{{ range(0,255) |random }}"
- "{{ range(0,255) |random }}" - "{{ range(0,255) |random }}"
- "{{ range(0,255) |random }}" - "{{ range(0,255) |random }}"
- service: light.turn_on - service: light.turn_on
data_template: data:
entity_id: light.master_bedroom_2 entity_id: light.master_bedroom_2
rgb_color: rgb_color:
- "{{ range(0,255) |random }}" - "{{ range(0,255) |random }}"
@@ -473,25 +473,30 @@ script:
doorbell_camera_pics: doorbell_camera_pics:
sequence: sequence:
- service: script.notify_me - service: script.notify_family
data: data:
message: "ALERT! Someone is at the front door!" message: "ALERT! Someone is at the front door!"
notify_options:
- telegram
- voice
- tv
- led
- service: camera.snapshot - service: camera.snapshot
data_template: data:
entity_id: "camera.frontdoor_camera" entity_id: "camera.frontdoor_camera"
filename: filename:
"{{ '/config/www/downloads/camera/frontdoor/frontdoor_' ~ "{{ '/config/www/downloads/camera/frontdoor/frontdoor_' ~
(state_attr('script.doorbell_camera_pics', 'last_triggered') ~ '').replace('-','_') (state_attr('script.doorbell_camera_pics', 'last_triggered') ~ '').replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}" .replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- service: camera.snapshot - service: camera.snapshot
data_template: data:
entity_id: "camera.driveway_camera" entity_id: "camera.driveway_camera"
filename: filename:
"{{ '/config/www/downloads/camera/driveway/driveway_' ~ "{{ '/config/www/downloads/camera/driveway/driveway_' ~
(state_attr('script.doorbell_camera_pics', 'last_triggered') ~ '').replace('-','_') (state_attr('script.doorbell_camera_pics', 'last_triggered') ~ '').replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}" .replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- service: notify.telegram - service: notify.telegram
data_template: data:
title: "Door Bell" title: "Door Bell"
message: "Someone rang door bell!" message: "Someone rang door bell!"
data: data:
@@ -504,3 +509,12 @@ script:
(state_attr('script.doorbell_camera_pics', 'last_triggered') ~ '').replace('-','_') (state_attr('script.doorbell_camera_pics', 'last_triggered') ~ '').replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}" .replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
caption: "Someone rang door bell!" caption: "Someone rang door bell!"
- service: script.notify_family
data:
message: Someone rang door bell!
url: "{{ '/config/www/downloads/camera/frontdoor/frontdoor_' ~
(state_attr('script.doorbell_camera_pics', 'last_triggered') ~ '').replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
notify_options:
- tv
- led

View File

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

View File

@@ -47,7 +47,7 @@ except Exception as ex:
value_template: "{{ trigger.event.data.new_state.attributes.battery_level | default(999) | int != 999 }}" value_template: "{{ trigger.event.data.new_state.attributes.battery_level | default(999) | int != 999 }}"
action: action:
- service: python_script.batteries - service: python_script.batteries
data_template: data:
entity_id: "input_label.{{- trigger.event.data.entity_id.split('.')[1] -}}" entity_id: "input_label.{{- trigger.event.data.entity_id.split('.')[1] -}}"
battery_value: '{{ trigger.event.data.new_state.attributes.battery_level }}' battery_value: '{{ trigger.event.data.new_state.attributes.battery_level }}'
""" """

View File

@@ -0,0 +1,69 @@
http:
routers:
catchall:
# attached only to web entryPoint
entryPoints:
- "web"
# catchall rule
rule: "PathPrefix(`/`)"
service: unavailable
# lowest possible priority
# evaluated when no other router is matched
priority: 1
to-dashboard:
rule: "Host(`subdomain.domain.com`)"
service: api@internal
to-music:
rule: "Host(`subdomain.domain.com`)"
entrypoints: web
service: airsonic
to-frigate:
rule: "Host(`subdomain.domain.com`)"
entrypoints: web
service: frigate
to-portainer:
rule: "Host(`subdomain.domain.com`)"
entrypoints: web
service: portainer
to-plex:
rule: "Host(`subdomain.domain.com`)"
entrypoints: web
service: plex
# middlewares:
# https-redirect:
# redirectScheme:
# scheme: https
services:
# Service that will always answer a 503 Service Unavailable response
unavailable:
loadBalancer:
servers: {}
airsonic:
loadBalancer:
servers:
- url: http://192.168.x.x:xxx
frigate:
loadBalancer:
servers:
- url: http://192.168.x.x:xxx
portainer:
loadBalancer:
servers:
- url: http://192.168.x.x:xxx
plex:
loadBalancer:
servers:
- url: http://192.168.x.x:xxx
providers:
docker:
exposedByDefault: false

View File

@@ -0,0 +1,22 @@
global:
# Send anonymous usage data
sendAnonymousUsage: false
api:
dashboard: false
insecure: true
# ping: {}
entryPoints:
web:
address: :80
traefik:
address: :8080
providers:
docker:
exposedByDefault: false
file:
directory: /config
watch: true