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:
- /home/suresh/docker/mqtt/data:/mosquitto/data
- /home/suresh/docker/mqtt/config:/mosquitto/config
- /home/suresh/docker/mqtt/log:/mosquitto/log
##################################################################################
# _ _
# | | | |
# __| | ___ ___| | _____ _ __ ___ ___ _ __ ___ _ __ ___ ___ ___
# / _` |/ _ \ / __| |/ / _ \ '__| / __/ _ \| '_ ` _ \| '_ \ / _ \/ __|/ _ \
# | (_| | (_) | (__| < __/ | | (_| (_) | | | | | | |_) | (_) \__ \ __/
# \__,_|\___/ \___|_|\_\___|_| \___\___/|_| |_| |_| .__/ \___/|___/\___|
# | |
# |_|
##################################################################################
version: "3.0"
home-assistant:
image: homeassistant/home-assistant:latest
container_name: "home_assistant"
services:
##################################################################################
# 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
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:
- /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:
- 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:
- "8123:8123"
volumes:
- /home/homeassistant/.homeassistant/:/config
- ${PORT_DOCKER_MON}:${PORT_DOCKER_MON}
healthcheck:
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
container_name: "homebridge_docker"
restart: always
network_mode: host
##################################################################################
# Camera Streamer (RTSP to HLS Streaming for Chromecasts)
##################################################################################
streamer:
container_name: streamer
image: skalavala/streamer
restart: unless-stopped
environment:
- TZ=America/New_York
- PGID=1000
- PUID=1000
- PARAMETERS=${STREAMER_PARAMETERS}
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:
- 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:
image: influxdb:latest
container_name: influxdb
restart: always
network_mode: host
environment:
- INFLUXDB_DB=influx
- INFLUXDB_ADMIN_USER=admin
- INFLUXDB_ADMIN_PASSWORD=admin
stdin_open: true
tty: true
ports:
- 8086:8086
- 8083:8083
- '8086:8086'
volumes:
- /home/suresh/docker/influxdb/:/var/lib/influxdb
- influxdb_data:/var/lib/influxdb
##################################################################################
# Grafana
##################################################################################
grafana:
image: grafana/grafana:latest
image: grafana/grafana
container_name: grafana
network_mode: host
ports:
- 3000:3000
volumes:
- /home/suresh/docker/grafana/:/var/lib/grafana
restart: always
depends_on:
- 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:
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",
"37": "sensor.queries_forwarded",
"370": "group.light_levels",
"371": "input_boolean.battery_notifications",
"371": "input_boolean.battery_alerts",
"372": "calendar.holidays_in_india",
"373": "sensor.kalavalanas_network_up_eth0",
"374": "sensor.ups_nominal_input_voltage",
@@ -405,7 +405,7 @@
"472": "sensor.dark_sky_precip",
"473": "group.upstairs_multi_sensor",
"474": "group.always_on",
"475": "input_boolean.trash_reminders",
"475": "input_boolean.trash_alerts",
"476": "sensor.pws_uv",
"477": "sensor.garage_pi_available_disk",
"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 }}"
action:
- service: input_label.set_value
data_template:
data:
entity_id: "input_label.{{- trigger.event.data.entity_id.split('.')[1] -}}"
value: "{{ trigger.event.data.new_state.attributes.battery_level }}"
- service: input_label.set_name
data_template:
data:
entity_id: "input_label.{{- trigger.event.data.entity_id.split('.')[1] -}}"
value: "{{ trigger.event.data.new_state.attributes.friendly_name }}'s Battery"
- service: input_label.set_icon
data_template:
data:
entity_id: "input_label.{{- trigger.event.data.entity_id.split('.')[1] -}}"
value: >
{% set battery_level = trigger.event.data.new_state.attributes.battery_level | int %}
@@ -91,28 +91,28 @@ automation:
topic: "owntracks/+/+"
action:
- service: input_label.set_value
data_template:
data:
entity_id: "input_label.{{trigger.topic.split('/')[-1]}}_wifi"
value: "{{ 'Yes' if trigger.payload_json.conn == 'w' else 'No' }}"
- service: input_label.set_icon
data_template:
data:
entity_id: "input_label.{{trigger.topic.split('/')[-1]}}_wifi"
value: "{{ 'mdi:wifi' if trigger.payload_json.conn == 'w' else 'mdi:wifi-off' }}"
- service: input_label.set_name
data_template:
data:
entity_id: "input_label.{{trigger.topic.split('/')[-1]}}_wifi"
value: "{{trigger.topic.split('/')[-1] | title }}'s phone wifi enabled?"
- service: input_label.set_value
data_template:
data:
entity_id: "input_label.{{trigger.topic.split('/')[-1]}}_battery"
value: '{{ trigger.payload_json.batt | int }}'
- service: input_label.set_name
data_template:
data:
entity_id: "input_label.{{trigger.topic.split('/')[-1]}}_battery"
value: "{{trigger.topic.split('/')[-1] | title }}'s Battery"
- service: input_label.set_icon
data_template:
data:
entity_id: "input_label.{{trigger.topic.split('/')[-1]}}_battery"
value: >
{% set battery_level = trigger.payload_json.batt | int %}

View File

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

View File

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

View File

@@ -156,10 +156,10 @@ cards:
show_state: true
title: Fitness
entities:
- entity: sensor.yo_mama_steps
- entity: sensor.suresh_steps
icon: "mdi:run"
name: Suresh Steps
- entity: sensor.yo_mama_floors_ascended
- entity: sensor.suresh_floors_ascended
icon: "mdi:run"
name: Suresh Floors Ascended
- entity: sensor.mallika_steps
@@ -229,7 +229,6 @@ cards:
- type: tile
entity: weather.dark_sky
- type: entities
title: Xiaomi Motion Sensors
show_header_toggle: false
@@ -358,26 +357,3 @@ cards:
type: entities
title: Motion Sensors
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
icon: mdi:television
cards:
- type: entities
title: Text To Speech
show_header_toggle: false
@@ -14,13 +13,13 @@ cards:
- input_text.tts
- type: entities
title: Media Players
title: SONOS Speakers
show_header_toggle: false
entities:
- media_player.attic_tv
- media_player.living_room # sonos
- media_player.upstairs # sonos
- media_player.smart_tv
- entity: media_player.living_room # sonos
name: SONOS Speaker 1
- entity: media_player.upstairs # sonos
name: SONOS Speaker 2
- type: vertical-stack
cards:
@@ -28,8 +27,6 @@ cards:
entity: media_player.living_room
- type: media-control
entity: media_player.upstairs
- type: media-control
entity: media_player.attic_tv
- type: media-control
entity: media_player.chromecastultra7021
name: ChromeCast Ultra

View File

@@ -251,18 +251,26 @@ cards:
- input_number.hasika_bedroom_closet_lights
- 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
entities:
- input_boolean.garage_door_notifications
- input_boolean.battery_notifications
- input_boolean.text_alerts
- input_boolean.led_alerts
- input_boolean.battery_alerts
- input_boolean.zone_alerts
- input_boolean.security_system_alerts
- input_boolean.notify_camera_alerts
- input_boolean.trash_reminders
- automation.family_room_motion_timer
- automation.family_room_timer_elapsed
- input_boolean.camera_alerts
- input_boolean.zone_alerts
- input_boolean.trash_alerts
- type: entities
title: Bed & Wakeup Times

View File

@@ -62,45 +62,3 @@ cards:
name: Pill Taken
- entity: script.remind_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
show_header_toggle: false
entities:
- automation.alert_when_everyone_is_away
- automation.alert_when_someone_enters_a_zone
- automation.alert_when_someone_leaves_a_zone
- 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_30_minutes
- automation.notify_home_security_status_change
- automation.turn_on_thermostat_upon_reaching_home
- type: conditional
conditions:
@@ -112,7 +110,7 @@ cards:
title: Trash & Recycle Automations
show_header_toggle: false
entities:
- automation.reset_trash_reminders
- automation.reset_trash_alerts
- automation.restore_trash_recycle_settings_on_startup
- automation.trash_and_recycle_pickup_reminder
- automation.trash_pickup_day_changed
@@ -183,11 +181,3 @@ cards:
show_header_toggle: false
entities:
- 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"
# action:
# - service: script.notify_me
# data_template:
# data:
# message: "3D Printer Status Changed from 'Printing' to '{{ trigger.to_state.state }}'."
# #
@@ -169,7 +169,7 @@
# entity_id: "binary_sensor.octoprint_printing"
# action:
# - service: script.notify_me
# data_template:
# data:
# message: "3D Printer Status changed from '{{ trigger.from_state.state }}' to '{{ trigger.to_state.state }}'."
# #
@@ -182,7 +182,7 @@
# to: "on"
# action:
# - service: script.notify_me
# data_template:
# data:
# message: "3D Printer Status changed to 'ERROR'. Please check the printer!"
# #
@@ -213,7 +213,7 @@
# from: "off"
# action:
# - service: script.notify_me
# data_template:
# data:
# message: >-
# 3D Printer job is now {{ trigger.to_state.attributes.friendly_name }} complete.
@@ -235,7 +235,7 @@
# - service: switch.turn_off
# entity_id: switch.3d_printer
# - service: script.notify_me
# data_template:
# data:
# message: "3D Printer is now switched off!"
# - service_template: input_boolean.turn_off
# entity_id: input_boolean.twenty_five_percent
@@ -265,7 +265,7 @@
# entity_id: camera.3d_printer_camera
# filename: "/config/www/downloads/camera/3dprinter/print_latest.jpg"
# - service: notify.telegram
# data_template:
# data:
# title: "3D Printer"
# message: "Print Progress"
# data:

View File

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

View File

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

View File

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

View File

@@ -171,6 +171,37 @@ automation:
- service: switch.turn_on
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
###############################################################################
@@ -284,9 +315,6 @@ automation:
state: "on"
action:
- 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
@@ -302,7 +330,6 @@ automation:
action:
- service: script.good_night_tts
###############################################################################
# TOGGLE WORKING IN OFFICE BOOLEAN
###############################################################################

View File

@@ -1,24 +1,6 @@
homeassistant:
customize:
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:
- platform: template
sensors:
@@ -77,7 +59,6 @@ binary_sensor:
payload_off: "off"
value_template: "{{ value }}"
###############################################################################
# _ _ _
# /\ | | | | (_)
@@ -119,104 +100,77 @@ automation:
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
initial_state: true
trigger:
platform: state
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_158d0004231f7b # 2 Car Garage
condition:
- condition: template
value_template: "{{ trigger.from_state.state != trigger.to_state.state }}"
- condition: template
value_template: "{{ trigger.from_state.state not in ['unavailable', 'unknown'] }}"
- condition: template
value_template: "{{ trigger.to_state.state not in ['unavailable', 'unknown'] }}"
- condition: template
value_template: "{{ states('input_boolean.garage_door_notifications') == 'on' }}"
value_template: "{{ trigger.from_state.state != trigger.to_state.state }}"
action:
- service: switch.turn_on
entity_id: switch.garage
- service: script.notify_me
data_template:
- service: camera.snapshot
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: >
{% 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" %}
{{ trigger.to_state.attributes.friendly_name }} is now CLOSED!
{{ trigger.to_state.attributes.friendly_name.replace('Sensor', '') -}} is CLOSED
{% endif %}
- service: script.led_message
data_template:
<<: *door_notification_script
- service: script.voice_notify
data_template:
<<: *door_notification_script
- delay: "00:00:05"
- service: camera.snapshot
data_template:
entity_id: "camera.garage"
filename:
url: !secret garage_camera_snapshot_url
notify_options:
- tv
- led
- voice
################################################################################
# SEND PICTURES AS ATTACHMENTS TO EMAIL AND TELEGRAM
################################################################################
- service: script.notify_family_with_picture
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_' ~
((state_attr('automation.notify_garage_door_status', 'last_triggered') |string).replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg') }}"
notify_options:
- telegram
# - email
- service: script.notify_me_with_picture
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.
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 }}"
- delay: "00:00:05"
- service: switch.turn_off
entity_id: switch.garage
###############################################################################
# Notify Entry Door Status
###############################################################################
- alias: Voice Notify Entry Door Status
- alias: Notify Entry Door Status
initial_state: true
trigger:
platform: state
@@ -230,33 +184,26 @@ automation:
- condition: template
value_template: "{{ trigger.from_state.state != trigger.to_state.state }}"
action:
- service: script.voice_notify
data_template:
- service: script.notify_family
data:
message: >
{% 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
states('alarm_control_panel.home') == 'armed_away' %}
But your home security system is ON.
{% endif %}
{% elif trigger.to_state.state | lower == "off" %}
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.
Your {{ trigger.to_state.attributes.friendly_name.replace(' Sensor', '') }} is CLOSED
{% endif %}
notify_options:
# - telegram
- tv
- led
###############################################################################
# Light automations when doors are opened
###############################################################################
- alias: When Front Door Opens Turn Front Room Lights ON
initial_state: true
@@ -396,7 +343,7 @@ automation:
state: "on"
action:
- service: switch.turn_off
data_template:
data:
entity_id: switch.master_bathroom_toilet_light
###############################################################################

View File

@@ -59,9 +59,13 @@ automation:
data:
message: "Today is {{ states('sensor.holiday') }}."
title: "{{ states('sensor.holiday') }}"
- service: script.notify_me
data_template:
- service: script.notify_family
data:
message: "Today is: {{states('sensor.holiday') }}"
notify_options:
- telegram
- tv
- led
- alias: Notify Indian Holidays
initial_state: true
@@ -91,8 +95,8 @@ automation:
false
{%- endif -%}
action:
- service: script.notify_me
data_template:
- service: script.notify_family
data:
message: >-
{%- set days2NextEvent = 0 -%}
{%- 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.
{%- endif -%}
{%- endif -%}
notify_options:
- telegram
- tv
- led

View File

@@ -67,9 +67,12 @@ automation:
platform: state
entity_id: alarm_control_panel.home
to: "triggered"
condition:
- condition: template
value_template: "{{ states('input_boolean.security_system_alerts') == 'on' }}"
action:
- service: script.notify_me
data_template:
- service: script.notify_family
data:
message: >
{% set ns = namespace(openDoorCount=0, doorNames="") %}
{%- 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:' }}
{{ ns.doorNames }}
notify_options:
- telegram
- tv
- led
- voice
- service: camera.snapshot
data_template:
data:
entity_id: "camera.frontdoor_camera"
filename:
"{{ '/config/www/downloads/camera/frontdoor/frontdoor_' ~
filename: "{{ '/config/www/downloads/camera/frontdoor/frontdoor_' ~
(states.binary_sensor.motion_sensor_158d00024ee084.last_updated ~ '').replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- service: camera.snapshot
data_template:
data:
entity_id: "camera.driveway_camera"
filename:
"{{ '/config/www/downloads/camera/driveway/driveway_' ~
filename: "{{ '/config/www/downloads/camera/driveway/driveway_' ~
(states.binary_sensor.motion_sensor_158d00024ee084.last_updated ~ '').replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- service: camera.snapshot
data_template:
data:
entity_id: "camera.garage"
filename:
"{{ '/config/www/downloads/camera/garage/garage_' ~
filename: "{{ '/config/www/downloads/camera/garage/garage_' ~
(states.binary_sensor.motion_sensor_158d00024ee084.last_updated ~ '').replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- service: camera.snapshot
data_template:
data:
entity_id: "camera.patio_camera"
filename:
"{{ '/config/www/downloads/camera/patio/patio_' ~
filename: "{{ '/config/www/downloads/camera/patio/patio_' ~
(states.binary_sensor.motion_sensor_158d00024e842c.last_updated ~ '').replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- service: camera.snapshot
data_template:
data:
entity_id: "camera.playarea_camera"
filename:
"{{ '/config/www/downloads/camera/playarea/playarea_' ~
filename: "{{ '/config/www/downloads/camera/playarea/playarea_' ~
(states.binary_sensor.motion_sensor_158d00024e842c.last_updated ~ '').replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- service: notify.telegram
data_template:
data:
title: "Camera Snapshots"
message: "Please check the camera images just to be sure!"
data:
@@ -164,28 +167,16 @@ automation:
condition:
- condition: template
value_template: "{{ states('input_boolean.security_system_alerts') == 'on' }}"
# - condition: template
# value_template: >
# {%- 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 }}
# {%- else -%}
# true
# {%- endif -%}
- condition: template
value_template: >
{%- 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 }}
{%- else -%}
true
{%- endif -%}
action:
- service: script.notify_me
data_template:
message: >
{% if states('alarm_control_panel.home') == "armed_home" %}
Your home is now secured!
{% elif states('alarm_control_panel.home') == "armed_away" %}
Your Home Security System is now set to Away mode!
{% elif states('alarm_control_panel.home') == "triggered" %}
Attention!: Your Home Security System is triggered! It has been notified to the authorities.
{% elif states('alarm_control_panel.home') == "disarmed" %}
Attention!: Your Home Security System is turned OFF.
{% endif %}
- service: script.voice_notify
data_template:
- service: script.notify_family
data:
message: >
{% if states('alarm_control_panel.home') == "armed_home" %}
Your home is now secured!
@@ -196,10 +187,16 @@ automation:
{% elif states('alarm_control_panel.home') == "disarmed" %}
Attention!: Your Home Security System is turned OFF.
{% endif %}
notify_options:
- telegram
- tv
- led
- voice
- condition: template
value_template: "{{ states('alarm_control_panel.home') != 'disarmed' }}"
- 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
@@ -212,10 +209,16 @@ automation:
to: "disarmed"
for:
minutes: 10
condition:
- condition: template
value_template: "{{ states('input_boolean.security_system_alerts') == 'on' }}"
action:
- service: script.notify_me
- service: script.notify_family
data:
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
@@ -232,33 +235,12 @@ automation:
- condition: template
value_template: "{{ states('input_boolean.security_system_alerts') == 'on' }}"
action:
- service: script.notify_me
- service: script.notify_family
data:
message: "Home Security System is OFF for more than 30 minutes!"
###############################################################################
# When home security system is turned OFF or turned to Home mode from "away"
# 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"
notify_options:
- tv
- led
###############################################################################
# TURN HOME SECURITY SYSTEM ON AT BED TIME
@@ -284,9 +266,13 @@ automation:
- service: alarm_control_panel.alarm_arm_home
data:
entity_id: alarm_control_panel.home
- service: script.notify_me
- service: script.notify_family
data:
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
@@ -295,11 +281,13 @@ automation:
initial_state: true
trigger:
- platform: time_pattern
minutes: '/15'
minutes: "/15"
seconds: 00
condition:
condition: and
conditions:
- condition: template
value_template: "{{ states('input_boolean.security_system_alerts') == 'on' }}"
- condition: template
value_template: "{{ states('alarm_control_panel.home') == 'armed_home' or states('alarm_control_panel.home') == 'armed_away' }}"
- condition: or
@@ -311,139 +299,19 @@ automation:
action:
- service: switch.turn_on
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
data_template:
data:
entity_id: "camera.garage"
filename: "{{ '/config/www/downloads/camera/garage/garage_' ~ (state_attr('automation.home_security_system_and_garage_door_check','last_updated') ~ '').replace('-','_').replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- service: notify.telegram
data_template:
title: "Garage"
message: "Home Security System is ON, but Garage Doors are OPEN!"
- service: script.notify_family
data:
photo:
- file: "{{ '/config/www/downloads/camera/garage/garage_' ~
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!
url: "{{ '/config/www/downloads/camera/garage/garage_' ~
(states.binary_sensor.motion_sensor_158d00024ee084.last_updated ~ '').replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
caption: "Garage"
- condition: template
value_template: "{{ states('alarm_control_panel.home') == 'armed_home' }}"
- service: script.voice_notify
data_template:
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 %}
notify_options:
- telegram
- tv
- led
- voice

View File

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

View File

@@ -37,27 +37,6 @@ nest:
###############################################################################
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.
# This automation is to keep an eye on what's going on with Nest
@@ -68,23 +47,22 @@ automation:
- platform: state
entity_id: sensor.dining_room_thermostat_operation_mode
action:
- service: script.notify_me
data_template:
- service: script.notify_family
data:
message: "Nest Thermostat changed from '{{ trigger.from_state.state }}' to '{{ trigger.to_state.state }}'."
- service: script.voice_notify
data_template:
message: >
{% set state = trigger.to_state.state %}
{% if state == "off" %}
Your home's thermostat is switched off.
{% elif state == "eco" %}
Your home's thermostat is set to eco or away mode.
{% elif state == "heat" %}
Your central heating is ON.
{% elif state == "cool" %}
Your central air condition is switched ON
{% elif state == "heat-cool" %}
Your home's thermostat is set to automatic mode.
{% else %}
Your home's thermostat is set to {{ state }} mode.
{% endif %}
notify_options:
- telegram
- tv
- led
- voice
script:
###############################################################################
# A script that toggles Nest Thermostat between eco/away & non-eco/away modes
###############################################################################
toggle_climate:
sequence:
- service: climate.set_away_mode
data:
entity_id: climate.dining_room
away_mode: "{{ false if state_attr('climate.dining_room', 'away_mode') == 'on' else true }}"

View File

@@ -53,15 +53,291 @@ tts:
# Telegram Configuration
#
telegram_bot:
# Setup Broadcast for sending messages
- platform: broadcast
api_key: !secret telegram_apikey
allowed_chat_ids:
- !secret telegram_chatid
# Add Polling
- platform: polling
api_key: !secret telegram_apikey
parse_mode: html
allowed_chat_ids:
- !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"
action:
- service: input_label.set_value
data_template:
data:
entity_id: input_label.pill_taken_at
value: "{{ as_timestamp(now()) | timestamp_custom('%m/%d/%Y %I:%M %p') }}"
- delay:
@@ -117,3 +117,39 @@ automation:
entity_id: timer.timer_pill_reminder
action:
- 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,7 +78,6 @@ sensor:
- drive_smart_status
- drive_temp
# 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.
#
@@ -109,7 +108,6 @@ sensor:
#
###############################################################################
automation:
- alias: Notify NAS Status Change
initial_state: true
trigger:
@@ -120,9 +118,12 @@ automation:
- condition: template
value_template: "{{ trigger.from_state.state != trigger.to_state.state }}"
action:
- service: script.notify_me
data_template:
- service: script.notify_family
data:
message: "NAS Status changed to: {{ trigger.to_state.state| upper }}"
notify_options:
- telegram
- tv
- alias: Notify NAS Drive Status Change
initial_state: true
@@ -137,11 +138,12 @@ automation:
- condition: template
value_template: "{{ trigger.from_state.state != trigger.to_state.state }}"
action:
- service: script.notify_me
data_template:
message: "NAS Drive state changed to:
{{ trigger.to_state.state| upper }} from
'{{ trigger.from_state.state| upper }}'"
- service: script.notify_family
data:
message: "NAS Drive state changed to: {{ trigger.to_state.state| upper }} from '{{ trigger.from_state.state| upper }}'"
notify_options:
- telegram
- tv
- alias: Notify NAS CPU Temperature
initial_state: true
@@ -150,10 +152,12 @@ automation:
entity_id: sensor.kalavala_nas_cpu_temperature
above: 125
action:
- service: script.notify_me
data_template:
message: "NAS CPU temperature is going crazy hot, needs your attention!!!
The current cpu temp is: {{ trigger.to_state.state }}"
- service: script.notify_family
data:
message: "NAS CPU temperature is going crazy hot, needs your attention!!! Current cpu temp is: {{ trigger.to_state.state }}"
notify_options:
- telegram
- tv
- alias: Notify NAS Disk Usage
initial_state: true
@@ -162,30 +166,39 @@ automation:
entity_id: sensor.kalavala_nas_volume_used_datavol1
above: 80
action:
- service: script.notify_me
data_template:
- service: script.notify_family
data:
message: "Attention! NAS disk usage is above 80 percent. Time to clean up?"
notify_options:
- telegram
- tv
- alias: Notify NAS Memory Usage
initial_state: true
trigger:
platform: state
entity_id: sensor.nas_memory_usage_above_80
to: 'True'
for: '00:05:00'
to: "True"
for: "00:05:00"
action:
- service: script.notify_me
data_template:
- service: script.notify_family
data:
message: "FYI - NAS Memory is above 80 percent for more than 5 minutes."
notify_options:
- telegram
- tv
- alias: Notify NAS CPU Usage
initial_state: true
trigger:
platform: state
entity_id: sensor.nas_cpu_usage_above_80
to: 'True'
for: '00:05:00'
to: "True"
for: "00:05:00"
action:
- service: script.notify_me
data_template:
- service: script.notify_family
data:
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
action:
- service: mqtt.publish
data_template:
data:
topic: "/home/trashpickupday"
retain: true
payload: "{{ states.input_select.trash_pickup_day.state }}"
@@ -221,7 +221,7 @@ automation:
entity_id: input_select.recycle_pickup_day
action:
- service: mqtt.publish
data_template:
data:
topic: "/home/recyclepickupday"
retain: true
payload: "{{ states.input_select.recycle_pickup_day.state }}"
@@ -233,7 +233,7 @@ automation:
entity_id: input_select.recycle_pickup_week
action:
- service: mqtt.publish
data_template:
data:
topic: "/home/recyclepickupweek"
retain: true
payload: "{{ states.input_select.recycle_pickup_week.state }}"
@@ -247,15 +247,15 @@ automation:
- delay:
minutes: 1
- service: input_select.select_option
data_template:
data:
entity_id: input_select.trash_pickup_day
option: "{{states.sensor.trash_pickup_day.state}}"
- service: input_select.select_option
data_template:
data:
entity_id: input_select.recycle_pickup_day
option: "{{states.sensor.recycle_pickup_day.state}}"
- service: input_select.select_option
data_template:
data:
entity_id: input_select.recycle_pickup_week
option: "{{states.sensor.recycle_pickup_week.state}}"
@@ -282,7 +282,9 @@ automation:
condition: and
conditions:
- 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
conditions:
- condition: state
@@ -292,8 +294,8 @@ automation:
entity_id: sensor.recycle_day
state: "yes"
action:
- service: script.notify_me
data_template:
- service: script.notify_family
data:
message: >
{% if states.sensor.trash_day.state == "yes" and states.sensor.recycle_day.state == "yes" %}
Tomorrow is the Trash AND Recycle Pickup day!
@@ -302,36 +304,28 @@ automation:
{% 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 %}
notify_options:
- telegram
- tv
- led
- service: script.voice_notify
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
- alias: Reset Trash Alerts
initial_state: true
trigger:
- platform: time
at: "09:00:00"
action:
- service: input_boolean.turn_on
entity_id: input_boolean.trash_reminders
entity_id: input_boolean.trash_alerts
- service: input_select.select_option
data_template:
data:
entity_id: input_select.trash_pickup_day
option: "{{states.sensor.trash_pickup_day.state}}"
- service: input_select.select_option
data_template:
data:
entity_id: input_select.recycle_pickup_day
option: "{{states.sensor.recycle_pickup_day.state}}"
- service: input_select.select_option
data_template:
data:
entity_id: input_select.recycle_pickup_week
option: "{{states.sensor.recycle_pickup_week.state}}"

View File

@@ -2,7 +2,7 @@
# @author : Mahasri Kalavala
# @date : 09/20/2018
# @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:
- service: script.all_indoor_lights_off
- 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
data:
entity_id: alarm_control_panel.home
- service: script.notify_me
- service: script.notify_family
data:
message: >
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
@@ -95,7 +97,7 @@ script:
all_indoor_lights_off:
sequence:
- service: light.turn_off
data_template:
data:
entity_id:
- light.family_room_lights
- light.hue_color_lamp_1
@@ -106,7 +108,7 @@ script:
- light.master_bedroom_lights
- service: switch.turn_off
data_template:
data:
entity_id:
- switch.basement_left
- switch.basement_right
@@ -148,224 +150,20 @@ script:
rgb_color: [0, 255, 0]
###############################################################################
# A script that toggles Nest Thermostat between eco/away & non-eco/away modes
###############################################################################
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
# Status of the house
###############################################################################
home_status:
sequence:
- service: script.voice_notify
data_template:
- service: script.notify_family
data:
message: !include ../templates/home_status.yaml
notify_options:
- voice
###############################################################################
# Display message on LED Matrix Screen
###############################################################################
led_message:
good_night_tts:
sequence:
- condition: state
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
- service: script.notify_family
data:
message: "ALERT: PLEASE TAKE YOUR TABLETS!"
- service: timer.start
entity_id: timer.timer_pill_reminder
- condition: template
value_template: "{{ states('input_boolean.pill_voice_notification') == 'on' }}"
- service: script.voice_notify
data_template:
message: >
Please take the tablets. It looks like you have forgotten to take today's
dose of tablets... Once again, this is a reminder for you to take the tablets.
###############################################################################
# Stops timer, Records that the pills are taken, and notifies!
###############################################################################
pill_taken:
sequence:
- service: timer.cancel
entity_id: timer.timer_pill_reminder
- service: input_boolean.turn_on
entity_id: input_boolean.pill_taken
- service: script.notify_me
data_template:
message: >
Thank you for taking tablets.
{%- if state_attr('sensor.allergy_index_today', 'rating') != None %}
{{- " Today's pollen level is : " ~ state_attr('sensor.allergy_index_today', 'rating') }}.
{%- endif -%}
- condition: template
value_template: "{{ states('input_boolean.pill_voice_notification') == 'on' }}"
- service: script.voice_notify
data:
message: "Thank you for taking tablets on time!"
message: !include ../templates/goodnight.yaml
notify_options:
- voice

View File

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

View File

@@ -194,19 +194,11 @@ sensor:
###############################################################################
input_boolean:
voice_notifications:
name: Home Assistant Announcements
icon: mdi:volume-off
do_not_disturb:
name: Do Not Disturb
initial: off
icon: mdi:do-not-disturb
led_alerts:
name: LED Messages
icon: mdi:led-strip
movie_time:
name: "Movie Time"
icon: mdi:movie-roll
@@ -239,30 +231,34 @@ input_boolean:
name: Nightly Report
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:
name: Remind me to enjoy Good Weather
icon: mdi:weather-sunny
security_system_alerts:
name: Notify Security System Status Change
icon: mdi:verified
name: Security System Alerts
icon: mdi:security
trash_alerts:
name: Trash Alerts
icon: mdi:recycle
garage_door_notifications:
name: Garage Door Alerts
icon: mdi:garage
zone_alerts:
name: Zone Alerts
icon: mdi:map-marker
battery_notifications:
name: Battery Notifications
battery_alerts:
name: Battery Alerts
icon: mdi:battery
camera_alerts:
name: Camera Alerts
icon: mdi:camera
dummy:
name: "Dummy Input Boolean!"
icon: mdi:sticker-emoji
@@ -272,13 +268,26 @@ input_boolean:
name: Light Automations
icon: mdi:lightbulb-on
text_alerts:
name: Text Alerts
icon: mdi:map-marker
# Notifications
telegram_notifications:
name: Telegram Notifications
icon: mdi:message
garage_door_notifications:
name: Garage Door Notifications
icon: mdi:garage
firetv_notifications:
name: FireTV Notifications
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
entity_id: input_boolean.do_not_disturb
action:
- service: script.notify_me
data_template:
- service: script.notify_family
data:
message: "The Do Not Disturb Mode is {{ trigger.to_state.state |upper }}."
notify_options:
- led
# Hourly Reports
######################################################

View File

@@ -6,18 +6,18 @@ automation:
- alias: Notify Home Status When Away
trigger:
- platform: time
at: '09:00:00'
at: "09:00:00"
- platform: time
at: '12:00:00'
at: "12:00:00"
- platform: time
at: '17:00:00'
at: "17:00:00"
- platform: time
at: '10:00:00'
at: "10:00:00"
condition:
- condition: template
value_template: "{{ states('input_boolean.home_mode_away') == 'on' }}"
action:
- service: notify.notify_smtp
data_template:
data:
title: 'Home Status {{ now().strftime("%d %h %Y, %I:%M:%S %p") }}'
message: !include ../templates/away_status.yaml

View File

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

View File

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

View File

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

View File

@@ -32,9 +32,12 @@ automation:
entity_id: input_boolean.light_automations
state: "on"
action:
- service: script.notify_me
- service: script.notify_family
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
entity_id: input_boolean.working_in_garage
@@ -57,22 +60,19 @@ automation:
state: "off"
- condition: template
value_template: "{{ states('input_boolean.garage_door_notifications') == 'on' }}"
- condition: state
entity_id: input_boolean.light_automations
state: "on"
# - condition: state
# entity_id: input_boolean.light_automations
# state: "on"
action:
- service: script.notify_me
data_template:
message: >
Your {{ trigger.to_state.attributes.friendly_name }} is OPEN for more than 5 minutes!
- service: script.voice_notify
data_template:
message: >
Attention! Your {{ trigger.to_state.attributes.friendly_name }} is open for more than 5 minutes.
- service: script.led_message
data_template:
- service: script.notify_family
data:
message: >
Your {{ trigger.to_state.attributes.friendly_name }} is OPEN for more than 5 minutes!
notify_options:
- telegram
- voice
- tv
- led
# Outdoor Lights:
# Keeps and eye on the patio and backyard lights...
@@ -96,12 +96,16 @@ automation:
state: "on"
action:
- service: switch.turn_off
data_template:
data:
entity_id: "{{ trigger.entity_id }}"
- service: script.notify_me
data_template:
- service: script.notify_family
data:
message: >
{{ 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:
# Keeps and eye on the lights & switches, turns off after 10 PM if they are on.
@@ -136,7 +140,7 @@ automation:
state: "on"
action:
- service: homeassistant.turn_off
data_template:
data:
entity_id: "{{ trigger.entity_id }}"
- alias: Guest Bathroom Lights WatchDog
@@ -154,7 +158,7 @@ automation:
state: "on"
action:
- service: homeassistant.turn_off
data_template:
data:
entity_id: "{{ trigger.entity_id }}"
- alias: Master Bathroom Lights WatchDog
@@ -172,7 +176,7 @@ automation:
state: "on"
action:
- service: homeassistant.turn_off
data_template:
data:
entity_id: "{{ trigger.entity_id }}"
- alias: Garage Lights WatchDog
@@ -190,7 +194,7 @@ automation:
state: "on"
action:
- service: homeassistant.turn_off
data_template:
data:
entity_id: "{{ trigger.entity_id }}"
- alias: Garage Shop Lights WatchDog
@@ -208,7 +212,7 @@ automation:
state: "on"
action:
- service: homeassistant.turn_off
data_template:
data:
entity_id: "{{ trigger.entity_id }}"
- alias: Guest Bathroom Exhaust WatchDog
@@ -226,7 +230,7 @@ automation:
state: "on"
action:
- service: homeassistant.turn_off
data_template:
data:
entity_id: "{{ trigger.entity_id }}"
- alias: Master Bathroom Shower Exhaust WatchDog
@@ -244,7 +248,7 @@ automation:
state: "on"
action:
- service: homeassistant.turn_off
data_template:
data:
entity_id: "{{ trigger.entity_id }}"
- alias: Master Bathroom Toilet Exhaust WatchDog
@@ -262,10 +266,9 @@ automation:
state: "on"
action:
- service: homeassistant.turn_off
data_template:
data:
entity_id: "{{ trigger.entity_id }}"
#############################################################################
# CLOSET LIGHTS WATCH DOG
#############################################################################
@@ -285,7 +288,7 @@ automation:
state: "on"
action:
- service: homeassistant.turn_off
data_template:
data:
entity_id: "{{ trigger.entity_id }}"
- alias: Hasika Bedroom Closet WatchDog
@@ -303,116 +306,5 @@ automation:
state: "on"
action:
- service: homeassistant.turn_off
data_template:
data:
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
value_template: "{% if states.sensor.dark_sky_wind_speed.state | round < 8 %} false {% else %} true {% endif %}"
action:
- service: script.notify_me
data_template:
- service: script.notify_family
data:
message: >
{% 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')) %}
@@ -207,8 +207,12 @@ automation:
{% elif ( windspeed > 60 ) and (states.input_boolean.hurricane_wind_alert.state == 'off') %}
HURRICANE WINDS. FIND SHELTER, AND STAY INDOORS!
{% endif %}
notify_options:
- telegram
- tv
- led
- service: input_boolean.turn_on
data_template:
data:
entity_id: >-
{%- set windspeed = states.sensor.dark_sky_wind_speed.state | round -%}
{%- if ( windspeed > 7 and ( windspeed <= 15 ) ) -%}
@@ -230,7 +234,7 @@ automation:
entity_id: sensor.dark_sky_wind_speed
action:
- service: input_boolean.turn_on
data_template:
data:
entity_id: >-
{%- set windspeed = states.sensor.dark_sky_wind_speed.state | round -%}
{%- if ( windspeed > 7 and ( windspeed <= 15 ) ) -%}
@@ -266,7 +270,7 @@ automation:
minutes: 15
action:
- service: input_boolean.turn_off
data_template:
data:
entity_id: "{{ trigger.entity_id }}"
- alias: Alert Super Heavy Winds
@@ -283,8 +287,8 @@ automation:
true
{%- endif -%}
action:
- service: script.notify_me
data_template:
- service: script.notify_family
data:
message: >
{% 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') %}
@@ -292,6 +296,10 @@ automation:
{% 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!
{% endif %}
notify_options:
- telegram
- tv
- led
- alias: Rain Alerts
initial_state: true
@@ -309,14 +317,15 @@ automation:
- condition: template
value_template: "{{ states.sensor.dark_sky_precip_probability.state | int == 1 }}"
action:
- service: script.notify_me
data_template:
- service: script.notify_family
data:
message: "{{ trigger.to_state.state | title }} with intensity {{ states.sensor.dark_sky_precip_intensity.state | float }} inches per hour"
- service: script.voice_notify
data_template:
message: "{{ trigger.to_state.state }} with intensity {{ states.sensor.dark_sky_precip_intensity.state | float}} inches per hour"
notify_options:
- telegram
- tv
- led
- service: input_boolean.turn_on
data_template:
data:
entity_id: >
{% set curState = trigger.to_state.state | lower %}
{%- if curState == "rain" -%}
@@ -339,14 +348,16 @@ automation:
- condition: template
value_template: "{{ states.sensor.dark_sky_precip_probability.state | int == 1 }}"
action:
- service: script.notify_me
data_template:
- service: script.notify_family
data:
message: "{{ trigger.to_state.state | title }} with intensity {{ states.sensor.dark_sky_precip_intensity.state | float }} inches per hour"
- service: script.voice_notify
data_template:
message: "{{ trigger.to_state.state }} with intensity {{ states.sensor.dark_sky_precip_intensity.state | float}} inches per hour"
notify_options:
- telegram
- voice
- tv
- led
- service: input_boolean.turn_on
data_template:
data:
entity_id: >
{% set curState = trigger.to_state.state | lower %}
{%- if curState == "snow" %}

View File

@@ -92,7 +92,7 @@ automation:
state: "on"
action:
- service: light.turn_on
data_template:
data:
entity_id: light.hue_color_lamp_1, light.hue_color_lamp_2, light.hue_color_lamp_3
rgb_color:
- "{{ range(0,255) |random }}"
@@ -370,14 +370,14 @@ automation:
state: "on"
action:
- service: light.turn_on
data_template:
data:
entity_id: light.master_bedroom_1
rgb_color:
- "{{ range(0,255) |random }}"
- "{{ range(0,255) |random }}"
- "{{ range(0,255) |random }}"
- service: light.turn_on
data_template:
data:
entity_id: light.master_bedroom_2
rgb_color:
- "{{ range(0,255) |random }}"
@@ -473,25 +473,30 @@ script:
doorbell_camera_pics:
sequence:
- service: script.notify_me
- service: script.notify_family
data:
message: "ALERT! Someone is at the front door!"
notify_options:
- telegram
- voice
- tv
- led
- service: camera.snapshot
data_template:
data:
entity_id: "camera.frontdoor_camera"
filename:
"{{ '/config/www/downloads/camera/frontdoor/frontdoor_' ~
(state_attr('script.doorbell_camera_pics', 'last_triggered') ~ '').replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- service: camera.snapshot
data_template:
data:
entity_id: "camera.driveway_camera"
filename:
"{{ '/config/www/downloads/camera/driveway/driveway_' ~
(state_attr('script.doorbell_camera_pics', 'last_triggered') ~ '').replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- service: notify.telegram
data_template:
data:
title: "Door Bell"
message: "Someone rang door bell!"
data:
@@ -504,3 +509,12 @@ script:
(state_attr('script.doorbell_camera_pics', 'last_triggered') ~ '').replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
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
value_template: "{{ states('input_boolean.zone_alerts') == 'on' }}"
action:
- service: script.notify_me
data_template:
- service: script.notify_family
data:
message: >
{{ trigger.entity_id.split('.')[1].split('_')[1] | title}} just entered {{ trigger.zone.attributes.friendly_name }}!
- service: script.voice_notify
data_template:
message: >
{{ trigger.entity_id.split('.')[1].split('_')[1] | title}} just entered {{ trigger.zone.attributes.friendly_name }}!
greeting: "no"
notify_options:
- telegram
- voice
- tv
- led
- alias: Alert When Someone Leaves a Zone
initial_state: true
@@ -78,17 +78,14 @@ automation:
- condition: template
value_template: "{{ states('input_boolean.zone_alerts') == 'on' }}"
action:
- service: script.notify_me
data_template:
- service: script.notify_family
data:
message: "{{ trigger.entity_id.split('.')[1].split('_')[1] | title}} just left {{ trigger.zone.attributes.friendly_name }}."
- service: script.voice_notify
data_template:
message: >-
{{ trigger.entity_id.split('.')[1].split('_')[1] | title }} just left {{ trigger.zone.attributes.friendly_name }}.
{% if trigger.entity_id.split('.')[1].split('_')[1] == "suresh" and trigger.zone.attributes.friendly_name | lower == "office" %}
and will be home in {{ (states('sensor.suresh2home') | int) + 5 }} minutes.
{% endif %}
greeting: "no"
notify_options:
- telegram
- voice
- tv
- led
###############################################################################
# Welcome family members when they come home
@@ -110,15 +107,14 @@ automation:
entity_id: input_boolean.zone_alerts
state: "on"
action:
- service: script.notify_me
data_template:
- service: script.notify_family
data:
message: >
Welcome home, {{ trigger.entity_id.split('.')[1].split('_')[1] | title }}!
- service: script.voice_notify
data_template:
message: >
"Welcome home, {{ trigger.entity_id.split('.')[1].split('_')[1] | lower }}!"
greeting: "no"
notify_options:
- voice
- tv
- led
- service: input_boolean.turn_off
entity_id: input_boolean.home_mode_away
- service: switch.turn_on
@@ -165,9 +161,14 @@ automation:
- condition: template
value_template: '{{ states.proximity.home.attributes.dir_of_travel == "towards" }}'
action:
- service: script.notify_me
data_template:
- service: script.notify_family
data:
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

View File

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