diff --git a/configuration.yaml b/configuration.yaml
index 118ff55..3c26497 100644
--- a/configuration.yaml
+++ b/configuration.yaml
@@ -27,33 +27,33 @@ homeassistant:
sun:
alexa:
config:
-cloud:
- alexa:
- filter:
- include_entities:
- - light.family_room
- - light.master_bedroom
- - light.gateway_light_34ce008ad65d
- - switch.basement_left
- - switch.basement_right
- - switch.frontyard_light
- - switch.garage_lights
- - switch.guest_bedroom
- - switch.prayer_room
- - switch.kids_bed_accent
- - switch.kids_bedroom
- - switch.kitchen
- - switch.office_room
- - switch.wemobackyardlightswitch
- - switch.wemoswitch1
- include_domains:
- - light
- - switch
+# cloud:
+# alexa:
+# filter:
+# include_entities:
+# - light.family_room
+# - light.master_bedroom
+# - light.gateway_light_34ce008ad65d
+# - switch.basement_left
+# - switch.basement_right
+# - switch.frontyard_light
+# - switch.garage_lights
+# - switch.guest_bedroom
+# - switch.prayer_room
+# - switch.kids_bed_accent
+# - switch.kids_bedroom
+# - switch.kitchen
+# - switch.office_room
+# - switch.wemobackyardlightswitch
+# - switch.wemoswitch1
+# include_domains:
+# - light
+# - switch
- entity_config:
- light.gateway_light_34ce008ad65d:
- name: Gateway Light
- description: Xiaomi Gateway Light
+# entity_config:
+# light.gateway_light_34ce008ad65d:
+# name: Gateway Light
+# description: Xiaomi Gateway Light
discovery:
@@ -71,14 +71,15 @@ homekit:
- binary_sensor.single_car_garage_door_tilt_sensor_sensor
- binary_sensor.two_car_garage_door_tilt_sensor_sensor
-map:
-updater:
-logbook:
-history:
+mobile_app:
+# map:
+# updater:
+# logbook:
+# history:
websocket_api:
python_script:
-recorder:
- db_url: !secret my_sql_url
+# recorder:
+# db_url: !secret my_sql_url
logger: !include logging.yaml
zeroconf:
@@ -104,32 +105,6 @@ binary_sensor:
- platform: workday
country: US
-person:
- - name: Suresh
- id: suresh
- device_trackers:
- - device_tracker.suresh
- - device_tracker.suresh_kalavala
- - device_tracker.tesla_model_3_5yj3e1ea8jf010610_location_tracker
-
- - name: Mallika
- id: mallika
- device_trackers:
- - device_tracker.mallika
- - device_tracker.life360_mallika
-
- - name: Srinika
- id: srinika
- device_trackers:
- - device_tracker.srinika
- - device_tracker.life360_srinika
-
- - name: Hasika
- id: hasika
- device_trackers:
- - device_tracker.hasika
- - device_tracker.life360_hasika
-
lovelace:
mode: yaml
diff --git a/logging.yaml b/logging.yaml
index 7182c0e..8b71222 100644
--- a/logging.yaml
+++ b/logging.yaml
@@ -14,7 +14,7 @@ logs:
homeassistant.setup: error
homeassistant.loader: error # hide custom_component warnings
homeassistant.exceptions: error
- homeassistant.helpers.script: error
+ homeassistant.helpers.script: error
homeassistant.helpers.entity: error
homeassistant.components.wemo: critical
homeassistant.components.cloud.iot: error
diff --git a/lovelace/00_myhome_view.yaml b/lovelace/00_myhome_view.yaml
index 2ab0faf..552245f 100644
--- a/lovelace/00_myhome_view.yaml
+++ b/lovelace/00_myhome_view.yaml
@@ -105,17 +105,17 @@ cards:
- script.emergency_script
- script.emergency_script_loop
- - type: horizontal-stack
- cards:
- - type: glance
- entities:
- - input_label.mallika_birthday_days2go
- - type: glance
- entities:
- - input_label.srinika_birthday_days2go
- - type: glance
- entities:
- - input_label.hasika_birthday_days2go
+ # - type: horizontal-stack
+ # cards:
+ # - type: glance
+ # entities:
+ # - input_label.mallika_birthday_days2go
+ # - type: glance
+ # entities:
+ # - input_label.srinika_birthday_days2go
+ # - type: glance
+ # entities:
+ # - input_label.hasika_birthday_days2go
- type: entity-filter
title: Doors
@@ -184,15 +184,6 @@ cards:
- type: weather-forecast
entity: weather.dark_sky
- - type: picture-entity
- id: camera_ohio_doppler_weather
- title: Ohio Doppler Weather
- entity: camera.ohio_doppler_weather
- camera_image: camera.ohio_doppler_weather
- show_info: true
- tap_action:
- action: more-info
-
- type: conditional
conditions:
- entity: sensor.usps_mail
diff --git a/packages/alarm_clock.yaml b/packages/alarm_clock.yaml
index cf260c3..248be01 100644
--- a/packages/alarm_clock.yaml
+++ b/packages/alarm_clock.yaml
@@ -7,7 +7,6 @@
###############################################################################
homeassistant:
customize:
-
automation.alarm_clock:
icon: mdi:alarm-check
@@ -48,13 +47,13 @@ input_label:
icon: mdi:timer
###############################################################################
-# _ _ _
-# /\ | | | | (_)
-# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
+# _ _ _
+# /\ | | | | (_)
+# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
# / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \/ __|
# / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | \__ \
# /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_|___/
-#
+#
###############################################################################
automation:
@@ -64,7 +63,7 @@ automation:
- platform: homeassistant
event: start
- platform: state
- entity_id:
+ entity_id:
- input_boolean.am
- input_boolean.pm
- input_number.slider_hours
@@ -74,28 +73,28 @@ automation:
entity_id: input_label.alarm_current_time
data_template:
value: >
- {%- if states.input_number.slider_hours.state | int < 10 -%}
- {%- if states.input_number.slider_hours.state|int == 0 %}
+ {%- if states('input_number.slider_hours') | int < 10 -%}
+ {%- if states('input_number.slider_hours') |int == 0 %}
12
{%- else -%}
- {{- 0 ~ states.input_number.slider_hours.state|int -}}
+ {{- 0 ~ states('input_number.slider_hours') |int -}}
{%- endif -%}
{%- else -%}
- {{- states.input_number.slider_hours.state |int -}}
+ {{- states('input_number.slider_hours') |int -}}
{% endif -%}:
- {%- if states.input_number.slider_minutes.state | int < 10 -%}
- {{- 0 ~ states.input_number.slider_minutes.state |int -}}
+ {%- if states('input_number.slider_minutes') | int < 10 -%}
+ {{- 0 ~ states('input_number.slider_minutes') |int -}}
{%- else -%}
- {{- states.input_number.slider_minutes.state|int -}}
- {%- endif -%}{%- if states.input_boolean.am.state == "on" %} AM{%- else %} PM{%- endif -%}
-
+ {{- states('input_number.slider_minutes') |int -}}
+ {%- endif -%}{%- if states('input_boolean.am') == "on" %} AM{%- else %} PM{%- endif -%}
+
- alias: AM Change OFF
initial_state: true
trigger:
platform: state
entity_id: input_boolean.am
- from: 'on'
- to: 'off'
+ from: "on"
+ to: "off"
action:
- service: input_boolean.turn_on
entity_id: input_boolean.pm
@@ -107,8 +106,8 @@ automation:
trigger:
platform: state
entity_id: input_boolean.am
- from: 'off'
- to: 'on'
+ from: "off"
+ to: "on"
action:
- service: input_boolean.turn_off
entity_id: input_boolean.pm
@@ -120,8 +119,8 @@ automation:
trigger:
platform: state
entity_id: input_boolean.pm
- from: 'on'
- to: 'off'
+ from: "on"
+ to: "off"
action:
- service: input_boolean.turn_on
entity_id: input_boolean.am
@@ -133,8 +132,8 @@ automation:
trigger:
platform: state
entity_id: input_boolean.pm
- from: 'off'
- to: 'on'
+ from: "off"
+ to: "on"
action:
- service: input_boolean.turn_off
entity_id: input_boolean.am
@@ -145,7 +144,7 @@ automation:
initial_state: true
trigger:
platform: time_pattern
- minutes: '/1'
+ minutes: "/1"
seconds: 00
condition:
- condition: template
@@ -169,4 +168,4 @@ automation:
- service: script.voice_notify
data_template:
message: >
- "Hello! This is an alarm clock reminder! Have a great day!"
\ No newline at end of file
+ "Hello! This is an alarm clock reminder! Have a great day!"
diff --git a/packages/apcups.yaml b/packages/apcups.yaml
index 69c1db7..45f91af 100644
--- a/packages/apcups.yaml
+++ b/packages/apcups.yaml
@@ -1,78 +1,77 @@
# ###############################################################################
# # @author : Mahasri Kalavala
# # @date : 11/27/2017
-# # @package : APC UPS Backup
+# # @package : APC UPS Backup
# # @description : UPS Backup
# ###############################################################################
- apcupsd:
- host: 127.0.0.1
- port: 3551
+apcupsd:
+ host: 127.0.0.1
+ port: 3551
- sensor:
- - platform: apcupsd
+sensor:
+ - platform: apcupsd
# name: Network Backup UPS
- resources:
- - bcharge
- - linev
- - loadpct
- - nominv
- - numxfers
- - status
- - timeleft
- - tonbatt
+ resources:
+ - bcharge
+ - linev
+ - loadpct
+ - nominv
+ - numxfers
+ - status
+ - timeleft
+ - tonbatt
###############################################################################
-# _ _ _
-# /\ | | | | (_)
-# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
+# _ _ _
+# /\ | | | | (_)
+# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
# / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \/ __|
# / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | \__ \
# /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_|___/
-#
+#
###############################################################################
- automation:
+automation:
+ - alias: UPS State Change
+ initial_state: true
+ trigger:
+ - platform: state
+ entity_id: sensor.ups_status
+ action:
+ - service: script.notify_me
+ data_template:
+ message: "UPS Status changed from {{ trigger.from_state.state }}
+ to {{ trigger.to_state.state }}
+ at {{ as_timestamp(now()) | timestamp_custom('%I:%M:%S %p, %B %d,%Y', true) }}."
- - alias: UPS State Change
- initial_state: true
- trigger:
- - platform: state
- entity_id: sensor.ups_status
- action:
- - service: script.notify_me
- data_template:
- message: "UPS Status changed from {{ trigger.from_state.state }}
- to {{ trigger.to_state.state }}
- at {{ as_timestamp(now()) | timestamp_custom('%I:%M:%S %p, %B %d,%Y', true) }}."
+ # # Power Failure Notification
+ # ###############################################################################
+ - alias: Power Failure
+ initial_state: true
+ trigger:
+ - platform: state
+ entity_id: sensor.ups_status
+ from: "ONLINE"
+ to: "ONBATT"
+ action:
+ - service: script.notify_me
+ data_template:
+ message:
+ Power failure at {{ as_timestamp(now()) | timestamp_custom('%I:%M:%S %p %B-%d,%Y', true) }}.
+ Battery can last for {{ states('sensor.ups_time_left') }} minutes.
-# # Power Failure Notification
-# ###############################################################################
- - alias: Power Failure
- initial_state: true
- trigger:
- - platform: state
- entity_id: sensor.ups_status
- from: 'ONLINE'
- to: 'ONBATT'
- action:
- - service: script.notify_me
- data_template:
- message:
- Power failure at {{ as_timestamp(now()) | timestamp_custom('%I:%M:%S %p %B-%d,%Y', true) }}.
- Battery can last for {{ states.sensor.ups_time_left.state }} minutes.
-
-# # Power Restored Notification
-# ###############################################################################
- - alias: Power Restored
- initial_state: true
- trigger:
- - platform: state
- entity_id: sensor.ups_status
- from: 'ONBATT'
- to: 'ONLINE'
- action:
- - service: script.notify_me
- data_template:
- message:
- Power restored at {{ as_timestamp(now()) | timestamp_custom('%I:%M:%S %p %B-%d,%Y', true) }}.
- Ran on battery for {{ "%0.2f" % (states.sensor.ups_time_on_battery.state | int / 60 |float) }} minutes.
+ # # Power Restored Notification
+ # ###############################################################################
+ - alias: Power Restored
+ initial_state: true
+ trigger:
+ - platform: state
+ entity_id: sensor.ups_status
+ from: "ONBATT"
+ to: "ONLINE"
+ action:
+ - service: script.notify_me
+ data_template:
+ message:
+ Power restored at {{ as_timestamp(now()) | timestamp_custom('%I:%M:%S %p %B-%d,%Y', true) }}.
+ Ran on battery for {{ "%0.2f" % (states('sensor.ups_time_on_battery') | int / 60 |float) }} minutes.
diff --git a/packages/aroma.yaml b/packages/aroma.yaml
index 657daf0..a7c5813 100644
--- a/packages/aroma.yaml
+++ b/packages/aroma.yaml
@@ -9,34 +9,33 @@ homeassistant:
timer:
timer_bathroom_aroma:
- duration: '00:30:00'
+ duration: "00:30:00"
timer_downstairs_aroma:
- duration: '01:00:00'
+ duration: "01:00:00"
timer_upstairs_aroma:
- duration: '01:00:00'
+ duration: "01:00:00"
###############################################################################
-# _ _ _
-# /\ | | | | (_)
-# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
+# _ _ _
+# /\ | | | | (_)
+# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
# / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \/ __|
# / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | \__ \
# /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_|___/
-#
+#
###############################################################################
automation:
-
-#
-# Automations to start timer when they are switched ON
-#
+ #
+ # Automations to start timer when they are switched ON
+ #
- alias: Bathroom Aroma Timer Start
initial_state: true
trigger:
- platform: state
entity_id: switch.downstairs_fragrance
- from: 'off'
- to: 'on'
+ from: "off"
+ to: "on"
action:
- service: timer.start
entity_id: timer.timer_bathroom_aroma
@@ -46,8 +45,8 @@ automation:
trigger:
- platform: state
entity_id: switch.downstairs_fragrance
- from: 'on'
- to: 'off'
+ from: "on"
+ to: "off"
action:
- service: timer.finish
entity_id: timer.timer_bathroom_aroma
@@ -57,8 +56,8 @@ automation:
trigger:
- platform: state
entity_id: switch.downstairs_fragrance
- from: 'off'
- to: 'on'
+ from: "off"
+ to: "on"
action:
- service: timer.start
entity_id: timer.timer_downstairs_aroma
@@ -68,8 +67,8 @@ automation:
trigger:
- platform: state
entity_id: switch.downstairs_fragrance
- from: 'on'
- to: 'off'
+ from: "on"
+ to: "off"
action:
- service: timer.finish
entity_id: timer.timer_downstairs_aroma
@@ -79,8 +78,8 @@ automation:
trigger:
- platform: state
entity_id: switch.upstairs_fragrance
- from: 'off'
- to: 'on'
+ from: "off"
+ to: "on"
action:
- service: timer.start
entity_id: timer.timer_upstairs_aroma
@@ -90,22 +89,22 @@ automation:
trigger:
- platform: state
entity_id: switch.upstairs_fragrance
- from: 'on'
- to: 'off'
+ from: "on"
+ to: "off"
action:
- service: timer.finish
entity_id: timer.timer_upstairs_aroma
-#
-# Timer Elapsed Events
-#
+ #
+ # Timer Elapsed Events
+ #
- alias: Bathroom Aroma Timer Elapsed
initial_state: true
trigger:
- platform: event
event_type: timer.finished
- event_data:
- entity_id: timer.timer_bathroom_aroma
+ event_data:
+ entity_id: timer.timer_bathroom_aroma
action:
- service: switch.turn_off
entity_id: switch.downstairs_fragrance
@@ -115,8 +114,8 @@ automation:
trigger:
- platform: event
event_type: timer.finished
- event_data:
- entity_id: timer.timer_downstairs_aroma
+ event_data:
+ entity_id: timer.timer_downstairs_aroma
action:
- service: switch.turn_off
entity_id: switch.downstairs_fragrance
@@ -126,21 +125,21 @@ automation:
trigger:
- platform: event
event_type: timer.finished
- event_data:
- entity_id: timer.timer_upstairs_aroma
+ event_data:
+ entity_id: timer.timer_upstairs_aroma
action:
- service: switch.turn_off
entity_id: switch.upstairs_fragrance
-#
-# Turn ON fragrance outlets automatically at specific times of the day
-#
+ #
+ # Turn ON fragrance outlets automatically at specific times of the day
+ #
- alias: Turn On Upstairs Aroma
trigger:
- platform: time
- at: '08:00:00'
+ at: "08:00:00"
- platform: time
- at: '20:00:00'
+ at: "20:00:00"
action:
- service: switch.turn_on
entity_id: switch.upstairs_fragrance
@@ -148,7 +147,7 @@ automation:
- alias: Turn On Downstairs Aroma
trigger:
- platform: time
- at: '17:00:00'
+ at: "17:00:00"
action:
- service: switch.turn_on
- entity_id: switch.downstairs_fragrance
\ No newline at end of file
+ entity_id: switch.downstairs_fragrance
diff --git a/packages/away.yaml b/packages/away.yaml
index cc0aa0d..c29beb7 100644
--- a/packages/away.yaml
+++ b/packages/away.yaml
@@ -7,7 +7,6 @@ homeassistant:
friendly_name: All Indoor Lights & Switches OFF
script:
-
home_mode_away:
sequence:
- service: script.all_indoor_lights_off
@@ -16,7 +15,7 @@ script:
- service: climate.set_away_mode
data:
entity_id: climate.dining_room
- away_mode: 'true'
+ away_mode: "true"
- service: alarm_control_panel.alarm_arm_away
data:
entity_id: alarm_control_panel.simplisafe
@@ -35,7 +34,7 @@ script:
- service: notify.notify_smtp
data_template:
title: 'Indoor Pictures {{ now().strftime("%d %h %Y, %I:%M:%S %p") }}'
- message: 'No one seem to be home at the moment... Please see the images and make sure everything is okay.'
+ message: "No one seem to be home at the moment... Please see the images and make sure everything is okay."
data:
images:
- "/home/homeassistant/.homeassistant/www/downloads/camera/kitchen/kitchen_away.jpg"
@@ -64,4 +63,4 @@ script:
state.entity_id != 'switch.rf_switch_five' and
not '_siren_' in state.entity_id -%}
{{- "," if not loop.first-}}{{ state.entity_id }}{{-endif-}}
- {%- endfor -%}
\ No newline at end of file
+ {%- endfor -%}
diff --git a/packages/batteries.yaml b/packages/batteries.yaml
index 0954733..5c38e8a 100644
--- a/packages/batteries.yaml
+++ b/packages/batteries.yaml
@@ -187,7 +187,7 @@ sensor:
{% 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.state | lower == "charging" %}
+ {% if states('sensor.suresh_iphone_battery_state') | lower == "charging" %}
{% if battery_level == -1 %}
mdi:battery-unknown
{% else %}
@@ -210,7 +210,7 @@ sensor:
{% else %}
mdi:battery-alert
{% endif %}
- {% endif %}
+ {% endif %}
{% endif %}
{% else %}
mdi:battery-alert
@@ -225,7 +225,7 @@ sensor:
{% 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.state | lower == "charging" %}
+ {% if states('sensor.mallika_iphone_battery_state') | lower == "charging" %}
{% if battery_level == -1 %}
mdi:battery-unknown
{% else %}
@@ -248,7 +248,7 @@ sensor:
{% else %}
mdi:battery-alert
{% endif %}
- {% endif %}
+ {% endif %}
{% endif %}
{% else %}
mdi:battery-alert
@@ -263,7 +263,7 @@ sensor:
{% 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.state | lower == "charging" %}
+ {% if states('sensor.srinika_iphone_battery_state') | lower == "charging" %}
{% if battery_level == -1 %}
mdi:battery-unknown
{% else %}
@@ -286,7 +286,7 @@ sensor:
{% else %}
mdi:battery-alert
{% endif %}
- {% endif %}
+ {% endif %}
{% endif %}
{% else %}
mdi:battery-alert
@@ -301,7 +301,7 @@ sensor:
{% 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.state | lower == "charging" %}
+ {% if states('sensor.hasika_iphone_battery_state') | lower == "charging" %}
{% if battery_level == -1 %}
mdi:battery-unknown
{% else %}
@@ -324,7 +324,7 @@ sensor:
{% else %}
mdi:battery-alert
{% endif %}
- {% endif %}
+ {% endif %}
{% endif %}
{% else %}
mdi:battery-alert
@@ -364,9 +364,9 @@ automation:
true
{%- endif -%}
- condition: template
- value_template: "{{ states.input_boolean.home_mode_away.state == 'off' }}"
+ value_template: "{{ states('input_boolean.home_mode_away') == 'off' }}"
- condition: template
- value_template: "{{ states.alarm_control_panel.simplisafe.state | lower != 'armed_away' }}"
+ value_template: "{{ states('alarm_control_panel.simplisafe') | lower != 'armed_away' }}"
action:
- service: script.voice_notify
data_template:
@@ -395,7 +395,7 @@ automation:
below: 25
condition:
- condition: template
- value_template: '{{ states.input_boolean.battery_notifications.state == "on" }}'
+ value_template: "{{ states('input_boolean.battery_notifications') == 'on' }}"
action:
- service: script.notify_me
data_template:
@@ -423,7 +423,7 @@ automation:
{%- for x in states if x.attributes and x.attributes.battery_level and x.attributes.battery_level |int <= 24 %}
{% set ns.lowBattery = ns.lowBattery ~ ',' ~ x.name %}
{%- endfor %}
- {{ ns.lowBattery -}}
+ {{ ns.lowBattery -}}
{{- ' battery is ' if ns.lowBattery.split(',')|count == 1 else ' batteries are ' -}} less than 25 percent.
# ###############################################################################
diff --git a/packages/bed_sensors.yaml b/packages/bed_sensors.yaml
index 9559a99..f2fa88b 100644
--- a/packages/bed_sensors.yaml
+++ b/packages/bed_sensors.yaml
@@ -1,6 +1,5 @@
homeassistant:
-
sensor:
- platform: mqtt
name: "Master Bed Sensor"
diff --git a/packages/birthday.yaml b/packages/birthday.yaml
index 43861cc..0d7ec44 100644
--- a/packages/birthday.yaml
+++ b/packages/birthday.yaml
@@ -18,7 +18,7 @@
# Update: I added mqtt code to refresh the sensor values dynamically.
# The sensor values update on hourly basis.
#
-# PLEASE NOTE THAT THIS PACKAGE USES "DATE" SENSOR. IF YOU SEE THE BIRTHDAY
+# PLEASE NOTE THAT THIS PACKAGE USES "DATE" SENSOR. IF YOU SEE THE BIRTHDAY
# VALUES AS "NOT SET", YOU NEED TO ADD THE FOLLOWING TO YOUR CONFIGURATION FILE
#
# sensor:
@@ -27,7 +27,7 @@
# - 'time'
# - 'date'
# - 'date_time'
-# - 'time_date'
+# - 'time_date'
#
###############################################################################
homeassistant:
@@ -51,32 +51,31 @@ input_label:
name: Mallika's Birthday
###############################################################################
-# _ _ _
-# /\ | | | | (_)
-# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
+# _ _ _
+# /\ | | | | (_)
+# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
# / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \/ __|
# / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | \__ \
# /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_|___/
-#
+#
###############################################################################
automation:
-
-###############################################################################
-# Build the excitement
-###############################################################################
+ ###############################################################################
+ # Build the excitement
+ ###############################################################################
- alias: Birthday Countdown 30 Days
initial_state: true
trigger:
platform: state
- entity_id:
+ entity_id:
- input_label.srinika_birthday_days2go
- input_label.hasika_birthday_days2go
- input_label.mallika_birthday_days2go
condition:
- condition: state
entity_id: group.all_devices
- state: 'home'
+ state: "home"
- condition: template
value_template: "{{ trigger.to_state.state | int > 0 and trigger.to_state.state | int < 30 }}"
action:
@@ -84,21 +83,21 @@ automation:
data_template:
message: "{{ trigger.entity_id.split('.')[1].split('_')[0] | title }}'s Birthday is only {{ trigger.to_state.state }} days to go!"
-###############################################################################
-# Celebrate Birthday!!!
-###############################################################################
+ ###############################################################################
+ # Celebrate Birthday!!!
+ ###############################################################################
- alias: Today is the Birthday
initial_state: true
trigger:
platform: state
- entity_id:
+ entity_id:
- input_label.srinika_birthday_days2go
- input_label.hasika_birthday_days2go
- input_label.mallika_birthday_days2go
condition:
- condition: state
entity_id: group.all_devices
- state: 'home'
+ state: "home"
- condition: template
value_template: "{{ trigger.to_state.state | int == 0 }}"
action:
@@ -106,14 +105,14 @@ automation:
data_template:
message: "Hurray! Today is {{ trigger.entity_id.split('.')[1].split('_')[0] | title }}'s Birthday!"
-###############################################################################
-# Announce Happy Birthday message every hour starting 7 am until 9 PM
-###############################################################################
+ ###############################################################################
+ # Announce Happy Birthday message every hour starting 7 am until 9 PM
+ ###############################################################################
- alias: Random Birthday Wishes
initial_state: true
trigger:
platform: time_pattern
- hours: '/1'
+ hours: "/1"
minutes: 3
seconds: 00
condition:
@@ -121,18 +120,18 @@ automation:
conditions:
- condition: state
entity_id: group.all_devices
- state: 'home'
+ state: "home"
- condition: time
- after: '07:00:00'
- before: '21:00:00'
+ after: "07:00:00"
+ before: "21:00:00"
- condition: or
conditions:
- condition: template
- value_template: "{{ states.input_label.srinika_birthday_days2go.state | int == 0 }}"
+ value_template: "{{ states('input_label.srinika_birthday_days2go') | int == 0 }}"
- condition: template
- value_template: "{{ states.input_label.hasika_birthday_days2go.state | int == 0 }}"
+ value_template: "{{ states('input_label.hasika_birthday_days2go') | int == 0 }}"
- condition: template
- value_template: "{{ states.input_label.mallika_birthday_days2go.state | int == 0 }}"
+ value_template: "{{ states('input_label.mallika_birthday_days2go') | int == 0 }}"
action:
- service: script.voice_notify
data_template:
@@ -142,34 +141,34 @@ automation:
- service: script.voice_notify
data_template:
message: "Alexa, Sing Happy Birthday Song."
- greeting: 'no'
+ greeting: "no"
- alias: Update Birthdays
initial_state: true
trigger:
- platform: time_pattern
- minutes: '/5'
+ minutes: "/5"
seconds: 00
- platform: homeassistant
event: start
condition:
- condition: template
- value_template: "{{ states.input_label.srinika_birthday.state.split('-') | length > 0 }}"
+ value_template: "{{ states('input_label.srinika_birthday').split('-') | length > 0 }}"
- condition: template
- value_template: "{{ states.input_label.hasika_birthday.state.split('-') | length > 0 }}"
+ value_template: "{{ states('input_label.hasika_birthday').split('-') | length > 0 }}"
- condition: template
- value_template: "{{ states.input_label.mallika_birthday.state.split('-') | length > 0 }}"
+ value_template: "{{ states('input_label.mallika_birthday').split('-') | length > 0 }}"
action:
- service: input_label.set_value
data_template:
entity_id: input_label.srinika_birthday_days2go
value: >
- {% set year = states.sensor.date.state.split('-')[0] %}
- {% set month = states.sensor.date.state.split('-')[1] %}
- {% set date = states.sensor.date.state.split('-')[2] %}
+ {% set year = states('sensor.date').split('-')[0] %}
+ {% set month = states('sensor.date').split('-')[1] %}
+ {% set date = states('sensor.date').split('-')[2] %}
{% if states('input_label.srinika_birthday') != "unknown" %}
- {%- set bDayMonth = states.input_label.srinika_birthday.state.split('-')[0] -%}
- {%- set bDayDate = states.input_label.srinika_birthday.state.split('-')[1] -%}
+ {%- set bDayMonth = states('input_label.srinika_birthday').split('-')[0] -%}
+ {%- set bDayDate = states('input_label.srinika_birthday').split('-')[1] -%}
{%- set numOfDays = ((as_timestamp(strptime(year ~ '-' ~ bDayMonth ~ '-' ~ bDayDate , '%Y-%m-%d')) | timestamp_custom('%j', true) | int ) - (as_timestamp(strptime(year ~ '-' ~ month~ '-' ~ date , '%Y-%m-%d')) | timestamp_custom('%j', true) | int)) -%}
{%- if numOfDays < 0 -%}
{{ numOfDays + 365 }}
@@ -183,12 +182,12 @@ automation:
data_template:
entity_id: input_label.hasika_birthday_days2go
value: >
- {% set year = states.sensor.date.state.split('-')[0] %}
- {% set month = states.sensor.date.state.split('-')[1] %}
- {% set date = states.sensor.date.state.split('-')[2] %}
+ {% set year = states('sensor.date').split('-')[0] %}
+ {% set month = states('sensor.date').split('-')[1] %}
+ {% set date = states('sensor.date').split('-')[2] %}
{% if states('input_label.hasika_birthday') != "unknown" %}
- {%- set bDayMonth = states.input_label.hasika_birthday.state.split('-')[0] -%}
- {%- set bDayDate = states.input_label.hasika_birthday.state.split('-')[1] -%}
+ {%- set bDayMonth = states('input_label.hasika_birthday').split('-')[0] -%}
+ {%- set bDayDate = states('input_label.hasika_birthday').split('-')[1] -%}
{%- set numOfDays = ((as_timestamp(strptime(year ~ '-' ~ bDayMonth ~ '-' ~ bDayDate , '%Y-%m-%d')) | timestamp_custom('%j', true) | int ) - (as_timestamp(strptime(year ~ '-' ~ month~ '-' ~ date , '%Y-%m-%d')) | timestamp_custom('%j', true) | int)) -%}
{%- if numOfDays < 0 -%}
{{ numOfDays + 365 }}
@@ -202,12 +201,12 @@ automation:
data_template:
entity_id: input_label.mallika_birthday_days2go
value: >
- {% set year = states.sensor.date.state.split('-')[0] %}
- {% set month = states.sensor.date.state.split('-')[1] %}
- {% set date = states.sensor.date.state.split('-')[2] %}
+ {% set year = states('sensor.date').split('-')[0] %}
+ {% set month = states('sensor.date').split('-')[1] %}
+ {% set date = states('sensor.date').split('-')[2] %}
{% if states('input_label.mallika_birthday') != "unknown" %}
- {%- set bDayMonth = states.input_label.mallika_birthday.state.split('-')[0] -%}
- {%- set bDayDate = states.input_label.mallika_birthday.state.split('-')[1] -%}
+ {%- set bDayMonth = states('input_label.mallika_birthday').split('-')[0] -%}
+ {%- set bDayDate = states('input_label.mallika_birthday').split('-')[1] -%}
{%- set numOfDays = ((as_timestamp(strptime(year ~ '-' ~ bDayMonth ~ '-' ~ bDayDate , '%Y-%m-%d')) | timestamp_custom('%j', true) | int ) - (as_timestamp(strptime(year ~ '-' ~ month~ '-' ~ date , '%Y-%m-%d')) | timestamp_custom('%j', true) | int)) -%}
{%- if numOfDays < 0 -%}
{{ numOfDays + 365 }}
@@ -216,4 +215,4 @@ automation:
{%- endif -%}
{% else %}
-
- {% endif %}
\ No newline at end of file
+ {% endif %}
diff --git a/packages/cameras.yaml b/packages/cameras.yaml
index 26f8bdc..3d93e0e 100644
--- a/packages/cameras.yaml
+++ b/packages/cameras.yaml
@@ -363,8 +363,8 @@ automation:
- "/home/homeassistant/.homeassistant/www/downloads/camera/frontdoor/frontdoor_latest.jpg"
- condition: template
value_template: >
- {% if states.binary_sensor.single_car_garage_door_tilt_sensor_sensor.state == "on" or
- states.binary_sensor.two_car_garage_door_tilt_sensor_sensor.state == "on" %}
+ {% if states('binary_sensor.single_car_garage_door_tilt_sensor_sensor') == "on" or
+ states('binary_sensor.two_car_garage_door_tilt_sensor_sensor') == "on" %}
True
{% else %}
False
@@ -442,8 +442,8 @@ automation:
- "/home/homeassistant/.homeassistant/www/downloads/camera/driveway/driveway_latest.jpg"
- condition: template
value_template: >
- {% if states.binary_sensor.single_car_garage_door_tilt_sensor_sensor.state == "on" or
- states.binary_sensor.two_car_garage_door_tilt_sensor_sensor.state == "on" %}
+ {% if states('binary_sensor.single_car_garage_door_tilt_sensor_sensor') == "on" or
+ states('binary_sensor.two_car_garage_door_tilt_sensor_sensor') == "on" %}
True
{% else %}
False
@@ -475,8 +475,8 @@ automation:
entity_id: image_processing.tensorflow_garage_camera
- condition: template
value_template: >
- {% if states.binary_sensor.single_car_garage_door_tilt_sensor_sensor.state == "on" or
- states.binary_sensor.two_car_garage_door_tilt_sensor_sensor.state == "on" %}
+ {% if states('binary_sensor.single_car_garage_door_tilt_sensor_sensor') == "on" or
+ states('binary_sensor.two_car_garage_door_tilt_sensor_sensor') == "on" %}
True
{% else %}
False
@@ -643,7 +643,7 @@ automation:
- condition: template
value_template: "{{ states('alarm_control_panel.simplisafe') == 'armed_home' or states('alarm_control_panel.simplisafe') == 'armed_away' }}"
action:
- - delay: "{{ '00:00:08' if states.binary_sensor.aeotec_zw120_door_window_sensor_gen5_sensor.state == 'on' else '0:0:0' }}"
+ - delay: "{{ '00:00:08' if states('binary_sensor.aeotec_zw120_door_window_sensor_gen5_sensor') == 'on' else '0:0:0' }}"
- service: camera.snapshot
data_template:
entity_id: "camera.frontdoor_camera"
@@ -681,7 +681,7 @@ automation:
(states.binary_sensor.motion_sensor_158d00024ee084.last_updated ~ '').replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- condition: template
- value_template: "{{ states.device_tracker.life360_suresh.state == 'home' }}"
+ value_template: "{{ states('device_tracker.life360_suresh') == 'home' }}"
- service: notify.ios_devices
data_template:
message: "Check Front Door camera!"
@@ -751,7 +751,7 @@ automation:
(states.binary_sensor.motion_sensor_158d00024e57fb.last_updated ~ '').replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- condition: template
- value_template: "{{ states.device_tracker.life360_suresh.state == 'home' }}"
+ value_template: "{{ states('device_tracker.life360_suresh') == 'home' }}"
- service: notify.ios_devices
data_template:
message: "Check Driveway camera!"
@@ -822,7 +822,7 @@ automation:
(states.binary_sensor.motion_sensor_158d00024e842c.last_updated ~ '').replace('-','_')
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- condition: template
- value_template: "{{ states.device_tracker.life360_suresh.state == 'home' }}"
+ value_template: "{{ states('device_tracker.life360_suresh') == 'home' }}"
- service: notify.ios_devices
data_template:
message: "Check Patio camera!"
@@ -866,30 +866,30 @@ automation:
- service: script.frontdoor_camera_text_overlay
data_template:
text: >
- {{ '* ' if states('alarm_control_panel.simplisafe') == 'armed_home' or
+ {{ '* ' if states('alarm_control_panel.simplisafe') == 'armed_home' or
states('alarm_control_panel.simplisafe') == 'armed_away' -}}
- {{- states('sensor.dark_sky_temperature')|int}} °F, Feels like
+ {{- states('sensor.dark_sky_temperature')|int}} °F, Feels like
{{- ' ' ~ states('sensor.dark_sky_apparent_temperature') |int -}}
- service: script.driveway_camera_text_overlay
data_template:
text: >
- {{ '* ' if states('alarm_control_panel.simplisafe') == 'armed_home' or
+ {{ '* ' if states('alarm_control_panel.simplisafe') == 'armed_home' or
states('alarm_control_panel.simplisafe') == 'armed_away' -}}
- {{- states('sensor.dark_sky_temperature')|int}} °F, Feels like
+ {{- states('sensor.dark_sky_temperature')|int}} °F, Feels like
{{- ' ' ~ states('sensor.dark_sky_apparent_temperature') |int -}}
- service: script.playarea_camera_text_overlay
data_template:
text: >
- {{ '* ' if states('alarm_control_panel.simplisafe') == 'armed_home' or
+ {{ '* ' if states('alarm_control_panel.simplisafe') == 'armed_home' or
states('alarm_control_panel.simplisafe') == 'armed_away' -}}
- {{- states('sensor.dark_sky_temperature')|int}} °F, Feels like
+ {{- states('sensor.dark_sky_temperature')|int}} °F, Feels like
{{- ' ' ~ states('sensor.dark_sky_apparent_temperature') |int -}}
- service: script.patio_camera_text_overlay
data_template:
text: >
- {{ '* ' if states('alarm_control_panel.simplisafe') == 'armed_home' or
+ {{ '* ' if states('alarm_control_panel.simplisafe') == 'armed_home' or
states('alarm_control_panel.simplisafe') == 'armed_away' -}}
- {{- states('sensor.dark_sky_temperature')|int}} °F, Feels like
+ {{- states('sensor.dark_sky_temperature')|int}} °F, Feels like
{{- ' ' ~ states('sensor.dark_sky_apparent_temperature') |int -}}
###############################################################################
diff --git a/packages/cameras_machinebox.yaml b/packages/cameras_machinebox.yaml
index 3557e8d..b622dfb 100644
--- a/packages/cameras_machinebox.yaml
+++ b/packages/cameras_machinebox.yaml
@@ -1,409 +1,409 @@
-#
-# I COMMENTED OUT ALL THE TAGBOX RELATED STUFF AS I USE TENSORFLOW COMPONENT FOR IT.
-#
-homeassistant:
- customize:
- image_processing.facebox_frontdoor_camera:
- friendly_name: People @ Front Door
- image_processing.facebox_driveway_camera:
- friendly_name: People @ Driveway
- image_processing.facebox_patio_camera:
- friendly_name: People @ Patio
- image_processing.facebox_playarea_camera:
- friendly_name: People @ Playarea
- image_processing.facebox_garage_camera:
- friendly_name: People @ Garage
+# #
+# # I COMMENTED OUT ALL THE TAGBOX RELATED STUFF AS I USE TENSORFLOW COMPONENT FOR IT.
+# #
+# homeassistant:
+# customize:
+# image_processing.facebox_frontdoor_camera:
+# friendly_name: People @ Front Door
+# image_processing.facebox_driveway_camera:
+# friendly_name: People @ Driveway
+# image_processing.facebox_patio_camera:
+# friendly_name: People @ Patio
+# image_processing.facebox_playarea_camera:
+# friendly_name: People @ Playarea
+# image_processing.facebox_garage_camera:
+# friendly_name: People @ Garage
- image_processing.tagbox_frontdoor_camera:
- friendly_name: Frontdoor Tag
- image_processing.tagbox_driveway_camera:
- friendly_name: Driveway Tag
- image_processing.tagbox_playarea_camera:
- friendly_name: Playarea Tag
- image_processing.tagbox_patio_camera:
- friendly_name: Patio Tag
- image_processing.tagbox_garage_camera:
- friendly_name: Garage Tag
+# image_processing.tagbox_frontdoor_camera:
+# friendly_name: Frontdoor Tag
+# image_processing.tagbox_driveway_camera:
+# friendly_name: Driveway Tag
+# image_processing.tagbox_playarea_camera:
+# friendly_name: Playarea Tag
+# image_processing.tagbox_patio_camera:
+# friendly_name: Patio Tag
+# image_processing.tagbox_garage_camera:
+# friendly_name: Garage Tag
- sensor.frontdoor_camera_objects:
- friendly_name: Things At Front Door
- sensor.driveway_camera_objects:
- friendly_name: Things At Driveway
- sensor.playarea_camera_objects:
- friendly_name: Things At Playarea
- sensor.patio_camera_objects:
- friendly_name: Things At Patio
- sensor.garage_camera_objects:
- friendly_name: Things in Garage
- sensor.frontdoor_camera_people:
- friendly_name: People At Front Door
- sensor.driveway_camera_people:
- friendly_name: People Driveway
- sensor.playarea_camera_people:
- friendly_name: People Playarea
- sensor.patio_camera_people:
- friendly_name: People Patio
- sensor.garage_camera_people:
- friendly_name: Garage Patio
+# sensor.frontdoor_camera_objects:
+# friendly_name: Things At Front Door
+# sensor.driveway_camera_objects:
+# friendly_name: Things At Driveway
+# sensor.playarea_camera_objects:
+# friendly_name: Things At Playarea
+# sensor.patio_camera_objects:
+# friendly_name: Things At Patio
+# sensor.garage_camera_objects:
+# friendly_name: Things in Garage
+# sensor.frontdoor_camera_people:
+# friendly_name: People At Front Door
+# sensor.driveway_camera_people:
+# friendly_name: People Driveway
+# sensor.playarea_camera_people:
+# friendly_name: People Playarea
+# sensor.patio_camera_people:
+# friendly_name: People Patio
+# sensor.garage_camera_people:
+# friendly_name: Garage Patio
-image_processing:
- - platform: facebox
- ip_address: !secret ha_ip_address
- scan_interval: 360
- port: 8080
- source:
- - entity_id: camera.frontdoor_camera
- - entity_id: camera.driveway_camera
- - entity_id: camera.patio_camera
- - entity_id: camera.playarea_camera
- - entity_id: camera.garage_camera
- # - platform: tagbox
- # scan_interval: 10000 # Default 10
- # ip_address: !secret ha_ip_address
- # port: 8081
- # source:
- # - entity_id: camera.frontdoor_camera
- # - entity_id: camera.driveway_camera
- # - entity_id: camera.patio_camera
- # - entity_id: camera.playarea_camera
- # - entity_id: camera.garage_camera
+# image_processing:
+# - platform: facebox
+# ip_address: !secret ha_ip_address
+# scan_interval: 360
+# port: 8080
+# source:
+# - entity_id: camera.frontdoor_camera
+# - entity_id: camera.driveway_camera
+# - entity_id: camera.patio_camera
+# - entity_id: camera.playarea_camera
+# - entity_id: camera.garage_camera
+# # - platform: tagbox
+# # scan_interval: 10000 # Default 10
+# # ip_address: !secret ha_ip_address
+# # port: 8081
+# # source:
+# # - entity_id: camera.frontdoor_camera
+# # - entity_id: camera.driveway_camera
+# # - entity_id: camera.patio_camera
+# # - entity_id: camera.playarea_camera
+# # - entity_id: camera.garage_camera
-sensor:
+# sensor:
-##
-#Facebox related sensors
-##
- - platform: template
- sensors:
- frontdoor_camera_people:
- value_template: >-
- {% set faces = state_attr('image_processing.facebox_frontdoor_camera', 'matched_faces') %}
- {% if None != faces %}
- {% if faces | list | count == 0 %}
- Clear
- {% else %}
- {%- for face in faces | list %}{%- if loop.first %}{% elif loop.last %} and {% else %}, {% endif -%}{{ face }}{%- endfor %}
- {% endif %}
- {% endif %}
- icon_template: mdi:cctv
+# ##
+# #Facebox related sensors
+# ##
+# - platform: template
+# sensors:
+# frontdoor_camera_people:
+# value_template: >-
+# {% set faces = state_attr('image_processing.facebox_frontdoor_camera', 'matched_faces') %}
+# {% if None != faces %}
+# {% if faces | list | count == 0 %}
+# Clear
+# {% else %}
+# {%- for face in faces | list %}{%- if loop.first %}{% elif loop.last %} and {% else %}, {% endif -%}{{ face }}{%- endfor %}
+# {% endif %}
+# {% endif %}
+# icon_template: mdi:cctv
- - platform: template
- sensors:
- driveway_camera_people:
- value_template: >-
- {% set faces = state_attr('image_processing.facebox_driveway_camera', 'matched_faces') %}
- {% if None != faces %}
- {% if faces | list | count == 0 %}
- Clear
- {% else %}
- {%- for face in faces | list %}{%- if loop.first %}{% elif loop.last %} and {% else %}, {% endif -%}{{ face }}{%- endfor %}
- {% endif %}
- {% endif %}
- icon_template: mdi:cctv
+# - platform: template
+# sensors:
+# driveway_camera_people:
+# value_template: >-
+# {% set faces = state_attr('image_processing.facebox_driveway_camera', 'matched_faces') %}
+# {% if None != faces %}
+# {% if faces | list | count == 0 %}
+# Clear
+# {% else %}
+# {%- for face in faces | list %}{%- if loop.first %}{% elif loop.last %} and {% else %}, {% endif -%}{{ face }}{%- endfor %}
+# {% endif %}
+# {% endif %}
+# icon_template: mdi:cctv
- - platform: template
- sensors:
- patio_camera_people:
- value_template: >-
- {% set faces = state_attr('image_processing.facebox_patio_camera', 'matched_faces') %}
- {% if None != faces %}
- {% if faces | list | count == 0 %}
- Clear
- {% else %}
- {%- for face in faces | list %}{%- if loop.first %}{% elif loop.last %} and {% else %}, {% endif -%}{{ face }}{%- endfor %}
- {% endif %}
- {% endif %}
- icon_template: mdi:cctv
+# - platform: template
+# sensors:
+# patio_camera_people:
+# value_template: >-
+# {% set faces = state_attr('image_processing.facebox_patio_camera', 'matched_faces') %}
+# {% if None != faces %}
+# {% if faces | list | count == 0 %}
+# Clear
+# {% else %}
+# {%- for face in faces | list %}{%- if loop.first %}{% elif loop.last %} and {% else %}, {% endif -%}{{ face }}{%- endfor %}
+# {% endif %}
+# {% endif %}
+# icon_template: mdi:cctv
- - platform: template
- sensors:
- playarea_camera_people:
- value_template: >-
- {% set faces = state_attr('image_processing.facebox_playarea_camera', 'matched_faces') %}
- {% if None != faces %}
- {% if faces | list | count == 0 %}
- Clear
- {% else %}
- {%- for face in faces | list %}{%- if loop.first %}{% elif loop.last %} and {% else %}, {% endif -%}{{ face }}{%- endfor %}
- {% endif %}
- {% endif %}
- icon_template: mdi:cctv
+# - platform: template
+# sensors:
+# playarea_camera_people:
+# value_template: >-
+# {% set faces = state_attr('image_processing.facebox_playarea_camera', 'matched_faces') %}
+# {% if None != faces %}
+# {% if faces | list | count == 0 %}
+# Clear
+# {% else %}
+# {%- for face in faces | list %}{%- if loop.first %}{% elif loop.last %} and {% else %}, {% endif -%}{{ face }}{%- endfor %}
+# {% endif %}
+# {% endif %}
+# icon_template: mdi:cctv
- - platform: template
- sensors:
- garage_camera_people:
- value_template: >-
- {% set faces = state_attr('image_processing.facebox_garage_camera', 'matched_faces') %}
- {% if None != faces %}
- {% if faces | list | count == 0 %}
- Clear
- {% else %}
- {%- for face in faces | list %}{%- if loop.first %}{% elif loop.last %} and {% else %}, {% endif -%}{{ face }}{%- endfor %}
- {% endif %}
- {% endif %}
- icon_template: mdi:cctv
+# - platform: template
+# sensors:
+# garage_camera_people:
+# value_template: >-
+# {% set faces = state_attr('image_processing.facebox_garage_camera', 'matched_faces') %}
+# {% if None != faces %}
+# {% if faces | list | count == 0 %}
+# Clear
+# {% else %}
+# {%- for face in faces | list %}{%- if loop.first %}{% elif loop.last %} and {% else %}, {% endif -%}{{ face }}{%- endfor %}
+# {% endif %}
+# {% endif %}
+# icon_template: mdi:cctv
-# ###########################################################################################################################
-# # Tagbox related Sensors; Please don't go crazy looking at the code. Here is the simple explanation.
-# # The tagbox gives a bunch of tags for each picture, and I eliminate a bunch of unwanted tags by filtering them out
-# # The unwanted tags are something that I really don't care - like a Tree in the front yard.
-# # Then I do custom mapping of the tags that fits my needs. That way I can display what I want rather than what I was given.
-# # I have no control over what tagbox gives, I want to pick and choose tags irrespective of confidence level.
-# ###########################################################################################################################
+# # ###########################################################################################################################
+# # # Tagbox related Sensors; Please don't go crazy looking at the code. Here is the simple explanation.
+# # # The tagbox gives a bunch of tags for each picture, and I eliminate a bunch of unwanted tags by filtering them out
+# # # The unwanted tags are something that I really don't care - like a Tree in the front yard.
+# # # Then I do custom mapping of the tags that fits my needs. That way I can display what I want rather than what I was given.
+# # # I have no control over what tagbox gives, I want to pick and choose tags irrespective of confidence level.
+# # ###########################################################################################################################
- # - platform: template
- # sensors:
- # frontdoor_camera_objects:
- # value_template: >-
- # {% set attribs = state_attr('image_processing.tagbox_frontdoor_camera', 'tags') %}
- # {%- if None != attribs -%}
- # {%- set tag_map = {'Vehicle':'Car', 'Sedan':'Car', 'Luxury vehicle':'Car', 'Driving':'Car',
- # 'Wheel':'Car', 'Automotive design':'Car', 'Automotive exterior':'Car',
- # 'Transport':'Car', 'Sports car':'Car', 'Land vehicle':'Car', 'Supercar':'Car',
- # 'Waterway':'Rain', 'Super car': 'Car'
- # } -%}
- # {%- set unwanted_tags = ['Asphalt', 'Backyard', 'City', 'Estate', 'Flower', 'Garden', 'Grass', 'Tree', 'Car', 'Vehicle', 'Suburb', 'Street',
- # 'Highway', 'Infrastructure', 'Lane', 'Lawn', 'Neighbourhood', 'Public space', 'Super car', 'Snow', 'Winter', 'Supercar',
- # 'Residential area', 'Road', 'Road surface', 'Sidewalk', 'Tarmac', 'Race track', 'Sport venue', 'Soil', 'Outdoor structure', 'Cartoon', 'Poster', 'Illustration',
- # 'Transport', 'Walkway', 'Yard', 'Screenshot', 'Night', 'Lighting and Light', 'Drawing', 'Sketch', 'Stadium',
- # 'Black-and-white', 'Monochrome', 'Monochrome photography', 'Black and White', 'Parking lot', 'Parking',
- # 'Black', 'White', 'Darkness', 'Light', 'Text'] -%}
- # {%- macro filter_unwanted(tags) -%}
- # {%- set comma = joiner(',') -%}
- # {%- for item in tags if item not in unwanted_tags -%}{{- comma() -}}{{- item -}}{% endfor %}{%- endmacro -%}
- # {%- macro mapped_items(tags) -%}
- # {%- set comma = joiner(',') -%}
- # {%- for item in tags if item not in tag_map -%}{{- comma() -}}{{- item -}}
- # {%- endfor -%}
- # {%- for item in tags if item in tag_map -%}{{- comma() -}}{{- tag_map[item] -}}{%- endfor -%}
- # {%- endmacro -%}
- # {% macro get_final_output(output_list) %}
- # {%- for x in output_list if x != "" -%}
- # {%- if loop.first %}{% elif loop.last %},{% else %},{% endif -%}{{- x -}}
- # {%- endfor -%}
- # {% endmacro %}
- # {%- set result = filter_unwanted(attribs| map(attribute='name')|list).split(',') -%}
- # {%- set output = get_final_output(mapped_items(result).split(',') | unique|list) -%}
- # {{- "Clear" if output |trim == "" else output -}}
- # {% endif %}
- # icon_template: mdi:cctv
+# # - platform: template
+# # sensors:
+# # frontdoor_camera_objects:
+# # value_template: >-
+# # {% set attribs = state_attr('image_processing.tagbox_frontdoor_camera', 'tags') %}
+# # {%- if None != attribs -%}
+# # {%- set tag_map = {'Vehicle':'Car', 'Sedan':'Car', 'Luxury vehicle':'Car', 'Driving':'Car',
+# # 'Wheel':'Car', 'Automotive design':'Car', 'Automotive exterior':'Car',
+# # 'Transport':'Car', 'Sports car':'Car', 'Land vehicle':'Car', 'Supercar':'Car',
+# # 'Waterway':'Rain', 'Super car': 'Car'
+# # } -%}
+# # {%- set unwanted_tags = ['Asphalt', 'Backyard', 'City', 'Estate', 'Flower', 'Garden', 'Grass', 'Tree', 'Car', 'Vehicle', 'Suburb', 'Street',
+# # 'Highway', 'Infrastructure', 'Lane', 'Lawn', 'Neighbourhood', 'Public space', 'Super car', 'Snow', 'Winter', 'Supercar',
+# # 'Residential area', 'Road', 'Road surface', 'Sidewalk', 'Tarmac', 'Race track', 'Sport venue', 'Soil', 'Outdoor structure', 'Cartoon', 'Poster', 'Illustration',
+# # 'Transport', 'Walkway', 'Yard', 'Screenshot', 'Night', 'Lighting and Light', 'Drawing', 'Sketch', 'Stadium',
+# # 'Black-and-white', 'Monochrome', 'Monochrome photography', 'Black and White', 'Parking lot', 'Parking',
+# # 'Black', 'White', 'Darkness', 'Light', 'Text'] -%}
+# # {%- macro filter_unwanted(tags) -%}
+# # {%- set comma = joiner(',') -%}
+# # {%- for item in tags if item not in unwanted_tags -%}{{- comma() -}}{{- item -}}{% endfor %}{%- endmacro -%}
+# # {%- macro mapped_items(tags) -%}
+# # {%- set comma = joiner(',') -%}
+# # {%- for item in tags if item not in tag_map -%}{{- comma() -}}{{- item -}}
+# # {%- endfor -%}
+# # {%- for item in tags if item in tag_map -%}{{- comma() -}}{{- tag_map[item] -}}{%- endfor -%}
+# # {%- endmacro -%}
+# # {% macro get_final_output(output_list) %}
+# # {%- for x in output_list if x != "" -%}
+# # {%- if loop.first %}{% elif loop.last %},{% else %},{% endif -%}{{- x -}}
+# # {%- endfor -%}
+# # {% endmacro %}
+# # {%- set result = filter_unwanted(attribs| map(attribute='name')|list).split(',') -%}
+# # {%- set output = get_final_output(mapped_items(result).split(',') | unique|list) -%}
+# # {{- "Clear" if output |trim == "" else output -}}
+# # {% endif %}
+# # icon_template: mdi:cctv
- # - platform: template
- # sensors:
- # driveway_camera_objects:
- # value_template: >-
- # {%- set attribs = state_attr('image_processing.tagbox_driveway_camera', 'tags') -%}
- # {%- if None != attribs -%}
- # {%- set tag_map = {'Vehicle':'Car', 'Sedan':'Car', 'Luxury vehicle':'Car', 'Driving':'Car',
- # 'Wheel':'Car', 'Automotive design':'Car', 'Automotive exterior':'Car',
- # 'Transport':'Car', 'Sports car':'Car', 'Land vehicle':'Car','Supercar':'Car',
- # 'Waterway':'Rain', 'Super car': 'Car'
- # } -%}
- # {%- set unwanted_tags = ['Asphalt', 'Backyard', 'City', 'Estate', 'Flower', 'Garden', 'Grass', 'Tree', 'Car', 'Vehicle', 'Suburb', 'Street',
- # 'Highway', 'Infrastructure', 'Lane', 'Lawn', 'Neighbourhood', 'Public space', 'Super car', 'Sport venue', 'Supercar',
- # 'Residential area', 'Road', 'Road surface', 'Sidewalk', 'Tarmac', 'Race track', 'Snow', 'Winter', 'Soil', 'Outdoor structure', 'Cartoon', 'Poster', 'Illustration',
- # 'Transport', 'Walkway', 'Yard', 'Screenshot', 'Night', 'Lighting and Light', 'Drawing', 'Sketch', 'Stadium',
- # 'Black-and-white', 'Monochrome', 'Monochrome photography', 'Black and White',
- # 'Black', 'White', 'Darkness', 'Light', 'Text'] -%}
- # {%- macro filter_unwanted(tags) -%}
- # {%- set comma = joiner(',') -%}
- # {%- for item in tags if item not in unwanted_tags -%}{{- comma() -}}{{- item -}}{% endfor %}{%- endmacro -%}
- # {%- macro mapped_items(tags) -%}
- # {%- set comma = joiner(',') -%}
- # {%- for item in tags if item not in tag_map -%}{{- comma() -}}{{- item -}}
- # {%- endfor -%}
- # {%- for item in tags if item in tag_map -%}{{- comma() -}}{{- tag_map[item] -}}{%- endfor -%}
- # {%- endmacro -%}
- # {% macro get_final_output(output_list) %}
- # {%- for x in output_list if x != "" -%}
- # {%- if loop.first %}{% elif loop.last %},{% else %},{% endif -%}{{- x -}}
- # {%- endfor -%}
- # {% endmacro %}
- # {%- set result = filter_unwanted(attribs| map(attribute='name')|list).split(',') -%}
- # {%- set output = get_final_output(mapped_items(result).split(',') | unique|list) -%}
- # {{- "Clear" if output |trim == "" else output -}}
- # {% endif %}
- # icon_template: mdi:cctv
+# # - platform: template
+# # sensors:
+# # driveway_camera_objects:
+# # value_template: >-
+# # {%- set attribs = state_attr('image_processing.tagbox_driveway_camera', 'tags') -%}
+# # {%- if None != attribs -%}
+# # {%- set tag_map = {'Vehicle':'Car', 'Sedan':'Car', 'Luxury vehicle':'Car', 'Driving':'Car',
+# # 'Wheel':'Car', 'Automotive design':'Car', 'Automotive exterior':'Car',
+# # 'Transport':'Car', 'Sports car':'Car', 'Land vehicle':'Car','Supercar':'Car',
+# # 'Waterway':'Rain', 'Super car': 'Car'
+# # } -%}
+# # {%- set unwanted_tags = ['Asphalt', 'Backyard', 'City', 'Estate', 'Flower', 'Garden', 'Grass', 'Tree', 'Car', 'Vehicle', 'Suburb', 'Street',
+# # 'Highway', 'Infrastructure', 'Lane', 'Lawn', 'Neighbourhood', 'Public space', 'Super car', 'Sport venue', 'Supercar',
+# # 'Residential area', 'Road', 'Road surface', 'Sidewalk', 'Tarmac', 'Race track', 'Snow', 'Winter', 'Soil', 'Outdoor structure', 'Cartoon', 'Poster', 'Illustration',
+# # 'Transport', 'Walkway', 'Yard', 'Screenshot', 'Night', 'Lighting and Light', 'Drawing', 'Sketch', 'Stadium',
+# # 'Black-and-white', 'Monochrome', 'Monochrome photography', 'Black and White',
+# # 'Black', 'White', 'Darkness', 'Light', 'Text'] -%}
+# # {%- macro filter_unwanted(tags) -%}
+# # {%- set comma = joiner(',') -%}
+# # {%- for item in tags if item not in unwanted_tags -%}{{- comma() -}}{{- item -}}{% endfor %}{%- endmacro -%}
+# # {%- macro mapped_items(tags) -%}
+# # {%- set comma = joiner(',') -%}
+# # {%- for item in tags if item not in tag_map -%}{{- comma() -}}{{- item -}}
+# # {%- endfor -%}
+# # {%- for item in tags if item in tag_map -%}{{- comma() -}}{{- tag_map[item] -}}{%- endfor -%}
+# # {%- endmacro -%}
+# # {% macro get_final_output(output_list) %}
+# # {%- for x in output_list if x != "" -%}
+# # {%- if loop.first %}{% elif loop.last %},{% else %},{% endif -%}{{- x -}}
+# # {%- endfor -%}
+# # {% endmacro %}
+# # {%- set result = filter_unwanted(attribs| map(attribute='name')|list).split(',') -%}
+# # {%- set output = get_final_output(mapped_items(result).split(',') | unique|list) -%}
+# # {{- "Clear" if output |trim == "" else output -}}
+# # {% endif %}
+# # icon_template: mdi:cctv
- # - platform: template
- # sensors:
- # patio_camera_objects:
- # value_template: >-
- # {% set attribs = state_attr('image_processing.tagbox_patio_camera', 'tags') %}
- # {%- if None != attribs -%}
- # {%- set tag_map = {'Waterway':'Rain'} -%}
- # {%- set unwanted_tags = ['Asphalt', 'Backyard', 'City', 'Estate', 'Flower', 'Garden', 'Grass', 'Tree', 'Vehicle','Driving', 'Transport', 'Car', 'Vehicle', 'Suburb', 'Street',
- # 'Highway', 'Infrastructure', 'Lane', 'Lawn', 'Neighbourhood', 'Public space', 'Car', 'Wheel', 'Sports car','Super car', 'Sport venue', 'Outdoor structure', 'Cartoon', 'Poster', 'Illustration',
- # 'Residential area', 'Road', 'Road surface', 'Sidewalk', 'Tarmac', 'Race track', 'Sedan', 'Automotive design', 'Snow', 'Winter', 'Soil', 'Stadium',
- # 'Transport', 'Walkway', 'Yard', 'Screenshot', 'Night', 'Lighting and Light', 'Luxury vehicle', 'Automotive exterior', 'Drawing', 'Sketch',
- # 'Black-and-white', 'Monochrome', 'Monochrome photography', 'Black and White', 'Black', 'White', 'Light', 'Text'] -%}
- # {%- macro filter_unwanted(tags) -%}
- # {%- set comma = joiner(',') -%}
- # {%- for item in tags if item not in unwanted_tags -%}{{- comma() -}}{{- item -}}{% endfor %}{%- endmacro -%}
- # {%- macro mapped_items(tags) -%}
- # {%- set comma = joiner(',') -%}
- # {%- for item in tags if item not in tag_map -%}{{- comma() -}}{{- item -}}
- # {%- endfor -%}
- # {%- for item in tags if item in tag_map -%}{{- comma() -}}{{- tag_map[item] -}}{%- endfor -%}
- # {%- endmacro -%}
- # {% macro get_final_output(output_list) %}
- # {%- for x in output_list if x != "" -%}
- # {%- if loop.first %}{% elif loop.last %},{% else %},{% endif -%}{{- x -}}
- # {%- endfor -%}
- # {% endmacro %}
- # {%- set result = filter_unwanted(attribs| map(attribute='name')|list).split(',') -%}
- # {%- set output = get_final_output(mapped_items(result).split(',') | unique|list) -%}
- # {{- "Clear" if output |trim == "" else output -}}
- # {% endif %}
- # icon_template: mdi:cctv
+# # - platform: template
+# # sensors:
+# # patio_camera_objects:
+# # value_template: >-
+# # {% set attribs = state_attr('image_processing.tagbox_patio_camera', 'tags') %}
+# # {%- if None != attribs -%}
+# # {%- set tag_map = {'Waterway':'Rain'} -%}
+# # {%- set unwanted_tags = ['Asphalt', 'Backyard', 'City', 'Estate', 'Flower', 'Garden', 'Grass', 'Tree', 'Vehicle','Driving', 'Transport', 'Car', 'Vehicle', 'Suburb', 'Street',
+# # 'Highway', 'Infrastructure', 'Lane', 'Lawn', 'Neighbourhood', 'Public space', 'Car', 'Wheel', 'Sports car','Super car', 'Sport venue', 'Outdoor structure', 'Cartoon', 'Poster', 'Illustration',
+# # 'Residential area', 'Road', 'Road surface', 'Sidewalk', 'Tarmac', 'Race track', 'Sedan', 'Automotive design', 'Snow', 'Winter', 'Soil', 'Stadium',
+# # 'Transport', 'Walkway', 'Yard', 'Screenshot', 'Night', 'Lighting and Light', 'Luxury vehicle', 'Automotive exterior', 'Drawing', 'Sketch',
+# # 'Black-and-white', 'Monochrome', 'Monochrome photography', 'Black and White', 'Black', 'White', 'Light', 'Text'] -%}
+# # {%- macro filter_unwanted(tags) -%}
+# # {%- set comma = joiner(',') -%}
+# # {%- for item in tags if item not in unwanted_tags -%}{{- comma() -}}{{- item -}}{% endfor %}{%- endmacro -%}
+# # {%- macro mapped_items(tags) -%}
+# # {%- set comma = joiner(',') -%}
+# # {%- for item in tags if item not in tag_map -%}{{- comma() -}}{{- item -}}
+# # {%- endfor -%}
+# # {%- for item in tags if item in tag_map -%}{{- comma() -}}{{- tag_map[item] -}}{%- endfor -%}
+# # {%- endmacro -%}
+# # {% macro get_final_output(output_list) %}
+# # {%- for x in output_list if x != "" -%}
+# # {%- if loop.first %}{% elif loop.last %},{% else %},{% endif -%}{{- x -}}
+# # {%- endfor -%}
+# # {% endmacro %}
+# # {%- set result = filter_unwanted(attribs| map(attribute='name')|list).split(',') -%}
+# # {%- set output = get_final_output(mapped_items(result).split(',') | unique|list) -%}
+# # {{- "Clear" if output |trim == "" else output -}}
+# # {% endif %}
+# # icon_template: mdi:cctv
- # - platform: template
- # sensors:
- # playarea_camera_objects:
- # value_template: >-
- # {% set attribs = state_attr('image_processing.tagbox_playarea_camera', 'tags') %}
- # {%- if None != attribs -%}
- # {%- set tag_map = {'Waterway':'Rain'} -%}
- # {%- set unwanted_tags = ['Asphalt', 'Backyard', 'City', 'Estate', 'Flower', 'Garden', 'Grass', 'Tree', 'Vehicle','Driving', 'Transport', 'Car', 'Vehicle', 'Suburb', 'Street',
- # 'Highway', 'Infrastructure', 'Lane', 'Lawn', 'Neighbourhood', 'Public space', 'Car', 'Wheel', 'Sports car', 'Super car', 'Winter', 'Soil', 'Stadium',
- # 'Residential area', 'Road', 'Road surface', 'Sidewalk', 'Tarmac', 'Race track', 'Sedan', 'Automotive design', 'Snow', 'Sport venue', 'Outdoor structure', 'Cartoon', 'Poster', 'Illustration',
- # 'Transport', 'Walkway', 'Yard', 'Screenshot', 'Night', 'Lighting and Light', 'Luxury vehicle', 'Automotive exterior', 'Drawing', 'Sketch',
- # 'Black-and-white', 'Monochrome', 'Monochrome photography', 'Black and White', 'Black', 'White', 'Light', 'Text'] -%}
- # {%- macro filter_unwanted(tags) -%}
- # {%- set comma = joiner(',') -%}
- # {%- for item in tags if item not in unwanted_tags -%}{{- comma() -}}{{- item -}}{% endfor %}{%- endmacro -%}
- # {%- macro mapped_items(tags) -%}
- # {%- set comma = joiner(',') -%}
- # {%- for item in tags if item not in tag_map -%}{{- comma() -}}{{- item -}}{%- endfor -%}
- # {%- for item in tags if item in tag_map -%}{{- comma() -}}{{- tag_map[item] -}}{%- endfor -%}
- # {%- endmacro -%}
- # {% macro get_final_output(output_list) %}
- # {%- for x in output_list if x != "" -%}
- # {%- if loop.first %}{% elif loop.last %},{% else %},{% endif -%}{{- x -}}
- # {%- endfor -%}
- # {% endmacro %}
- # {%- set result = filter_unwanted(attribs| map(attribute='name')|list).split(',') -%}
- # {%- set output = get_final_output(mapped_items(result).split(',') | unique|list) -%}
- # {{- "Clear" if output |trim == "" else output -}}
- # {% endif %}
- # icon_template: mdi:cctv
+# # - platform: template
+# # sensors:
+# # playarea_camera_objects:
+# # value_template: >-
+# # {% set attribs = state_attr('image_processing.tagbox_playarea_camera', 'tags') %}
+# # {%- if None != attribs -%}
+# # {%- set tag_map = {'Waterway':'Rain'} -%}
+# # {%- set unwanted_tags = ['Asphalt', 'Backyard', 'City', 'Estate', 'Flower', 'Garden', 'Grass', 'Tree', 'Vehicle','Driving', 'Transport', 'Car', 'Vehicle', 'Suburb', 'Street',
+# # 'Highway', 'Infrastructure', 'Lane', 'Lawn', 'Neighbourhood', 'Public space', 'Car', 'Wheel', 'Sports car', 'Super car', 'Winter', 'Soil', 'Stadium',
+# # 'Residential area', 'Road', 'Road surface', 'Sidewalk', 'Tarmac', 'Race track', 'Sedan', 'Automotive design', 'Snow', 'Sport venue', 'Outdoor structure', 'Cartoon', 'Poster', 'Illustration',
+# # 'Transport', 'Walkway', 'Yard', 'Screenshot', 'Night', 'Lighting and Light', 'Luxury vehicle', 'Automotive exterior', 'Drawing', 'Sketch',
+# # 'Black-and-white', 'Monochrome', 'Monochrome photography', 'Black and White', 'Black', 'White', 'Light', 'Text'] -%}
+# # {%- macro filter_unwanted(tags) -%}
+# # {%- set comma = joiner(',') -%}
+# # {%- for item in tags if item not in unwanted_tags -%}{{- comma() -}}{{- item -}}{% endfor %}{%- endmacro -%}
+# # {%- macro mapped_items(tags) -%}
+# # {%- set comma = joiner(',') -%}
+# # {%- for item in tags if item not in tag_map -%}{{- comma() -}}{{- item -}}{%- endfor -%}
+# # {%- for item in tags if item in tag_map -%}{{- comma() -}}{{- tag_map[item] -}}{%- endfor -%}
+# # {%- endmacro -%}
+# # {% macro get_final_output(output_list) %}
+# # {%- for x in output_list if x != "" -%}
+# # {%- if loop.first %}{% elif loop.last %},{% else %},{% endif -%}{{- x -}}
+# # {%- endfor -%}
+# # {% endmacro %}
+# # {%- set result = filter_unwanted(attribs| map(attribute='name')|list).split(',') -%}
+# # {%- set output = get_final_output(mapped_items(result).split(',') | unique|list) -%}
+# # {{- "Clear" if output |trim == "" else output -}}
+# # {% endif %}
+# # icon_template: mdi:cctv
- # - platform: template
- # sensors:
- # garage_camera_objects:
- # value_template: >-
- # {% set attribs = state_attr('image_processing.tagbox_garage_camera', 'tags') %}
- # {%- if None != attribs -%}
- # {%- set tag_map = {'Waterway':'Rain'} -%}
- # {%- set unwanted_tags = ['Asphalt', 'Backyard', 'City', 'Estate', 'Flower', 'Garden', 'Grass', 'Tree', 'Driving', 'Transport', 'Suburb', 'Street',
- # 'Highway', 'Infrastructure', 'Lane', 'Lawn', 'Neighbourhood', 'Public space', 'Winter', 'Soil', 'Stadium',
- # 'Residential area', 'Road', 'Road surface', 'Sidewalk', 'Tarmac', 'Race track', 'Sedan', 'Automotive design', 'Snow', 'Sport venue', 'Outdoor structure', 'Cartoon', 'Poster', 'Illustration',
- # 'Transport', 'Walkway', 'Yard', 'Screenshot', 'Night', 'Lighting and Light', 'Luxury vehicle', 'Automotive exterior', 'Drawing', 'Sketch',
- # 'Black-and-white', 'Monochrome', 'Monochrome photography', 'Black and White', 'Black', 'White', 'Light', 'Text'] -%}
- # {%- macro filter_unwanted(tags) -%}
- # {%- set comma = joiner(',') -%}
- # {%- for item in tags if item not in unwanted_tags -%}{{- comma() -}}{{- item -}}{% endfor %}{%- endmacro -%}
- # {%- macro mapped_items(tags) -%}
- # {%- set comma = joiner(',') -%}
- # {%- for item in tags if item not in tag_map -%}{{- comma() -}}{{- item -}}{%- endfor -%}
- # {%- for item in tags if item in tag_map -%}{{- comma() -}}{{- tag_map[item] -}}{%- endfor -%}
- # {%- endmacro -%}
- # {% macro get_final_output(output_list) %}
- # {%- for x in output_list if x != "" -%}
- # {%- if loop.first %}{% elif loop.last %},{% else %},{% endif -%}{{- x -}}
- # {%- endfor -%}
- # {% endmacro %}
- # {%- set result = filter_unwanted(attribs| map(attribute='name')|list).split(',') -%}
- # {%- set output = get_final_output(mapped_items(result).split(',') | unique|list) -%}
- # {{- "Clear" if output |trim == "" else output -}}
- # {% endif %}
- # icon_template: mdi:cctv
+# # - platform: template
+# # sensors:
+# # garage_camera_objects:
+# # value_template: >-
+# # {% set attribs = state_attr('image_processing.tagbox_garage_camera', 'tags') %}
+# # {%- if None != attribs -%}
+# # {%- set tag_map = {'Waterway':'Rain'} -%}
+# # {%- set unwanted_tags = ['Asphalt', 'Backyard', 'City', 'Estate', 'Flower', 'Garden', 'Grass', 'Tree', 'Driving', 'Transport', 'Suburb', 'Street',
+# # 'Highway', 'Infrastructure', 'Lane', 'Lawn', 'Neighbourhood', 'Public space', 'Winter', 'Soil', 'Stadium',
+# # 'Residential area', 'Road', 'Road surface', 'Sidewalk', 'Tarmac', 'Race track', 'Sedan', 'Automotive design', 'Snow', 'Sport venue', 'Outdoor structure', 'Cartoon', 'Poster', 'Illustration',
+# # 'Transport', 'Walkway', 'Yard', 'Screenshot', 'Night', 'Lighting and Light', 'Luxury vehicle', 'Automotive exterior', 'Drawing', 'Sketch',
+# # 'Black-and-white', 'Monochrome', 'Monochrome photography', 'Black and White', 'Black', 'White', 'Light', 'Text'] -%}
+# # {%- macro filter_unwanted(tags) -%}
+# # {%- set comma = joiner(',') -%}
+# # {%- for item in tags if item not in unwanted_tags -%}{{- comma() -}}{{- item -}}{% endfor %}{%- endmacro -%}
+# # {%- macro mapped_items(tags) -%}
+# # {%- set comma = joiner(',') -%}
+# # {%- for item in tags if item not in tag_map -%}{{- comma() -}}{{- item -}}{%- endfor -%}
+# # {%- for item in tags if item in tag_map -%}{{- comma() -}}{{- tag_map[item] -}}{%- endfor -%}
+# # {%- endmacro -%}
+# # {% macro get_final_output(output_list) %}
+# # {%- for x in output_list if x != "" -%}
+# # {%- if loop.first %}{% elif loop.last %},{% else %},{% endif -%}{{- x -}}
+# # {%- endfor -%}
+# # {% endmacro %}
+# # {%- set result = filter_unwanted(attribs| map(attribute='name')|list).split(',') -%}
+# # {%- set output = get_final_output(mapped_items(result).split(',') | unique|list) -%}
+# # {{- "Clear" if output |trim == "" else output -}}
+# # {% endif %}
+# # icon_template: mdi:cctv
-automation:
+# automation:
- - alias: Alert Family Member Activity
- trigger:
- - platform: state
- entity_id:
- - sensor.frontdoor_camera_people
- - sensor.driveway_camera_people
- - sensor.patio_camera_people
- - sensor.playarea_camera_people
- - sensor.garage_camera_people
- condition:
- - condition: template
- value_template: "{{ states('input_boolean.notify_camera_alerts') == 'on' }}"
- - condition: template
- value_template: '{{ trigger.to_state.state | trim != "" and
- trigger.to_state.state | lower | trim != "unknown" and
- trigger.to_state.state | lower | trim != "clear" }}'
- action:
- - service: script.notify_me
- data_template:
- message: >-
- {% set camera_name = states['camera'][trigger.entity_id.split('.')[1].split('_')[0] ~ '_camera'].attributes.friendly_name %}
- {{ trigger.to_state.state }} is at the {{ camera_name }}.
+# - alias: Alert Family Member Activity
+# trigger:
+# - platform: state
+# entity_id:
+# - sensor.frontdoor_camera_people
+# - sensor.driveway_camera_people
+# - sensor.patio_camera_people
+# - sensor.playarea_camera_people
+# - sensor.garage_camera_people
+# condition:
+# - condition: template
+# value_template: "{{ states('input_boolean.notify_camera_alerts') == 'on' }}"
+# - condition: template
+# value_template: '{{ trigger.to_state.state | trim != "" and
+# trigger.to_state.state | lower | trim != "unknown" and
+# trigger.to_state.state | lower | trim != "clear" }}'
+# action:
+# - service: script.notify_me
+# data_template:
+# message: >-
+# {% set camera_name = states['camera'][trigger.entity_id.split('.')[1].split('_')[0] ~ '_camera'].attributes.friendly_name %}
+# {{ trigger.to_state.state }} is at the {{ camera_name }}.
- # - alias: Alert Object Activity
- # trigger:
- # - platform: state
- # entity_id:
- # - sensor.frontdoor_camera_objects
- # - sensor.driveway_camera_objects
- # - sensor.patio_camera_objects
- # - sensor.playarea_camera_objects
- # - sensor.garage_camera_objects
- # condition:
- # - condition: template
- # value_template: "{{ states('input_boolean.notify_camera_alerts') == 'on' }}"
- # - condition: template
- # value_template: '{{ trigger.to_state.state | trim != "" and
- # trigger.to_state.state | lower | trim != "unknown" and
- # trigger.to_state.state | lower | trim != "clear" }}'
- # action:
- # - service: script.notify_me
- # data_template:
- # message: >-
- # {% set camera_name = states['camera'][trigger.entity_id.split('.')[1].split('_')[0] ~ '_camera'].attributes.friendly_name %}
- # {{ trigger.to_state.state }} detected at the {{ camera_name }}.
+# # - alias: Alert Object Activity
+# # trigger:
+# # - platform: state
+# # entity_id:
+# # - sensor.frontdoor_camera_objects
+# # - sensor.driveway_camera_objects
+# # - sensor.patio_camera_objects
+# # - sensor.playarea_camera_objects
+# # - sensor.garage_camera_objects
+# # condition:
+# # - condition: template
+# # value_template: "{{ states('input_boolean.notify_camera_alerts') == 'on' }}"
+# # - condition: template
+# # value_template: '{{ trigger.to_state.state | trim != "" and
+# # trigger.to_state.state | lower | trim != "unknown" and
+# # trigger.to_state.state | lower | trim != "clear" }}'
+# # action:
+# # - service: script.notify_me
+# # data_template:
+# # message: >-
+# # {% set camera_name = states['camera'][trigger.entity_id.split('.')[1].split('_')[0] ~ '_camera'].attributes.friendly_name %}
+# # {{ trigger.to_state.state }} detected at the {{ camera_name }}.
-#
-# This automation basically scans image and keeps a count of people from each camera view and notifies using iOS notification
-# There is another automation that alerts in the house (using TTS) based on the data
-#
- - alias: Scan People and Objects
- initial_state: true
- trigger:
- - platform: state
- entity_id:
- - binary_sensor.frontdoor_camera_motion
- - binary_sensor.driveway_camera_motion
- - binary_sensor.patio_camera_motion
- - binary_sensor.playarea_camera_motion
- - binary_sensor.frontdoor_camera_field_detection
- - binary_sensor.driveway_camera_field_detection
- - binary_sensor.patio_camera_field_detection
- - binary_sensor.playarea_camera_field_detection
- - binary_sensor.frontdoor_camera_line_crossing
- - binary_sensor.driveway_camera_line_crossing
- - binary_sensor.patio_camera_line_crossing
- - binary_sensor.playarea_camera_line_crossing
- - binary_sensor.garage_motion
- to: 'on'
- condition:
- - condition: template
- value_template: "{{ states('input_boolean.notify_camera_alerts') == 'on' }}"
- - condition: template
- value_template: >
- {% macro last_triggered(entity) %}
- {% set time_in_seconds = 30 %}
- {{ ( (as_timestamp(now()) - as_timestamp(states["binary_sensor"][entity].attributes.last_tripped_time)))|round|abs < time_in_seconds }}
- {% endmacro %}
- {{ last_triggered(trigger.entity_id.split('.')[1].split('_')[0] ~ '_camera_motion')}}
- action:
- - service: image_processing.scan
- data_template:
- entity_id: "image_processing.facebox_{{- trigger.entity_id.split('.')[1].split('_')[0] -}}_camera"
- # - service: image_processing.scan
- # data_template:
- # entity_id: "image_processing.tagbox_{{- trigger.entity_id.split('.')[1].split('_')[0] -}}_camera"
+# #
+# # This automation basically scans image and keeps a count of people from each camera view and notifies using iOS notification
+# # There is another automation that alerts in the house (using TTS) based on the data
+# #
+# - alias: Scan People and Objects
+# initial_state: true
+# trigger:
+# - platform: state
+# entity_id:
+# - binary_sensor.frontdoor_camera_motion
+# - binary_sensor.driveway_camera_motion
+# - binary_sensor.patio_camera_motion
+# - binary_sensor.playarea_camera_motion
+# - binary_sensor.frontdoor_camera_field_detection
+# - binary_sensor.driveway_camera_field_detection
+# - binary_sensor.patio_camera_field_detection
+# - binary_sensor.playarea_camera_field_detection
+# - binary_sensor.frontdoor_camera_line_crossing
+# - binary_sensor.driveway_camera_line_crossing
+# - binary_sensor.patio_camera_line_crossing
+# - binary_sensor.playarea_camera_line_crossing
+# - binary_sensor.garage_motion
+# to: 'on'
+# condition:
+# - condition: template
+# value_template: "{{ states('input_boolean.notify_camera_alerts') == 'on' }}"
+# - condition: template
+# value_template: >
+# {% macro last_triggered(entity) %}
+# {% set time_in_seconds = 30 %}
+# {{ ( (as_timestamp(now()) - as_timestamp(states["binary_sensor"][entity].attributes.last_tripped_time)))|round|abs < time_in_seconds }}
+# {% endmacro %}
+# {{ last_triggered(trigger.entity_id.split('.')[1].split('_')[0] ~ '_camera_motion')}}
+# action:
+# - service: image_processing.scan
+# data_template:
+# entity_id: "image_processing.facebox_{{- trigger.entity_id.split('.')[1].split('_')[0] -}}_camera"
+# # - service: image_processing.scan
+# # data_template:
+# # entity_id: "image_processing.tagbox_{{- trigger.entity_id.split('.')[1].split('_')[0] -}}_camera"
diff --git a/packages/daily_routines.yaml b/packages/daily_routines.yaml
index d2c96b4..e76b93a 100644
--- a/packages/daily_routines.yaml
+++ b/packages/daily_routines.yaml
@@ -1,69 +1,68 @@
###############################################################################
# @author : Mahasri Kalavala
# @date : 04/15/2017
-# @package : Daily Light Routine around the house
+# @package : Daily Light Routine around the house
# @description : Daily light routine stuff
###############################################################################
automation:
-
-# ÛÛÛÛÛÛ ÛÛÛÛÛÛ ÛÛÛ
-# °°ÛÛÛÛÛÛ ÛÛÛÛÛÛ °°°
-# °ÛÛÛ°ÛÛÛÛÛ°ÛÛÛ ÛÛÛÛÛÛ ÛÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛ
-# °ÛÛÛ°°ÛÛÛ °ÛÛÛ ÛÛÛ°°ÛÛÛ°°ÛÛÛ°°ÛÛÛ°°ÛÛÛ°°ÛÛÛ °°ÛÛÛ °°ÛÛÛ°°ÛÛÛ ÛÛÛ°°ÛÛÛ
-# °ÛÛÛ °°° °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °°° °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ
-# °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ
-# ÛÛÛÛÛ ÛÛÛÛÛ°°ÛÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛ°°ÛÛÛÛÛÛÛ
-# °°°°° °°°°° °°°°°° °°°°° °°°° °°°°° °°°°° °°°° °°°°° °°°°°ÛÛÛ
-# ÛÛÛ °ÛÛÛ
-# °°ÛÛÛÛÛÛ
-# °°°°°°
-###############################################################################
-# Turn Indoor lights ON only during weekdays
-###############################################################################
+ # ÛÛÛÛÛÛ ÛÛÛÛÛÛ ÛÛÛ
+ # °°ÛÛÛÛÛÛ ÛÛÛÛÛÛ °°°
+ # °ÛÛÛ°ÛÛÛÛÛ°ÛÛÛ ÛÛÛÛÛÛ ÛÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛ
+ # °ÛÛÛ°°ÛÛÛ °ÛÛÛ ÛÛÛ°°ÛÛÛ°°ÛÛÛ°°ÛÛÛ°°ÛÛÛ°°ÛÛÛ °°ÛÛÛ °°ÛÛÛ°°ÛÛÛ ÛÛÛ°°ÛÛÛ
+ # °ÛÛÛ °°° °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °°° °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ
+ # °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ
+ # ÛÛÛÛÛ ÛÛÛÛÛ°°ÛÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛ°°ÛÛÛÛÛÛÛ
+ # °°°°° °°°°° °°°°°° °°°°° °°°° °°°°° °°°°° °°°° °°°°° °°°°°ÛÛÛ
+ # ÛÛÛ °ÛÛÛ
+ # °°ÛÛÛÛÛÛ
+ # °°°°°°
+ ###############################################################################
+ # Turn Indoor lights ON only during weekdays
+ ###############################################################################
- alias: Morning Indoor Lights ON
initial_state: true
trigger:
platform: time_pattern
- minutes: '/5'
+ minutes: "/5"
seconds: 00
condition:
- condition: state
- entity_id: 'binary_sensor.workday_sensor'
- state: 'on'
+ entity_id: "binary_sensor.workday_sensor"
+ state: "on"
- condition: template
- value_template: '{{ states.sensor.wakeup_hour.state |int == now().hour |int }}'
+ value_template: "{{ states('sensor.wakeup_hour') |int == now().hour |int }}"
- condition: template
- value_template: '{{ states.sensor.wakeup_minute.state|int == now().minute|int }}'
+ value_template: "{{ states('sensor.wakeup_minute') |int == now().minute|int }}"
- condition: state
entity_id: input_boolean.light_automations
- state: 'on'
+ state: "on"
action:
- service: switch.turn_on
data:
entity_id: switch.kitchen
-###############################################################################
-# Turn ON Master Bedroom lights ON in the morning
-# Turn On Bedroom Lights 10 minutes after wake up time
-###############################################################################
+ ###############################################################################
+ # Turn ON Master Bedroom lights ON in the morning
+ # Turn On Bedroom Lights 10 minutes after wake up time
+ ###############################################################################
- alias: Morning Master Bedroom Lights ON (Mallika)
initial_state: true
trigger:
platform: time_pattern
- minutes: '/5'
+ minutes: "/5"
seconds: 00
condition:
- condition: state
- entity_id: 'binary_sensor.workday_sensor'
- state: 'on'
+ entity_id: "binary_sensor.workday_sensor"
+ state: "on"
- condition: template
- value_template: '{{ states.sensor.wakeup_hour.state |int == now().hour|int }}'
+ value_template: "{{ states('sensor.wakeup_hour') |int == now().hour|int }}"
- condition: template
- value_template: '{{ now().minute | int == (states.sensor.wakeup_minute.state | int + 10) }}'
+ value_template: "{{ now().minute | int == (states('sensor.wakeup_minute') | int + 10) }}"
- condition: state
entity_id: input_boolean.light_automations
- state: 'on'
+ state: "on"
action:
- service: light.turn_on
data:
@@ -76,113 +75,113 @@ automation:
initial_state: true
trigger:
platform: time_pattern
- minutes: '/5'
+ minutes: "/5"
seconds: 00
condition:
- condition: state
- entity_id: 'binary_sensor.workday_sensor'
- state: 'on'
+ entity_id: "binary_sensor.workday_sensor"
+ state: "on"
- condition: template
- value_template: '{{ states.sensor.wakeup_hour.state|int == now().hour|int }}'
+ value_template: "{{ states('sensor.wakeup_hour') |int == now().hour|int }}"
- condition: template
- value_template: '{{ now().minute|int == (states.sensor.wakeup_minute.state|int + 15) }}'
+ value_template: "{{ now().minute|int == (states('sensor.wakeup_minute') |int + 15) }}"
- condition: state
entity_id: input_boolean.light_automations
- state: 'on'
+ state: "on"
action:
- service: light.turn_off
data:
entity_id: light.master_bedroom_2
-###############################################################################
-# Turn off outdoor lights 15 minutes after sunrise
-###############################################################################
+ ###############################################################################
+ # Turn off outdoor lights 15 minutes after sunrise
+ ###############################################################################
- alias: Morning Outdoor Lights OFF
initial_state: true
trigger:
platform: sun
event: sunrise
- offset: '00:15:00'
+ offset: "00:15:00"
condition:
- condition: state
entity_id: input_boolean.light_automations
- state: 'on'
+ state: "on"
action:
- service: switch.turn_off
entity_id: switch.frontyard_light
- service: switch.turn_off
entity_id: switch.wemobackyardlightswitch
-###############################################################################
-# Turn OF Kitchen Lights after 3 hours of wake up time during school/work days
-###############################################################################
+ ###############################################################################
+ # Turn OF Kitchen Lights after 3 hours of wake up time during school/work days
+ ###############################################################################
- alias: Morning Kitchen Light OFF
initial_state: true
trigger:
platform: time_pattern
- minutes: '/5'
+ minutes: "/5"
seconds: 00
condition:
- condition: state
- entity_id: 'binary_sensor.workday_sensor'
- state: 'on'
+ entity_id: "binary_sensor.workday_sensor"
+ state: "on"
- condition: template
- value_template: '{{ now().hour|int == (states.sensor.wakeup_hour.state|int + 3) }}'
+ value_template: "{{ now().hour|int == (states('sensor.wakeup_hour') |int + 3) }}"
- condition: template
- value_template: '{{ states.sensor.wakeup_minute.state|int == now().minute|int }}'
+ value_template: "{{ states('sensor.wakeup_minute') |int == now().minute|int }}"
- condition: state
entity_id: input_boolean.light_automations
- state: 'on'
+ state: "on"
action:
- - service: switch.turn_off
- entity_id: switch.kitchen
+ - service: switch.turn_off
+ entity_id: switch.kitchen
-# ÛÛÛÛÛÛÛÛÛÛ ÛÛÛ
-# °°ÛÛÛ°°°°°Û °°°
-# °ÛÛÛ Û ° ÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛÛ ÛÛÛÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛ
-# °ÛÛÛÛÛÛ °°ÛÛÛ °°ÛÛÛ ÛÛÛ°°ÛÛÛ°°ÛÛÛ°°ÛÛÛ °°ÛÛÛ °°ÛÛÛ°°ÛÛÛ ÛÛÛ°°ÛÛÛ
-# °ÛÛÛ°°Û °ÛÛÛ °ÛÛÛ °ÛÛÛÛÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ
-# °ÛÛÛ ° Û °°ÛÛÛ ÛÛÛ °ÛÛÛ°°° °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ
-# ÛÛÛÛÛÛÛÛÛÛ °°ÛÛÛÛÛ °°ÛÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛ°°ÛÛÛÛÛÛÛ
-# °°°°°°°°°° °°°°° °°°°°° °°°° °°°°° °°°°° °°°° °°°°° °°°°°ÛÛÛ
-# ÛÛÛ °ÛÛÛ
-# °°ÛÛÛÛÛÛ
-# °°°°°°
-###############################################################################
-# Turn outdoor lights on 15 minutes before sunset
-###############################################################################
+ # ÛÛÛÛÛÛÛÛÛÛ ÛÛÛ
+ # °°ÛÛÛ°°°°°Û °°°
+ # °ÛÛÛ Û ° ÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛÛ ÛÛÛÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛ
+ # °ÛÛÛÛÛÛ °°ÛÛÛ °°ÛÛÛ ÛÛÛ°°ÛÛÛ°°ÛÛÛ°°ÛÛÛ °°ÛÛÛ °°ÛÛÛ°°ÛÛÛ ÛÛÛ°°ÛÛÛ
+ # °ÛÛÛ°°Û °ÛÛÛ °ÛÛÛ °ÛÛÛÛÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ
+ # °ÛÛÛ ° Û °°ÛÛÛ ÛÛÛ °ÛÛÛ°°° °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ
+ # ÛÛÛÛÛÛÛÛÛÛ °°ÛÛÛÛÛ °°ÛÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛ°°ÛÛÛÛÛÛÛ
+ # °°°°°°°°°° °°°°° °°°°°° °°°° °°°°° °°°°° °°°° °°°°° °°°°°ÛÛÛ
+ # ÛÛÛ °ÛÛÛ
+ # °°ÛÛÛÛÛÛ
+ # °°°°°°
+ ###############################################################################
+ # Turn outdoor lights on 15 minutes before sunset
+ ###############################################################################
- alias: Evening Outdoor Lights ON (At Sunset)
initial_state: true
trigger:
platform: sun
event: sunset
- offset: '+00:00:00'
+ offset: "+00:00:00"
condition:
- condition: state
entity_id: input_boolean.light_automations
- state: 'on'
+ state: "on"
action:
- service: switch.turn_on
entity_id: switch.frontyard_light
- service: switch.turn_on
entity_id: switch.wemobackyardlightswitch
-###############################################################################
-# Turn indoor lights on 30 minutes before sunset
-###############################################################################
+ ###############################################################################
+ # Turn indoor lights on 30 minutes before sunset
+ ###############################################################################
- alias: Evening Indoor Lights ON Before Sunset
initial_state: true
trigger:
platform: sun
event: sunset
- offset: '-00:30:00'
+ offset: "-00:30:00"
condition:
- condition: state
entity_id: input_boolean.light_automations
- state: 'on'
+ state: "on"
- condition: state
entity_id: input_boolean.movie_time
- state: 'off'
+ state: "off"
action:
- service: switch.turn_on
data:
@@ -220,37 +219,37 @@ automation:
- service: switch.turn_on
entity_id: switch.kids_bed_accent
-# ÛÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛ
-# °°ÛÛÛÛÛÛ °°ÛÛÛ °°° °°ÛÛÛ °°ÛÛÛ
-# °ÛÛÛ°ÛÛÛ °ÛÛÛ ÛÛÛÛ ÛÛÛÛÛÛÛ °ÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛ
-# °ÛÛÛ°°ÛÛÛ°ÛÛÛ °°ÛÛÛ ÛÛÛ°°ÛÛÛ °ÛÛÛ°°ÛÛÛ °°°ÛÛÛ°
-# °ÛÛÛ °°ÛÛÛÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ
-# °ÛÛÛ °°ÛÛÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ ÛÛÛ
-# ÛÛÛÛÛ °°ÛÛÛÛÛ ÛÛÛÛÛ°°ÛÛÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛ °°ÛÛÛÛÛ
-# °°°°° °°°°° °°°°° °°°°°ÛÛÛ°°°° °°°°° °°°°°
-# ÛÛÛ °ÛÛÛ
-# °°ÛÛÛÛÛÛ
-# °°°°°°
-###############################################################################
-# Set the mood for bed time - Dim Family Room lights if they are ON
-###############################################################################
+ # ÛÛÛÛÛÛ ÛÛÛÛÛ ÛÛÛ ÛÛÛÛÛ ÛÛÛÛÛ
+ # °°ÛÛÛÛÛÛ °°ÛÛÛ °°° °°ÛÛÛ °°ÛÛÛ
+ # °ÛÛÛ°ÛÛÛ °ÛÛÛ ÛÛÛÛ ÛÛÛÛÛÛÛ °ÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛ
+ # °ÛÛÛ°°ÛÛÛ°ÛÛÛ °°ÛÛÛ ÛÛÛ°°ÛÛÛ °ÛÛÛ°°ÛÛÛ °°°ÛÛÛ°
+ # °ÛÛÛ °°ÛÛÛÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ
+ # °ÛÛÛ °°ÛÛÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ °ÛÛÛ ÛÛÛ
+ # ÛÛÛÛÛ °°ÛÛÛÛÛ ÛÛÛÛÛ°°ÛÛÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛÛ °°ÛÛÛÛÛ
+ # °°°°° °°°°° °°°°° °°°°°ÛÛÛ°°°° °°°°° °°°°°
+ # ÛÛÛ °ÛÛÛ
+ # °°ÛÛÛÛÛÛ
+ # °°°°°°
+ ###############################################################################
+ # Set the mood for bed time - Dim Family Room lights if they are ON
+ ###############################################################################
- alias: Night Dim TV Lights
initial_state: true
trigger:
platform: time_pattern
- minutes: '/5'
+ minutes: "/5"
seconds: 00
condition:
- condition: template
- value_template: '{{ states.sensor.bedtime_hour.state|int == now().hour|int }}'
+ value_template: "{{ states('sensor.bedtime_hour') |int == now().hour|int }}"
- condition: template
- value_template: '{{ (states.sensor.bedtime_minute.state|int - 15 ) == now().minute|int }}'
+ value_template: "{{ (states('sensor.bedtime_minute') |int - 15 ) == now().minute|int }}"
- condition: state
entity_id: light.family_room
- state: 'on'
+ state: "on"
- condition: state
entity_id: input_boolean.light_automations
- state: 'on'
+ state: "on"
action:
- service: light.turn_on
data:
@@ -259,42 +258,42 @@ automation:
color_temp: 154
transition: 15
-###############################################################################
-# TURN INDOOR LIGHTS OFF AFTER BED TIME
-###############################################################################
+ ###############################################################################
+ # TURN INDOOR LIGHTS OFF AFTER BED TIME
+ ###############################################################################
- alias: Night Turn Lights Off
initial_state: true
trigger:
platform: time_pattern
- minutes: '/5'
+ minutes: "/5"
seconds: 00
condition:
- condition: template
- value_template: '{{ states.sensor.bedtime_hour.state|int == now().hour|int }}'
+ value_template: "{{ states('sensor.bedtime_hour') |int == now().hour|int }}"
- condition: template
- value_template: '{{ states.sensor.bedtime_minute.state|int == now().minute|int }}'
+ value_template: "{{ states('sensor.bedtime_minute') |int == now().minute|int }}"
- condition: state
entity_id: input_boolean.light_automations
- state: 'on'
+ state: "on"
action:
- service: script.all_indoor_lights_off
- service: script.notify_me
- data:
+ data:
message: "It is bed time, turned lights off!"
-###############################################################################
-# Provide Bed time Report via TTS
-###############################################################################
+ ###############################################################################
+ # Provide Bed time Report via TTS
+ ###############################################################################
- alias: Night Bedtime Report
initial_state: true
trigger:
platform: time
- at: '22:10:00'
+ at: "22:10:00"
condition:
- condition: state
entity_id: group.all_devices
- state: 'home'
+ state: "home"
- condition: template
value_template: "{{ states('input_boolean.nightly_report') == 'on' }}"
action:
- - service: script.good_night_tts
\ No newline at end of file
+ - service: script.good_night_tts
diff --git a/packages/door_sensors.yaml b/packages/door_sensors.yaml
index 627af05..c88592c 100644
--- a/packages/door_sensors.yaml
+++ b/packages/door_sensors.yaml
@@ -1,20 +1,20 @@
homeassistant:
-
+
sensor:
- platform: template
sensors:
single_car_garage_door_sensor_status:
friendly_name: Single Car Garage Door Sensor Status
value_template: >-
- {% if states.binary_sensor.single_car_garage_door_tilt_sensor_sensor.state == 'on' %}
+ {% if states('binary_sensor.single_car_garage_door_tilt_sensor_sensor') == 'on' %}
Open
- {% elif states.binary_sensor.single_car_garage_door_tilt_sensor_sensor.state == 'off' %}
+ {% elif states('binary_sensor.single_car_garage_door_tilt_sensor_sensor') == 'off' %}
Closed
{% else %}
Unknown
{% endif %}
icon_template: >-
- {% set door_status = states.binary_sensor.single_car_garage_door_tilt_sensor_sensor.state |d('unknown') %}
+ {% set door_status = states('binary_sensor.single_car_garage_door_tilt_sensor_sensor') %}
{% if door_status == 'unknown' %}
mdi:alert-circle
{% else %}
@@ -24,21 +24,21 @@ sensor:
mdi:garage
{% endif %}
{% endif %}
-
+
- platform: template
sensors:
two_car_garage_door_sensor_status:
value_template: >-
- {% if states.binary_sensor.two_car_garage_door_tilt_sensor_sensor.state == 'on' %}
+ {% if states('binary_sensor.two_car_garage_door_tilt_sensor_sensor') == 'on' %}
Open
- {% elif states.binary_sensor.two_car_garage_door_tilt_sensor_sensor.state == 'off' %}
+ {% elif states('binary_sensor.two_car_garage_door_tilt_sensor_sensor') == 'off' %}
Closed
{% else %}
Unknown
{% endif %}
friendly_name: Double Car Garage Door Sensor Status
icon_template: >-
- {% set door_status = states.binary_sensor.two_car_garage_door_tilt_sensor_sensor.state |d('unknown') %}
+ {% set door_status = states('binary_sensor.two_car_garage_door_tilt_sensor_sensor') %}
{% if door_status == 'unknown' %}
mdi:alert-circle
{% else %}
@@ -54,51 +54,50 @@ binary_sensor:
state_topic: "/garage/motion"
name: "Garage Motion"
device_class: motion
- payload_on: 'on'
- payload_off: 'off'
+ payload_on: "on"
+ payload_off: "off"
value_template: "{{ value }}"
- platform: mqtt
state_topic: "/kitchen/motion"
name: "Kitchen Camera Motion"
device_class: motion
- payload_on: 'on'
- payload_off: 'off'
+ payload_on: "on"
+ payload_off: "off"
value_template: "{{ value }}"
- platform: mqtt
state_topic: "/frontroom/motion"
name: "Frontroom Camera Motion"
device_class: motion
- payload_on: 'on'
- payload_off: 'off'
+ payload_on: "on"
+ payload_off: "off"
value_template: "{{ value }}"
###############################################################################
-# _ _ _
-# /\ | | | | (_)
-# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
+# _ _ _
+# /\ | | | | (_)
+# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
# / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \/ __|
# / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | \__ \
# /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_|___/
-#
+#
###############################################################################
automation:
-
- alias: Garage Motion Reset
initial_state: true
trigger:
- platform: state
entity_id: binary_sensor.garage_motion
- to: 'on'
- from: 'off'
+ to: "on"
+ from: "off"
action:
- - delay: '00:00:30'
+ - delay: "00:00:30"
- service: mqtt.publish
data:
topic: "/garage/motion"
- payload: 'off'
+ payload: "off"
retain: false
- alias: Kitchen Camera Motion Reset
@@ -106,14 +105,14 @@ automation:
trigger:
- platform: state
entity_id: binary_sensor.kitchen_camera_motion
- to: 'on'
- from: 'off'
+ to: "on"
+ from: "off"
action:
- - delay: '00:00:30'
+ - delay: "00:00:30"
- service: mqtt.publish
data:
topic: "/kitchen/motion"
- payload: 'off'
+ payload: "off"
retain: false
- alias: Frontroom Camera Motion Reset
@@ -121,29 +120,29 @@ automation:
trigger:
- platform: state
entity_id: binary_sensor.frontroom_camera_motion
- to: 'on'
- from: 'off'
+ to: "on"
+ from: "off"
action:
- - delay: '00:00:30'
+ - delay: "00:00:30"
- service: mqtt.publish
data:
topic: "/frontroom/motion"
- payload: 'off'
+ payload: "off"
retain: false
-################################################################################
-# Notifies when either of the garage door is opened or closed
-# When the garage is opened, it sends an actionable ios notification with an
-# option to close the garage door. This iso actionable notification only occurs
-# when garage door is open and not when it is closed.
-###############################################################################
+ ################################################################################
+ # Notifies when either of the garage door is opened or closed
+ # When the garage is opened, it sends an actionable ios notification with an
+ # option to close the garage door. This iso actionable notification only occurs
+ # when garage door is open and not when it is closed.
+ ###############################################################################
- alias: Notify Garage Door Status
initial_state: true
trigger:
platform: state
- entity_id:
- - binary_sensor.two_car_garage_door_tilt_sensor_sensor
- - binary_sensor.single_car_garage_door_tilt_sensor_sensor
+ entity_id:
+ - binary_sensor.two_car_garage_door_tilt_sensor_sensor
+ - binary_sensor.single_car_garage_door_tilt_sensor_sensor
condition:
- condition: template
value_template: "{% if trigger.from_state %} True {% else %} False {% endif %}"
@@ -157,20 +156,20 @@ automation:
- service: script.notify_me
data_template:
message: >
- {% if trigger.to_state.state | lower == "on" %}
- {{ trigger.to_state.attributes.friendly_name }} is now OPENED!
- {% elif trigger.to_state.state | lower == "off" %}
- {{ trigger.to_state.attributes.friendly_name }} is now CLOSED!
- {% endif %}
+ {% if trigger.to_state.state | lower == "on" %}
+ {{ trigger.to_state.attributes.friendly_name }} is now OPENED!
+ {% elif trigger.to_state.state | lower == "off" %}
+ {{ trigger.to_state.attributes.friendly_name }} is now CLOSED!
+ {% endif %}
- service: script.voice_notify
data_template:
message: >
{% set doors = "" %}
- {% if states.binary_sensor.two_car_garage_door_tilt_sensor_sensor.state == "on" and
- states.binary_sensor.single_car_garage_door_tilt_sensor_sensor.state == "on" %}
+ {% if states('binary_sensor.two_car_garage_door_tilt_sensor_sensor') == "on" and
+ states('binary_sensor.single_car_garage_door_tilt_sensor_sensor') == "on" %}
{% set doors = "Atention! Both Garage Doors are OPEN" %}
- {% elif states.binary_sensor.two_car_garage_door_tilt_sensor_sensor.state == "off" and
- states.binary_sensor.single_car_garage_door_tilt_sensor_sensor.state == "off" %}
+ {% elif states('binary_sensor.two_car_garage_door_tilt_sensor_sensor') == "off" and
+ states('binary_sensor.single_car_garage_door_tilt_sensor_sensor') == "off" %}
{% set doors = "Both Garage Doors are now CLOSED" %}
{% else %}
{% if trigger.to_state.state | lower == "on" %}
@@ -184,32 +183,33 @@ automation:
- service: camera.snapshot
data_template:
entity_id: "camera.garage_camera"
- filename: "{{ '/home/homeassistant/.homeassistant/www/downloads/camera/garage/garage_' ~
- (states.automation.notify_garage_door_status.last_triggered ~ '').replace('-','_')
- .replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
+ filename:
+ "{{ '/home/homeassistant/.homeassistant/www/downloads/camera/garage/garage_' ~
+ (states.automation.notify_garage_door_status.last_triggered ~ '').replace('-','_')
+ .replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- 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.two_car_garage_door_tilt_sensor_sensor.state == "on" and
- states.binary_sensor.single_car_garage_door_tilt_sensor_sensor.state == "on" %}
+ {% if states('binary_sensor.two_car_garage_door_tilt_sensor_sensor') == "on" and
+ states('binary_sensor.single_car_garage_door_tilt_sensor_sensor') == "on" %}
{% set doors = "Both Garage Doors are OPEN" %}
- {% elif states.binary_sensor.two_car_garage_door_tilt_sensor_sensor.state == "off" and
- states.binary_sensor.single_car_garage_door_tilt_sensor_sensor.state == "off" %}
+ {% elif states('binary_sensor.two_car_garage_door_tilt_sensor_sensor') == "off" and
+ states('binary_sensor.single_car_garage_door_tilt_sensor_sensor') == "off" %}
{% set doors = "Both Garage Doors are CLOSED" %}
{% else %}
- {% set doors = states.binary_sensor.single_car_garage_door_tilt_sensor_sensor.name ~ " is " ~
- ('Closed' if states.binary_sensor.single_car_garage_door_tilt_sensor_sensor.state == 'off' else 'OPEN')
- ~ " and " ~ states.binary_sensor.two_car_garage_door_tilt_sensor_sensor.name ~ " is " ~
- ('Closed' if states.binary_sensor.two_car_garage_door_tilt_sensor_sensor.state == 'off' else 'OPEN') %}
+ {% set doors = states.binary_sensor.single_car_garage_door_tilt_sensor_sensor.name ~ " is " ~
+ ('Closed' if states('binary_sensor.single_car_garage_door_tilt_sensor_sensor') == 'off' else 'OPEN')
+ ~ " and " ~ states('binary_sensor.two_car_garage_door_tilt_sensor_sensor.name') ~ " is " ~
+ ('Closed' if states('binary_sensor.two_car_garage_door_tilt_sensor_sensor') == '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:
- - "{{ '/home/homeassistant/.homeassistant/www/downloads/camera/garage/garage_' ~
- (states.automation.notify_garage_door_status.last_triggered ~ '').replace('-','_')
- .replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
+ - "{{ '/home/homeassistant/.homeassistant/www/downloads/camera/garage/garage_' ~
+ (states.automation.notify_garage_door_status.last_triggered ~ '').replace('-','_')
+ .replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
- service_template: >
{% if trigger.to_state.state | lower == "on" %}
switch.turn_on
@@ -219,18 +219,18 @@ automation:
data:
entity_id: switch.garage
-################################################################################
-# When I open the garage door
-# if it is dark outside, OR
-# both the garage doors are closed
-# ==> turn the Garage lights ON, and start timer!
-################################################################################
+ ################################################################################
+ # When I open the garage door
+ # if it is dark outside, OR
+ # both the garage doors are closed
+ # ==> turn the Garage lights ON, and start timer!
+ ################################################################################
- alias: Garage Lights On When Door is Opened
initial_state: true
trigger:
platform: state
entity_id: binary_sensor.garage_door_sensor_sensor
- to: 'on'
+ to: "on"
condition:
condition: or
conditions:
@@ -239,22 +239,22 @@ automation:
- condition: and
conditions:
- condition: template
- value_template: "{{ states.binary_sensor.single_car_garage_door_tilt_sensor_sensor.state == 'off' }}"
+ value_template: "{{ states('binary_sensor.single_car_garage_door_tilt_sensor_sensor') == 'off' }}"
- condition: template
- value_template: "{{ states.binary_sensor.two_car_garage_door_tilt_sensor_sensor.state == 'off' }}"
+ value_template: "{{ states('binary_sensor.two_car_garage_door_tilt_sensor_sensor') == 'off' }}"
action:
- service: switch.turn_on
entity_id: switch.garage
- service: timer.start
entity_id: timer.timer_garage
-# Notify Entry Door Status
-###############################################################################
+ # Notify Entry Door Status
+ ###############################################################################
- alias: Notify Entry Door Status
initial_state: true
trigger:
platform: state
- entity_id:
+ entity_id:
- binary_sensor.aeotec_zw120_door_window_sensor_gen5_sensor
- binary_sensor.back_door_sensor_sensor
condition:
@@ -266,33 +266,33 @@ automation:
message: >
{% if trigger.to_state.state | lower == "on" %}
Your {{ trigger.to_state.attributes.friendly_name.replace('Sensor', '') }} is OPEN,
- {% if states.alarm_control_panel.simplisafe.state == 'armed_home' or
- states.alarm_control_panel.simplisafe.state == 'armed_away' %}
+ {% if states('alarm_control_panel.simplisafe') == 'armed_home' or
+ states('alarm_control_panel.simplisafe') == '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'
+ greeting: "no"
only_at_night: >
- {% if states.alarm_control_panel.simplisafe.state == 'armed_home' %}
+ {% if states('alarm_control_panel.simplisafe') == 'armed_home' %}
no
{% else %}
yes
{% endif %}
-# Turn ON and OFF basement ambient lights
-###############################################################################
+ # Turn ON and OFF basement ambient lights
+ ###############################################################################
- alias: Basement Accent Lights ON When Basement Door Opened
initial_state: true
trigger:
platform: state
entity_id: binary_sensor.basement_door_sensor_sensor
- to: 'on'
+ to: "on"
condition:
- condition: state
entity_id: input_boolean.light_automations
- state: 'on'
+ state: "on"
action:
- service: homeassistant.turn_on
entity_id: switch.rf_switch_one
@@ -301,15 +301,15 @@ automation:
initial_state: true
trigger:
platform: state
- entity_id:
+ entity_id:
- switch.rf_switch_one
- to: 'on'
+ to: "on"
for:
minutes: 5
condition:
- condition: state
entity_id: input_boolean.light_automations
- state: 'on'
+ state: "on"
action:
- service: homeassistant.turn_off
entity_id: switch.rf_switch_one
diff --git a/packages/emergency.yaml b/packages/emergency.yaml
index b244d7c..2385ffa 100644
--- a/packages/emergency.yaml
+++ b/packages/emergency.yaml
@@ -154,7 +154,7 @@
# to: 'disarmed'
# condition:
# - condition: template
-# value_template: '{{ states.input_boolean.emergency_mode.state == "on" }}'
+# value_template: "{{ states('input_boolean.emergency_mode') == 'on' }}"
# action:
# - service: input_boolean.turn_off
# entity_id: input_boolean.emergency_mode
diff --git a/packages/esxi.yaml b/packages/esxi.yaml
index f22197f..051228a 100644
--- a/packages/esxi.yaml
+++ b/packages/esxi.yaml
@@ -2,37 +2,37 @@ homeassistant:
sensor:
- platform: snmp
- name: 'ESXi Server Description'
+ name: "ESXi Server Description"
host: !secret esxi_server
baseoid: 1.3.6.1.2.1.1.1.0
accept_errors: true
- platform: snmp
- name: 'ESXi Total RAM'
+ name: "ESXi Total RAM"
host: !secret esxi_server
baseoid: 1.3.6.1.2.1.25.2.3.1.5.6
accept_errors: true
- platform: snmp
- name: 'ESXi Used RAM'
+ name: "ESXi Used RAM"
host: !secret esxi_server
baseoid: 1.3.6.1.2.1.25.2.3.1.6.6
accept_errors: true
- platform: snmp
- name: 'ESXi System Uptime Epoch'
+ name: "ESXi System Uptime Epoch"
host: !secret esxi_server
baseoid: 1.3.6.1.2.1.25.1.1.0
accept_errors: true
- platform: snmp
- name: 'ESXi Number of Network Interfaces'
+ name: "ESXi Number of Network Interfaces"
host: !secret esxi_server
baseoid: 1.3.6.1.2.1.2.1.0
accept_errors: true
- platform: snmp
- name: 'ESXi System Memory Size'
+ name: "ESXi System Memory Size"
host: !secret esxi_server
baseoid: 1.3.6.1.2.1.25.2.2.0
accept_errors: true
@@ -40,17 +40,17 @@ sensor:
- platform: template
sensors:
esxi_memory_used:
- friendly_name: "ESXi Memory Usage"
- unit_of_measurement: '%'
- value_template: "{{(states('sensor.esxi_used_ram') | float / states('sensor.esxi_total_ram') | float * 100) | round }}"
+ friendly_name: "ESXi Memory Usage"
+ unit_of_measurement: "%"
+ value_template: "{{(states('sensor.esxi_used_ram') | float / states('sensor.esxi_total_ram') | float * 100) | round }}"
- platform: template
sensors:
esxi_system_uptime:
- friendly_name: "ESXi System Uptime"
- value_template: >
- {% set time = states.sensor.esxi_system_uptime_epoch.state | int %}
- {% set minutes = ((time % 360000) / 6000) | int %}
- {% set hours = ((time % 8640000) / 360000) | int %}
- {% set days = (time / 8640000) | int %}
- {{ days }} days, {{ hours }} hours {{ minutes }} minutes.
\ No newline at end of file
+ friendly_name: "ESXi System Uptime"
+ value_template: >
+ {% set time = states('sensor.esxi_system_uptime_epoch') | int %}
+ {% set minutes = ((time % 360000) / 6000) | int %}
+ {% set hours = ((time % 8640000) / 360000) | int %}
+ {% set days = (time / 8640000) | int %}
+ {{ days }} days, {{ hours }} hours {{ minutes }} minutes.
diff --git a/packages/frontend_themes.yaml b/packages/frontend_themes.yaml
index 506641a..69d79ae 100644
--- a/packages/frontend_themes.yaml
+++ b/packages/frontend_themes.yaml
@@ -45,30 +45,29 @@ frontend:
paper-slider-secondary-color: "#ff93ac"
###############################################################################
-# _ _ _
-# /\ | | | | (_)
-# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
+# _ _ _
+# /\ | | | | (_)
+# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
# / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \/ __|
# / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | \__ \
# /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_|___/
-#
+#
###############################################################################
automation:
-
- alias: Random Theme At Startup
initial_state: true
trigger:
- platform: homeassistant
event: start
action:
- - service_template: frontend.set_theme
- data_template:
- name: >
- {% if states.sun.sun.state == "above_horizon" %}
- {{ ["light_pink", "default"] | random }}
- {% else %}
- {{ [ "dark_red" ] | random }}
- {% endif %}
+ - service_template: frontend.set_theme
+ data_template:
+ name: >
+ {% if states('sun.sun') == "above_horizon" %}
+ {{ ["light_pink", "default"] | random }}
+ {% else %}
+ {{ [ "dark_red" ] | random }}
+ {% endif %}
- alias: Random Darker Theme At Sunset
initial_state: true
@@ -88,4 +87,4 @@ automation:
action:
- service: frontend.set_theme
data_template:
- name: '{{ ["light_pink", "default"] | random }}'
\ No newline at end of file
+ name: '{{ ["light_pink", "default"] | random }}'
diff --git a/packages/fun.yaml b/packages/fun.yaml
index 63b76d9..41da672 100644
--- a/packages/fun.yaml
+++ b/packages/fun.yaml
@@ -2,10 +2,10 @@
# # @author : Mahasri Kalavala
# # @date : 04/15/2017
# # @package : Random Chuck Norris Facts
-# # @description : Daily dose of Chuck Norris.
-# # It is intentionally set to query once a day.
+# # @description : Daily dose of Chuck Norris.
+# # It is intentionally set to query once a day.
# # Know your limits, too much of Chuck Norris is not good!
-# #
+# #
# # These are facts, and not jokes. DO NOT JOKE ABOUT CHUCK NORRIS!
# # ##############################################################################
# homeassistant:
@@ -33,4 +33,4 @@
# - service: persistent_notification.create
# data:
# title: 'Chuck Norris fact:'
-# message: '{{ states.sensor.fact_of_the_day.state }}'
+# message: '{{ states('sensor.fact_of_the_day') }}'
diff --git a/packages/holidays.yaml b/packages/holidays.yaml
index 2e97dac..6c63edb 100644
--- a/packages/holidays.yaml
+++ b/packages/holidays.yaml
@@ -7,7 +7,6 @@
homeassistant:
customize:
-
sensor.holiday:
hidden: true
icon: mdi:beach
@@ -15,8 +14,8 @@ homeassistant:
###############################################################################
# Sensor updates once every 4 hours (14400 seconds) & runs 6 times in 24 hours
-#
-# First it checks for holiday in static section, if that doesn't exist,
+#
+# First it checks for holiday in static section, if that doesn't exist,
# it checks in the dynamic section. If neither exists, the value will be empty
###############################################################################
sensor:
@@ -34,16 +33,15 @@ sensor:
{{ holiday }}
###############################################################################
-# _ _ _
-# /\ | | | | (_)
-# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
+# _ _ _
+# /\ | | | | (_)
+# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
# / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \/ __|
# / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | \__ \
# /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_|___/
-#
+#
###############################################################################
automation:
-
- alias: Notify Holiday State Change
initial_state: true
trigger:
@@ -53,21 +51,21 @@ automation:
- condition: template
value_template: "{{ states('sensor.holiday') != 'unknown' }}"
- condition: template
- value_template: "{{ states.sensor.holiday.state | trim != '' }}"
+ value_template: "{{ states('sensor.holiday') | trim != '' }}"
action:
- service: persistent_notification.create
data:
- message: 'Today is {{ states.sensor.holiday.state }}.'
- title: '{{ states.sensor.holiday.state }}'
+ message: "Today is {{ states('sensor.holiday') }}."
+ title: "{{ states('sensor.holiday') }}"
- service: script.notify_me
data_template:
- message: 'Today is: {{states.sensor.holiday.state }}'
+ message: "Today is: {{states('sensor.holiday') }}"
- alias: Notify Indian Holidays
initial_state: true
trigger:
platform: time
- at: '09:00:00'
+ at: "09:00:00"
condition:
- condition: template
value_template: >-
@@ -75,9 +73,9 @@ automation:
{%- if now().year == strptime(states.calendar.holidays_in_india.attributes.start_time, '%Y-%m-%d %H:%M:%S').year -%}
{%- set days2NextEvent = strptime(states.calendar.holidays_in_india.attributes.start_time, '%Y-%m-%d %H:%M:%S').strftime('%j') | int - (now().strftime('%j') | int) -%}
{%- else -%}
- {% set days2NextEvent = strptime((now().year ~ "-12-31 12:02:05"), '%Y-%m-%d %H:%M:%S').strftime('%j') | int - (now().strftime('%j') | int) + (strptime(states.calendar.holidays_in_india.attributes.start_time, '%Y-%m-%d %H:%M:%S').strftime('%j') | int) -%}
- {%- endif -%}
- {%- if days2NextEvent <= (states.input_number.calendar_remind_before_days.state | int) -%}
+ {% set days2NextEvent = strptime((now().year ~ "-12-31 12:02:05"), '%Y-%m-%d %H:%M:%S').strftime('%j') | int - (now().strftime('%j') | int) + (strptime(states.calendar.holidays_in_india.attributes.start_time, '%Y-%m-%d %H:%M:%S').strftime('%j') | int) -%}
+ {%- endif -%}
+ {%- if days2NextEvent <= (states('input_number.calendar_remind_before_days') | int) -%}
{%- if days2NextEvent |int == 0 -%}
true
{%- elif days2NextEvent | int == 1 -%}
@@ -94,18 +92,18 @@ automation:
- service: script.notify_me
data_template:
message: >-
- {%- set days2NextEvent = 0 -%}
- {%- if now().year == strptime(states.calendar.holidays_in_india.attributes.start_time, '%Y-%m-%d %H:%M:%S').year -%}
- {%- set days2NextEvent = strptime(states.calendar.holidays_in_india.attributes.start_time, '%Y-%m-%d %H:%M:%S').strftime('%j') | int - (now().strftime('%j') | int) -%}
- {%- else -%}
- {% set days2NextEvent = strptime((now().year ~ "-12-31 12:02:05"), '%Y-%m-%d %H:%M:%S').strftime('%j') | int - (now().strftime('%j') | int) + (strptime(states.calendar.holidays_in_india.attributes.start_time, '%Y-%m-%d %H:%M:%S').strftime('%j') | int) -%}
- {%- endif -%}
- {%- if days2NextEvent <= (states.input_number.calendar_remind_before_days.state | int) -%}
- {%- if days2NextEvent |int == 0 -%}
- Today is {{ states.calendar.holidays_in_india.attributes.message | replace(".", "") | title }}.
- {%- elif days2NextEvent |int == 1 -%}
- Tomorrow is {{ states.calendar.holidays_in_india.attributes.message | replace(".", "") | title }}.
- {%- elif days2NextEvent |int == 2 -%}
- {{ states.calendar.holidays_in_india.attributes.message | replace(".", "") | title }}. is day after tomorrow.
- {%- endif -%}
- {%- endif -%}
\ No newline at end of file
+ {%- set days2NextEvent = 0 -%}
+ {%- if now().year == strptime(states.calendar.holidays_in_india.attributes.start_time, '%Y-%m-%d %H:%M:%S').year -%}
+ {%- set days2NextEvent = strptime(states.calendar.holidays_in_india.attributes.start_time, '%Y-%m-%d %H:%M:%S').strftime('%j') | int - (now().strftime('%j') | int) -%}
+ {%- else -%}
+ {% set days2NextEvent = strptime((now().year ~ "-12-31 12:02:05"), '%Y-%m-%d %H:%M:%S').strftime('%j') | int - (now().strftime('%j') | int) + (strptime(states.calendar.holidays_in_india.attributes.start_time, '%Y-%m-%d %H:%M:%S').strftime('%j') | int) -%}
+ {%- endif -%}
+ {%- if days2NextEvent <= (states('input_number.calendar_remind_before_days') | int) -%}
+ {%- if days2NextEvent |int == 0 -%}
+ Today is {{ states.calendar.holidays_in_india.attributes.message | replace(".", "") | title }}.
+ {%- elif days2NextEvent |int == 1 -%}
+ Tomorrow is {{ states.calendar.holidays_in_india.attributes.message | replace(".", "") | title }}.
+ {%- elif days2NextEvent |int == 2 -%}
+ {{ states.calendar.holidays_in_india.attributes.message | replace(".", "") | title }}. is day after tomorrow.
+ {%- endif -%}
+ {%- endif -%}
diff --git a/packages/homeassistant.yaml b/packages/homeassistant.yaml
index 3dad893..afd8fce 100644
--- a/packages/homeassistant.yaml
+++ b/packages/homeassistant.yaml
@@ -36,7 +36,6 @@ speedtestdotnet:
- upload
sensor:
-
- platform: uptime
name: Home Assistant Up Time
unit_of_measurement: hours
@@ -48,7 +47,7 @@ sensor:
- platform: rest
resource: http://icanhazip.com
name: external_ip
- value_template: '{{ value }}'
+ value_template: "{{ value }}"
scan_interval: 86400
- platform: systemmonitor
@@ -64,42 +63,31 @@ sensor:
- platform: rest
resource: https://pypi.python.org/pypi/homeassistant/json
name: HA Current Version
- value_template: '{{ value_json.info.version }}'
+ value_template: "{{ value_json.info.version }}"
- platform: command_line
name: HA Installed Version
command: /srv/homeassistant/bin/hass --version
scan_interval: 86400
- - platform: pi_hole
- host: !secret pi_hole_ip
- ssl: false
- verify_ssl: false
- monitored_conditions:
- - ads_blocked_today
- - ads_percentage_today
- - dns_queries_today
- - domains_being_blocked
- - queries_cached
- - queries_forwarded
- - unique_clients
- - unique_domains
- - clients_ever_seen
+pi_hole:
+ host: !secret pi_hole_ip
+ ssl: false
+ verify_ssl: false
###############################################################################
-# _ _ _
-# /\ | | | | (_)
-# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
+# _ _ _
+# /\ | | | | (_)
+# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
# / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \/ __|
# / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | \__ \
# /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_|___/
-#
+#
###############################################################################
automation:
-
-# Notify me when I get a new public IP from my ISP
-######################################################
+ # Notify me when I get a new public IP from my ISP
+ ######################################################
- alias: Notify Of New External IP
initial_state: true
@@ -127,7 +115,7 @@ automation:
entity_id: updater.updater
action:
- service: script.notify_me
- data: {"message":"New HASS update is available. Please update!"}
+ data: { "message": "New HASS update is available. Please update!" }
- alias: Remind domain renewal
initial_state: true
@@ -138,5 +126,5 @@ automation:
action:
- service: persistent_notification.create
data:
- title: 'Domain Renew'
- message: 'It is time to renew your domain. The domain will expire in {{ states.sensor.my_domain.state }} days.'
+ title: "Domain Renew"
+ message: "It is time to renew your domain. The domain will expire in {{ states('sensor.my_domain') }} days."
diff --git a/packages/homebridge.yaml b/packages/homebridge.yaml
index 93b9578..18a41f0 100644
--- a/packages/homebridge.yaml
+++ b/packages/homebridge.yaml
@@ -1,6 +1,5 @@
homeassistant:
customize_domain:
-
alarm_control_panel:
homebridge_hidden: true
@@ -58,4 +57,4 @@ homeassistant:
switch:
homebridge_hidden: false
- emulated_hue_hidden: false
\ No newline at end of file
+ emulated_hue_hidden: false
diff --git a/packages/homesecurity.yaml b/packages/homesecurity.yaml
index 76d0725..34e37c7 100644
--- a/packages/homesecurity.yaml
+++ b/packages/homesecurity.yaml
@@ -45,30 +45,30 @@ automation:
- condition: template
value_template: "{% if trigger.from_state %} True {% else %} False {% endif %}"
- condition: template
- value_template: '{{ states.alarm_control_panel.simplisafe.state != "unknown" }}'
+ value_template: "{{ states('alarm_control_panel.simplisafe') != 'unknown' }}"
- condition: template
- value_template: '{{ states.alarm_control_panel.simplisafe.state | trim != "" }}'
+ value_template: "{{ states('alarm_control_panel.simplisafe') | trim != '' }}"
action:
- service_template: >
- {% if states.alarm_control_panel.simplisafe.state == "armed_home" %}
+ {% if states('alarm_control_panel.simplisafe') == "armed_home" %}
script.xiaomi_blue
- {% elif states.alarm_control_panel.simplisafe.state == "armed_away" %}
+ {% elif states('alarm_control_panel.simplisafe') == "armed_away" %}
script.xiaomi_green
- {% elif states.alarm_control_panel.simplisafe.state == "triggered" %}
+ {% elif states('alarm_control_panel.simplisafe') == "triggered" %}
script.xiaomi_red
- {% elif states.alarm_control_panel.simplisafe.state == "disarmed" %}
+ {% elif states('alarm_control_panel.simplisafe') == "disarmed" %}
script.xiaomi_red
{% endif %}
- service: script.ifttt_leeo_color_change
data_template:
value1: >
- {% if states.alarm_control_panel.simplisafe.state == "armed_home" %}
+ {% if states('alarm_control_panel.simplisafe') == "armed_home" %}
"#0000FF"
- {% elif states.alarm_control_panel.simplisafe.state == "armed_away" %}
+ {% elif states('alarm_control_panel.simplisafe') == "armed_away" %}
"#00FF00"
- {% elif states.alarm_control_panel.simplisafe.state == "triggered" %}
+ {% elif states('alarm_control_panel.simplisafe') == "triggered" %}
"#FF0000"
- {% elif states.alarm_control_panel.simplisafe.state == "disarmed" %}
+ {% elif states('alarm_control_panel.simplisafe') == "disarmed" %}
"#FF0000"
{% endif %}
@@ -94,29 +94,29 @@ automation:
- service: script.notify_me
data_template:
message: >
- {% if states.alarm_control_panel.simplisafe.state == "armed_home" %}
+ {% if states('alarm_control_panel.simplisafe') == "armed_home" %}
Your home is now secured!
- {% elif states.alarm_control_panel.simplisafe.state == "armed_away" %}
+ {% elif states('alarm_control_panel.simplisafe') == "armed_away" %}
Your Home Security System is now set to Away mode!
- {% elif states.alarm_control_panel.simplisafe.state == "triggered" %}
+ {% elif states('alarm_control_panel.simplisafe') == "triggered" %}
Attention!: Your Home Security System is triggered! It has been notified to the authorities.
- {% elif states.alarm_control_panel.simplisafe.state == "disarmed" %}
+ {% elif states('alarm_control_panel.simplisafe') == "disarmed" %}
Attention!: Your Home Security System is turned OFF.
{% endif %}
- service: script.voice_notify
data_template:
message: >
- {% if states.alarm_control_panel.simplisafe.state == "armed_home" %}
+ {% if states('alarm_control_panel.simplisafe') == "armed_home" %}
Your home is now secured!
- {% elif states.alarm_control_panel.simplisafe.state == "armed_away" %}
+ {% elif states('alarm_control_panel.simplisafe') == "armed_away" %}
Your Home Security System is now set to Away mode!
- {% elif states.alarm_control_panel.simplisafe.state == "triggered" %}
+ {% elif states('alarm_control_panel.simplisafe') == "triggered" %}
Attention!: Your Home Security System is triggered! It has been notified to the authorities.
- {% elif states.alarm_control_panel.simplisafe.state == "disarmed" %}
- Attention!: Your Home Security System is turned OFF.
+ {% elif states('alarm_control_panel.simplisafe') == "disarmed" %}
+ Attention!: Your Home Security System is turned OFF.
{% endif %}
- condition: template
- value_template: '{{ states.alarm_control_panel.simplisafe.state != "disarmed" }}'
+ value_template: "{{ states('alarm_control_panel.simplisafe') != 'disarmed' }}"
- service: input_boolean.turn_on
entity_id: input_boolean.notify_camera_motion
@@ -176,7 +176,7 @@ automation:
condition:
- condition: template
value_template: >
- {% if trigger.from_state.state == 'armed_away' and
+ {% if trigger.from_state.state == 'armed_away' and
(trigger.to_state.state == 'armed_home' or trigger.to_state.state == 'disarmed') %}
true
{% else %}
@@ -199,9 +199,9 @@ automation:
seconds: 00
condition:
- condition: template
- value_template: "{{ states.sensor.bedtime_hour.state|int == now().hour|int }}"
+ value_template: "{{ states('sensor.bedtime_hour')|int == now().hour|int }}"
- condition: template
- value_template: "{{ states.sensor.bedtime_minute.state|int == now().minute|int }}"
+ value_template: "{{ states('sensor.bedtime_minute')|int == now().minute|int }}"
- condition: template
value_template: "{{ states('alarm_control_panel.simplisafe') != 'away' }}"
- condition: state
@@ -231,33 +231,33 @@ automation:
# condition: and
# conditions:
# - condition: template
-# value_template: '{{ states.alarm_control_panel.simplisafe.state == "armed_home" or states.alarm_control_panel.simplisafe.state == "armed_away" }}'
+# value_template: '{{ states('alarm_control_panel.simplisafe') == "armed_home" or states('alarm_control_panel.simplisafe') == "armed_away" }}'
# - condition: or
# conditions:
# - condition: template
-# value_template: '{{ states.binary_sensor.two_car_garage_door_tilt_sensor_sensor.state == "on" }}'
+# value_template: '{{ states('binary_sensor.two_car_garage_door_tilt_sensor_sensor') == "on" }}'
# - condition: template
-# value_template: '{{ states.binary_sensor.single_car_garage_door_tilt_sensor_sensor.state == "on" }}'
+# value_template: '{{ states('binary_sensor.single_car_garage_door_tilt_sensor_sensor') == "on" }}'
# 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.simplisafe.state.split('_')[1] | upper }} mode.
-# BUT THE {% if states.binary_sensor.two_car_garage_door_tilt_sensor_sensor.state == "on" -%}DOUBLE CAR {%- else %}SINGLE CAR {% endif %}GARAGE DOOR IS STILL OPEN!
+# Attention! Your home Security system is set to {{ states('alarm_control_panel.simplisafe').split('_')[1] | upper }} mode.
+# BUT THE {% if states('binary_sensor.two_car_garage_door_tilt_sensor_sensor') == "on" -%}DOUBLE CAR {%- else %}SINGLE CAR {% endif %}GARAGE DOOR IS STILL OPEN!
# - service: camera.snapshot
# data_template:
# entity_id: "camera.garage_camera"
-# filename: "{{ '/home/homeassistant/.homeassistant/www/downloads/camera/garage/garage_' ~ (states.automation.home_security_system_and_garage_door_check.last_updated ~ '').replace('-','_').replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
+# filename: "{{ '/home/homeassistant/.homeassistant/www/downloads/camera/garage/garage_' ~ (states('automation.home_security_system_and_garage_door_check.last_updated ~ '').replace('-','_').replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
# - service: camera.snapshot
# data_template:
# entity_id: "camera.driveway_camera"
-# filename: "{{ '/home/homeassistant/.homeassistant/www/downloads/camera/driveway/driveway_' ~ (states.automation.home_security_system_and_garage_door_check.last_updated ~ '').replace('-','_').replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
+# filename: "{{ '/home/homeassistant/.homeassistant/www/downloads/camera/driveway/driveway_' ~ (states('automation.home_security_system_and_garage_door_check.last_updated ~ '').replace('-','_').replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
# - service: camera.snapshot
# data_template:
# entity_id: "camera.frontdoor_camera"
-# filename: "{{ '/home/homeassistant/.homeassistant/www/downloads/camera/frontdoor/frontdoor_' ~ (states.automation.home_security_system_and_garage_door_check.last_updated ~ '').replace('-','_').replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
+# filename: "{{ '/home/homeassistant/.homeassistant/www/downloads/camera/frontdoor/frontdoor_' ~ (states('automation.home_security_system_and_garage_door_check.last_updated ~ '').replace('-','_').replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
# - service: notify.notify_smtp
# data_template:
# title: 'Garage Picture {{ now().strftime("%d %h %Y, %I:%M:%S %p") }}'
@@ -272,33 +272,33 @@ automation:
# {%- endif %} {{ dt.strftime("%B %Y")}}
# {%- endmacro -%}
# {% set doors = "" %}
-# {% if states.binary_sensor.two_car_garage_door_tilt_sensor_sensor.state == "on" and states.binary_sensor.single_car_garage_door_tilt_sensor_sensor.state == "on" %}
+# {% if states('binary_sensor.two_car_garage_door_tilt_sensor_sensor') == "on" and states('binary_sensor.single_car_garage_door_tilt_sensor_sensor') == "on" %}
# {% set doors = "Both garage doors" %}
-# {% elif states.binary_sensor.single_car_garage_door_tilt_sensor_sensor.state == "on"%}
-# {% set doors = states.binary_sensor.single_car_garage_door_tilt_sensor_sensor.name %}
-# {% elif states.binary_sensor.two_car_garage_door_tilt_sensor_sensor.state == "on" %}
-# {% set doors = states.binary_sensor.two_car_garage_door_tilt_sensor_sensor.name %}
+# {% elif states('binary_sensor.single_car_garage_door_tilt_sensor_sensor') == "on"%}
+# {% set doors = states('binary_sensor.single_car_garage_door_tilt_sensor_sensor.name %}
+# {% elif states('binary_sensor.two_car_garage_door_tilt_sensor_sensor') == "on" %}
+# {% set doors = states('binary_sensor.two_car_garage_door_tilt_sensor_sensor.name %}
# {% endif %}
-# Your {{ doors }} seem to be open while your home security system is set to "{{ states.alarm_control_panel.simplisafe.state.split('_')[1]| title }}" mode. Today is {{ get_date(now()) }}, and time is {{ now().strftime("%I:%M:%S %p") }}. Please see the attached pictures and make sure everything is okay.
+# Your {{ doors }} seem to be open while your home security system is set to "{{ states('alarm_control_panel.simplisafe').split('_')[1]| title }}" mode. Today is {{ get_date(now()) }}, and time is {{ now().strftime("%I:%M:%S %p") }}. Please see the attached pictures and make sure everything is okay.
# data:
# images:
-# - "{{ '/home/homeassistant/.homeassistant/www/downloads/camera/garage/garage_' ~ (states.automation.home_security_system_and_garage_door_check.last_updated ~ '').replace('-','_').replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
-# - "{{ '/home/homeassistant/.homeassistant/www/downloads/camera/driveway/driveway_' ~ (states.automation.home_security_system_and_garage_door_check.last_updated ~ '').replace('-','_').replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
-# - "{{ '/home/homeassistant/.homeassistant/www/downloads/camera/frontdoor/frontdoor_' ~ (states.automation.home_security_system_and_garage_door_check.last_updated ~ '').replace('-','_').replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
+# - "{{ '/home/homeassistant/.homeassistant/www/downloads/camera/garage/garage_' ~ (states('automation.home_security_system_and_garage_door_check.last_updated ~ '').replace('-','_').replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
+# - "{{ '/home/homeassistant/.homeassistant/www/downloads/camera/driveway/driveway_' ~ (states('automation.home_security_system_and_garage_door_check.last_updated ~ '').replace('-','_').replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
+# - "{{ '/home/homeassistant/.homeassistant/www/downloads/camera/frontdoor/frontdoor_' ~ (states('automation.home_security_system_and_garage_door_check.last_updated ~ '').replace('-','_').replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
# - condition: template
-# value_template: '{{ states.alarm_control_panel.simplisafe.state == "armed_home" }}'
+# value_template: '{{ states('alarm_control_panel.simplisafe') == "armed_home" }}'
# - service: script.voice_notify
# data_template:
# message: >
# {% set doors = "" %}
-# {% if states.binary_sensor.two_car_garage_door_tilt_sensor_sensor.state == "on" and states.binary_sensor.single_car_garage_door_tilt_sensor_sensor.state == "on" %}
+# {% if states('binary_sensor.two_car_garage_door_tilt_sensor_sensor') == "on" and states('binary_sensor.single_car_garage_door_tilt_sensor_sensor') == "on" %}
# {% set doors = "Both garage doors" %}
-# {% elif states.binary_sensor.single_car_garage_door_tilt_sensor_sensor.state == "on"%}
-# {% set doors = states.binary_sensor.single_car_garage_door_tilt_sensor_sensor.name %}
-# {% elif states.binary_sensor.single_car_garage_door_tilt_sensor_sensor.state == "on" %}
-# {% set doors = states.binary_sensor.two_car_garage_door_tilt_sensor_sensor.name %}
+# {% elif states('binary_sensor.single_car_garage_door_tilt_sensor_sensor') == "on"%}
+# {% set doors = states('binary_sensor.single_car_garage_door_tilt_sensor_sensor.name %}
+# {% elif states('binary_sensor.single_car_garage_door_tilt_sensor_sensor') == "on" %}
+# {% set doors = states('binary_sensor.two_car_garage_door_tilt_sensor_sensor.name %}
# {% endif %}
-# Attention! Your home Security system is set to {{ states.alarm_control_panel.simplisafe.state.split('_')[1] | upper }} mode.
+# Attention! Your home Security system is set to {{ states('alarm_control_panel.simplisafe').split('_')[1] | upper }} mode.
# BUT the {{ doors }} {{ 'are' if doors.endswith('s') else 'is' }} open.
###############################################################################
@@ -319,10 +319,10 @@ automation:
# state: 'disarmed'
# action:
# - service_template: >-
-# {% if states.binary_sensor.back_door_sensor_sensor.state == "off" and
-# states.binary_sensor.aeotec_zw120_door_window_sensor_gen5_sensor.state == "off" and
-# states.binary_sensor.two_car_garage_door_tilt_sensor_sensor.state == "off" and
-# states.binary_sensor.single_car_garage_door_tilt_sensor_sensor.state == "off" %}
+# {% 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.two_car_garage_door_tilt_sensor_sensor') == "off" and
+# states('binary_sensor.single_car_garage_door_tilt_sensor_sensor') == "off" %}
# alarm_control_panel.alarm_arm_home
# {% else %}
# alarm_control_panel.disarm
@@ -332,31 +332,31 @@ automation:
# - service: script.voice_notify
# data_template:
# message: >
-# {% if states.binary_sensor.back_door_sensor_sensor.state == "off" and
-# states.binary_sensor.aeotec_zw120_door_window_sensor_gen5_sensor.state == "off" and
-# states.binary_sensor.two_car_garage_door_tilt_sensor_sensor.state == "off" and
-# states.binary_sensor.single_car_garage_door_tilt_sensor_sensor.state == "off" %}
+# {% 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.two_car_garage_door_tilt_sensor_sensor') == "off" and
+# states('binary_sensor.single_car_garage_door_tilt_sensor_sensor') == "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.state == "on" -%}
+# {%- 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.state == "on" -%}
+# {%- 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.two_car_garage_door_tilt_sensor_sensor.state == "on" -%}
+# {%- if states('binary_sensor.two_car_garage_door_tilt_sensor_sensor') == "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.single_car_garage_door_tilt_sensor_sensor.state == "on" -%}
+# {%- if states('binary_sensor.single_car_garage_door_tilt_sensor_sensor') == "on" -%}
# {% if doors | trim != "" %}
# {%- set doors = doors ~ " and Single Car Garage Door" -%}
# {% else %}
@@ -368,31 +368,31 @@ automation:
# - service: script.notify_me
# data_template:
# message: >
-# {% if states.binary_sensor.back_door_sensor_sensor.state == "off" and
-# states.binary_sensor.aeotec_zw120_door_window_sensor_gen5_sensor.state == "off" and
-# states.binary_sensor.two_car_garage_door_tilt_sensor_sensor.state == "off" and
-# states.binary_sensor.single_car_garage_door_tilt_sensor_sensor.state == "off" %}
+# {% 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.two_car_garage_door_tilt_sensor_sensor') == "off" and
+# states('binary_sensor.single_car_garage_door_tilt_sensor_sensor') == "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.state == "on" -%}
+# {%- 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.state == "on" -%}
+# {%- 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.two_car_garage_door_tilt_sensor_sensor.state == "on" -%}
+# {%- if states('binary_sensor.two_car_garage_door_tilt_sensor_sensor') == "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.single_car_garage_door_tilt_sensor_sensor.state == "on" -%}
+# {%- if states('binary_sensor.single_car_garage_door_tilt_sensor_sensor') == "on" -%}
# {% if doors | trim != "" %}
# {%- set doors = doors ~ " and Single Car Garage Door" -%}
# {% else %}
@@ -417,9 +417,9 @@ automation:
# condition: or
# conditions:
# - condition: template
-# value_template: '{{ states.alarm_control_panel.simplisafe.state | lower == "armed_away" }}'
+# value_template: '{{ states('alarm_control_panel.simplisafe') | lower == "armed_away" }}'
# - condition: template
-# value_template: '{{ states.alarm_control_panel.simplisafe.state | lower == "armed_home" }}'
+# value_template: '{{ states('alarm_control_panel.simplisafe') | lower == "armed_home" }}'
# action:
# - service: notify.ios_suresh
# data_template:
@@ -444,7 +444,7 @@ automation:
# to: 'on'
# condition:
# - condition: template
-# value_template: '{{ states.alarm_control_panel.simplisafe.state == "armed_home" or states.alarm_control_panel.simplisafe.state == "armed_away" }}'
+# value_template: '{{ states('alarm_control_panel.simplisafe') == "armed_home" or states('alarm_control_panel.simplisafe') == "armed_away" }}'
# action:
# - service: notify.ios_suresh
# data_template:
diff --git a/packages/lights.yaml b/packages/lights.yaml
index f86b2ff..b6311f0 100644
--- a/packages/lights.yaml
+++ b/packages/lights.yaml
@@ -6,7 +6,6 @@
###############################################################################
homeassistant:
customize:
-
switch.frontyard_light:
icon: mdi:lightbulb
friendly_name: Front Porch Lights
@@ -46,7 +45,7 @@ homeassistant:
friendly_name: Guest Bedroom 2
emulated_hue_name: Guest Bedroom 2
homebridge_name: Guest Bedroom 2
-
+
switch.zwave_smart_switch_switch:
friendly_name: Office Room Accent Lights
emulated_hue_name: Office Room Accent Lights
@@ -90,11 +89,11 @@ homeassistant:
icon: mdi:flash
friendly_name: Short Flash
input_boolean.long_flash:
- icon: mdi:flash
+ icon: mdi:flash
friendly_name: Long Flash
input_boolean.animate_downstairs_lights:
icon: mdi:flash-outline
- friendly_name: Animate Family Room Lights
+ friendly_name: Animate Family Room Lights
input_boolean.animate_upstairs_lights:
icon: mdi:flash-outline
friendly_name: Animate Master Bedroom Lights
@@ -123,63 +122,62 @@ hue:
tplink:
discovery: false
switch:
+ # In-wall switches
+ - host: !secret tplink_kids_bedroom
+ - host: !secret tplink_guest_bedroom_1
+ - host: !secret tplink_guest_bedroom_2
+ - host: !secret tplink_garage
+ - host: !secret tplink_basement_left
+ - host: !secret tplink_basement_right
+ - host: !secret tplink_kitchen
+ - host: !secret tplink_office_room
-# In-wall switches
- - host: !secret tplink_kids_bedroom
- - host: !secret tplink_guest_bedroom_1
- - host: !secret tplink_guest_bedroom_2
- - host: !secret tplink_garage
- - host: !secret tplink_basement_left
- - host: !secret tplink_basement_right
- - host: !secret tplink_kitchen
- - host: !secret tplink_office_room
-
-# Smart Outlets
- - host: !secret tplink_smart_outlet1
- #name: Downstairs Fragrance Outlet
- - host: !secret tplink_smart_outlet2
- #name: Downstairs Bathroom Fragrance Outlet
- - host: !secret tplink_smart_outlet3
- #name: Upstairs Fragrance Outlet
- - host: !secret tplink_kids_bed_accent_light
- #name: Kids Bed Accent Light
+ # Smart Outlets
+ - host: !secret tplink_smart_outlet1
+ #name: Downstairs Fragrance Outlet
+ - host: !secret tplink_smart_outlet2
+ #name: Downstairs Bathroom Fragrance Outlet
+ - host: !secret tplink_smart_outlet3
+ #name: Upstairs Fragrance Outlet
+ - host: !secret tplink_kids_bed_accent_light
+ #name: Kids Bed Accent Light
switch:
# RF Switches
- # - platform: mqtt
- # name: RF Switch One
- # command_topic: '/home/rfswitches/switch_one'
- # payload_on: "on"
- # payload_off: "off"
- # retain: true
+# - platform: mqtt
+# name: RF Switch One
+# command_topic: '/home/rfswitches/switch_one'
+# payload_on: "on"
+# payload_off: "off"
+# retain: true
- # - platform: mqtt
- # name: RF Switch Two
- # command_topic: '/home/rfswitches/switch_two'
- # payload_on: "on"
- # payload_off: "off"
- # retain: true
+# - platform: mqtt
+# name: RF Switch Two
+# command_topic: '/home/rfswitches/switch_two'
+# payload_on: "on"
+# payload_off: "off"
+# retain: true
- # - platform: mqtt
- # name: RF Switch Three
- # command_topic: '/home/rfswitches/switch_three'
- # payload_on: "on"
- # payload_off: "off"
- # retain: true
+# - platform: mqtt
+# name: RF Switch Three
+# command_topic: '/home/rfswitches/switch_three'
+# payload_on: "on"
+# payload_off: "off"
+# retain: true
- # - platform: mqtt
- # name: RF Switch Four
- # command_topic: '/home/rfswitches/switch_four'
- # payload_on: "on"
- # payload_off: "off"
- # retain: true
+# - platform: mqtt
+# name: RF Switch Four
+# command_topic: '/home/rfswitches/switch_four'
+# payload_on: "on"
+# payload_off: "off"
+# retain: true
- # - platform: mqtt
- # name: RF Switch Five
- # command_topic: '/home/rfswitches/switch_five'
- # payload_on: "on"
- # payload_off: "off"
- # retain: true
+# - platform: mqtt
+# name: RF Switch Five
+# command_topic: '/home/rfswitches/switch_five'
+# payload_on: "on"
+# payload_off: "off"
+# retain: true
wemo:
discovery: false
@@ -210,7 +208,7 @@ script:
data:
entity_id: light.gateway_light_34ce008ad65d
brightness: 255
- rgb_color: [255,0,0]
+ rgb_color: [255, 0, 0]
xiaomi_blue:
sequence:
@@ -218,7 +216,7 @@ script:
data:
entity_id: light.gateway_light_34ce008ad65d
brightness: 255
- rgb_color: [0,0,255]
+ rgb_color: [0, 0, 255]
xiaomi_green:
sequence:
@@ -226,7 +224,7 @@ script:
data:
entity_id: light.gateway_light_34ce008ad65d
brightness: 255
- rgb_color: [0,255,0]
+ rgb_color: [0, 255, 0]
# start_colorloop:
# sequence:
@@ -237,7 +235,6 @@ script:
# period: 2
# spread: 360
# change: 35
-
# stop_colorloop:
# sequence:
# - service: light.lifx_effect_stop
@@ -245,31 +242,30 @@ script:
# entity_id: light.dinette
###############################################################################
-# _ _ _
-# /\ | | | | (_)
-# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
+# _ _ _
+# /\ | | | | (_)
+# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
# / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \/ __|
# / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | \__ \
# /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_|___/
-#
+#
###############################################################################
automation:
-
-# Animate Master Bedroom Lights
-###############################################################################
+ # Animate Master Bedroom Lights
+ ###############################################################################
- alias: Animate Master Bedroom Lights
initial_state: true
trigger:
platform: time_pattern
- seconds: '/5'
+ seconds: "/5"
condition:
- condition: state
entity_id: input_boolean.animate_upstairs_lights
- state: 'on'
+ state: "on"
- condition: state
entity_id: input_boolean.light_automations
- state: 'on'
+ state: "on"
action:
- service: light.turn_on
data:
@@ -278,45 +274,48 @@ automation:
brightness: 255
color_temp: 366
data_template:
- rgb_color: ['{{ "{0:d}".format(range(0, 255)|random) }}' ,
- '{{ "{0:d}".format(range(0, 255)|random) }}',
- '{{ "{0:d}".format(range(0, 255)|random) }}']
+ rgb_color:
+ [
+ '{{ "{0:d}".format(range(0, 255)|random) }}',
+ '{{ "{0:d}".format(range(0, 255)|random) }}',
+ '{{ "{0:d}".format(range(0, 255)|random) }}',
+ ]
-# Restore Master Bedroom Lights
-###############################################################################
+ # Restore Master Bedroom Lights
+ ###############################################################################
- alias: Restore Masterbedroom Lights
initial_state: true
trigger:
platform: state
entity_id: input_boolean.animate_upstairs_lights
- to: 'off'
+ to: "off"
condition:
- condition: state
entity_id: input_boolean.light_automations
- state: 'on'
+ state: "on"
action:
- service: light.turn_on
data:
entity_id: group.master_bedroom_lights
transition: 5
- rgb_color: [224,175,102]
+ rgb_color: [224, 175, 102]
brightness: 10
color_temp: 366
-# Animate Familyroom Lights
-###############################################################################
+ # Animate Familyroom Lights
+ ###############################################################################
- alias: Animate Familyroom Lights
initial_state: true
trigger:
platform: time_pattern
- seconds: '/5'
+ seconds: "/5"
condition:
- condition: state
entity_id: input_boolean.animate_downstairs_lights
- state: 'on'
+ state: "on"
- condition: state
entity_id: input_boolean.light_automations
- state: 'on'
+ state: "on"
action:
- service: light.turn_on
data:
@@ -325,22 +324,25 @@ automation:
brightness: 255
color_temp: 366
data_template:
- rgb_color: ['{{ "{0:d}".format(range(0, 255)|random) }}' ,
- '{{ "{0:d}".format(range(0, 255)|random) }}',
- '{{ "{0:d}".format(range(0, 255)|random) }}']
+ rgb_color:
+ [
+ '{{ "{0:d}".format(range(0, 255)|random) }}',
+ '{{ "{0:d}".format(range(0, 255)|random) }}',
+ '{{ "{0:d}".format(range(0, 255)|random) }}',
+ ]
-# Restore Familyroom Lights
-###############################################################################
+ # Restore Familyroom Lights
+ ###############################################################################
- alias: Restore Familyroom Lights
initial_state: true
trigger:
platform: state
entity_id: input_boolean.animate_downstairs_lights
- to: 'off'
+ to: "off"
condition:
- condition: state
entity_id: input_boolean.light_automations
- state: 'on'
+ state: "on"
action:
- service: light.turn_on
data:
@@ -350,8 +352,8 @@ automation:
brightness: 255
color_temp: 162
-# Animate Kitchen Lights ON
-###############################################################################
+ # Animate Kitchen Lights ON
+ ###############################################################################
# - alias: Animate Kitchen Lights ON
# initial_state: true
# trigger:
@@ -365,14 +367,14 @@ automation:
# - service: light.turn_on
# entity_id: light.dinette
# data_template:
- # rgb_color: ['{{ (range(0, 255)|random) }}',
- # '{{ (range(0, 255)|random) }}',
+ # rgb_color: ['{{ (range(0, 255)|random) }}',
+ # '{{ (range(0, 255)|random) }}',
# '{{ (range(0, 255)|random) }}']
# brightness: 255
# transition: '{{ (range(1, 2)|random) }}'
-# Animate Kitchen Lights OFF
-###############################################################################
+ # Animate Kitchen Lights OFF
+ ###############################################################################
# - alias: Animate Kitchen Lights OFF
# initial_state: true
# trigger:
@@ -387,19 +389,19 @@ automation:
# brightness: 255
# color_temp: 155
-# Long Flash All Lights
-###############################################################################
+ # Long Flash All Lights
+ ###############################################################################
- alias: Long Flash All Lights
initial_state: true
trigger:
- platform: state
entity_id: input_boolean.long_flash
- to: 'on'
- from: 'off'
+ to: "on"
+ from: "off"
condition:
- condition: state
entity_id: input_boolean.light_automations
- state: 'on'
+ state: "on"
action:
- service: light.turn_on
entity_id:
@@ -409,19 +411,19 @@ automation:
- service: input_boolean.turn_off
entity_id: input_boolean.long_flash
-# Short Flash All Lights
-###############################################################################
+ # Short Flash All Lights
+ ###############################################################################
- alias: Short Flash All Lights
initial_state: true
trigger:
- platform: state
entity_id: input_boolean.short_flash
- to: 'on'
- from: 'off'
+ to: "on"
+ from: "off"
condition:
- condition: state
entity_id: input_boolean.light_automations
- state: 'on'
+ state: "on"
action:
- service: light.turn_on
entity_id:
diff --git a/packages/logger.yaml b/packages/logger.yaml
index 67db2a7..f4068bc 100644
--- a/packages/logger.yaml
+++ b/packages/logger.yaml
@@ -22,28 +22,28 @@
# homeassistant.core: error
# homeassistant.setup: error
# homeassistant.loader: error
-# homeassistant.components.api: error
+# homeassistant.components.api: error
# homeassistant.helpers.script: error
-# homeassistant.components.mqtt: error
-# homeassistant.components.http: error
+# homeassistant.components.mqtt: error
+# homeassistant.components.http: error
# homeassistant.helpers.entity: error
-# homeassistant.components.zwave: error
-# homeassistant.components.sensor: error
+# homeassistant.components.zwave: error
+# homeassistant.components.sensor: error
# homeassistant.helpers.condition: error
-# homeassistant.components.recorder: error
+# homeassistant.components.recorder: error
# homeassistant.components.discovery: error
# homeassistant.components.automation: error
# homeassistant.components.light.lifx: error
# homeassistant.components.emulated_hue: error
-# homeassistant.components.media_player: error
+# homeassistant.components.media_player: error
# homeassistant.components.device_tracker: error
# custom_components.sensor.life360: error
-# custom_components.sensor.command_line: error
-# custom_components.media_player.sharptv: error
+# custom_components.sensor.command_line: error
+# custom_components.media_player.sharptv: error
# ###############################################################################
# # Logger level
-# input_select:
+# input_select:
# log_level:
# name: Log Level
# options:
@@ -99,4 +99,4 @@
# - service: input_select.select_option
# data_template:
# entity_id: input_select.log_level
-# option: '{{ states.sensor.current_log_level.state | default("warning") }}'
\ No newline at end of file
+# option: '{{ states('sensor.current_log_level') | default("warning") }}'
diff --git a/packages/media_players.yaml b/packages/media_players.yaml
index abd7dbb..057dcc9 100644
--- a/packages/media_players.yaml
+++ b/packages/media_players.yaml
@@ -158,12 +158,12 @@ automation:
entity_id: input_select.snapcast_server
condition:
- condition: template
- value_template: '{{ states.input_select.snapcast_server.state | lower != "select one" }}'
+ value_template: "{{ states('input_select.snapcast_server') | lower != 'select one' }}"
action:
- service_template: >-
- {% if states.input_select.snapcast_server.state | lower == "stop" %}
+ {% if states('input_select.snapcast_server') | lower == "stop" %}
shell_command.stop_snapserver
- {% elif states.input_select.snapcast_server.state | lower == "start" %}
+ {% elif states('input_select.snapcast_server') | lower == "start" %}
shell_command.start_snapserver
{% else %}
shell_command.restart_snapserver
diff --git a/packages/motion_counts.yaml b/packages/motion_counts.yaml
index 8d24acf..66686fa 100644
--- a/packages/motion_counts.yaml
+++ b/packages/motion_counts.yaml
@@ -1,55 +1,55 @@
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.downstairs_multi_sensor_sensor:
- unit_of_measurement: 'count'
- input_label.front_room_multi_sensor_sensor:
- unit_of_measurement: 'count'
- input_label.front_room_window_sensor_sensor:
- unit_of_measurement: 'count'
- input_label.garage_door_sensor_sensor:
- unit_of_measurement: 'count'
- input_label.garage_motion:
- unit_of_measurement: 'count'
- input_label.guest_bedroom_multi_sensor_sensor:
- unit_of_measurement: 'count'
- input_label.kitchen_motion_sensor_sensor:
- unit_of_measurement: 'count'
- input_label.motion_sensor_158d00016c2d0e:
- 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_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.upstairs_multi_sensor_sensor:
- unit_of_measurement: 'count'
+ 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.downstairs_multi_sensor_sensor:
+ unit_of_measurement: "count"
+ input_label.front_room_multi_sensor_sensor:
+ unit_of_measurement: "count"
+ input_label.front_room_window_sensor_sensor:
+ unit_of_measurement: "count"
+ input_label.garage_door_sensor_sensor:
+ unit_of_measurement: "count"
+ input_label.garage_motion:
+ unit_of_measurement: "count"
+ input_label.guest_bedroom_multi_sensor_sensor:
+ unit_of_measurement: "count"
+ input_label.kitchen_motion_sensor_sensor:
+ unit_of_measurement: "count"
+ input_label.motion_sensor_158d00016c2d0e:
+ 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_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.upstairs_multi_sensor_sensor:
+ unit_of_measurement: "count"
input_label:
aeotec_zw120_door_window_sensor_gen5_sensor:
@@ -134,7 +134,7 @@ automation:
- alias: Count Motions
trigger:
- platform: state
- to: 'on'
+ to: "on"
entity_id:
- binary_sensor.aeotec_zw120_door_window_sensor_gen5_sensor
- binary_sensor.back_door_sensor_sensor
@@ -203,16 +203,15 @@ automation:
- input_label.stairs_motion_sensor_sensor
- input_label.two_car_garage_door_tilt_sensor_sensor
- input_label.upstairs_multi_sensor_sensor
-
-# {% for x in states.binary_sensor if 'camera' not in x.entity_id and
-# 'cube' not in x.entity_id and
-# 'tesla' not in x.entity_id and
-# 'drone' not in x.entity_id and
-# 'audio' not in x.entity_id and
-# 'protection' not in x.entity_id and
-# 'tv' not in x.entity_id and
-# 'workday' not in x.entity_id and
-# 'home_away' not in x.entity_id and
+# {% for x in states.binary_sensor if 'camera' not in x.entity_id and
+# 'cube' not in x.entity_id and
+# 'tesla' not in x.entity_id and
+# 'drone' not in x.entity_id and
+# 'audio' not in x.entity_id and
+# 'protection' not in x.entity_id and
+# 'tv' not in x.entity_id and
+# 'workday' not in x.entity_id and
+# 'home_away' not in x.entity_id and
# 'dining_room' not in x.entity_id %}
# {{ x.entity_id }}
-# {%- endfor %}
\ No newline at end of file
+# {%- endfor %}
diff --git a/packages/motion_timers.yaml b/packages/motion_timers.yaml
index a39e279..25fda5e 100644
--- a/packages/motion_timers.yaml
+++ b/packages/motion_timers.yaml
@@ -3,7 +3,7 @@
# @date : 11/19/2017
# @package : Timers and Lights/Switches
# @description : All lights and switches are now timer enabled
-# and the timer automatically extends when there is
+# and the timer automatically extends when there is
# motion. When timer elapses, it turns off lights.
###############################################################################
homeassistant:
@@ -25,189 +25,156 @@ homeassistant:
timer:
timer_kitchen:
- duration: '00:10:00'
+ duration: "00:10:00"
timer_familyroom:
- duration: '00:05:00'
+ duration: "00:05:00"
timer_frontroom:
- duration: '00:05:00'
+ duration: "00:05:00"
timer_garage:
- duration: '00:05:00'
+ duration: "00:05:00"
timer_masterbedroom:
- duration: '00:05:00'
+ duration: "00:05:00"
timer_officeroom:
- duration: '00:05:00'
+ duration: "00:05:00"
###############################################################################
-# _ _ _
-# /\ | | | | (_)
-# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
+# _ _ _
+# /\ | | | | (_)
+# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
# / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \/ __|
# / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | \__ \
# /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_|___/
-#
+#
###############################################################################
automation:
-
-# Office Room:
-# Motion Detected - Turn ON the light and extend timer
-###############################################################################
+ # Office Room:
+ # Motion Detected - Turn ON the light and extend timer
+ ###############################################################################
- alias: Officeroom Motion & Timer
initial_state: true
trigger:
- platform: state
entity_id: binary_sensor.motion_sensor_158d000272bfd7
- from: 'off'
- to: 'on'
+ to: "on"
action:
- service: timer.start
entity_id: timer.timer_officeroom
- service: switch.turn_on
entity_id: switch.office_room
- condition: template
- value_template: '{{ states.sun.sun.state == "below_horizon" }}'
+ value_template: "{{ states('sun.sun') == 'below_horizon' }}"
- service: homeassistant.turn_on
entity_id: switch.zwave_smart_switch_switch
- alias: Officeroom Timer Elapsed
initial_state: true
trigger:
- - platform: state
- entity_id: timer.timer_officeroom
- from: 'active'
- to: 'idle'
+ - platform: event
+ event_type: timer.finished
+ event_data:
+ entity_id: timer.timer_officeroom
action:
- service: switch.turn_off
entity_id: switch.office_room
- service: homeassistant.turn_off
entity_id: switch.zwave_smart_switch_switch
-# Srinika's Bedroom:
-# Motion Detected - Turn ON the bedroom light and extend timer
-###############################################################################
- # - alias: Srinika Bedroom Motion & Timer
- # initial_state: true
- # trigger:
- # - platform: state
- # entity_id: binary_sensor.motion_sensor_158d000272bed1
- # from: 'off'
- # to: 'on'
- # action:
- # - service: timer.start
- # entity_id: timer.timer_srinika_bedroom
- # - service: switch.turn_on
- # entity_id: switch.switch.guest_bedroom
- # - condition: template
- # value_template: '{{ states.sun.sun.state == "below_horizon" }}'
-
- # - alias: Srinika Bedroom Timer Elapsed
- # initial_state: true
- # trigger:
- # - platform: state
- # entity_id: timer.timer_srinika_bedroom
- # from: 'active'
- # to: 'idle'
- # action:
- # - service: switch.turn_off
- # entity_id: switch.guest_bedroom
-
-# Front Room:
-# Motion Detected - Turn ON the light and extend timer
-###############################################################################
+ # # Front Room:
+ # # Motion Detected - Turn ON the light and extend timer
+ # ###############################################################################
- alias: Frontroom Motion & Timer
initial_state: true
trigger:
- platform: state
entity_id: binary_sensor.motion_sensor_158d00016db6d2
- from: 'off'
- to: 'on'
+ from: "off"
+ to: "on"
action:
- service: timer.start
entity_id: timer.timer_frontroom
- condition: template
- value_template: '{{ states.sun.sun.state == "below_horizon" }}'
+ value_template: "{{ states('sun.sun') == 'below_horizon' }}"
- service: homeassistant.turn_on
entity_id: switch.zwave_smart_switch_switch
-# Front Room:
-# Timer Elapsed - Turn OFF lights
-###############################################################################
+ # Front Room:
+ # Timer Elapsed - Turn OFF lights
+ ###############################################################################
- alias: Frontroom Timer Elapsed
initial_state: true
trigger:
- - platform: state
- entity_id: timer.timer_frontroom
- from: 'active'
- to: 'idle'
+ - platform: event
+ event_type: timer.finished
+ event_data:
+ entity_id: timer.timer_frontroom
condition:
- condition: template
- value_template: '{{ states.input_boolean.working_in_office_room.state == "off" }}'
+ value_template: "{{ states('input_boolean.working_in_office_room') == 'off' }}"
action:
- service: homeassistant.turn_off
entity_id: switch.rf_switch_four
-
-# Kitchen:
-# Motion Detected - Turn ON the light and extend timer
-###############################################################################
+ # Kitchen:
+ # Motion Detected - Turn ON the light and extend timer
+ ###############################################################################
- alias: Kitchen Motion & Timer
initial_state: true
trigger:
- platform: state
- entity_id:
+ entity_id:
- binary_sensor.motion_sensor_158d0001a662fe
- binary_sensor.kitchen_motion_sensor_sensor
- binary_sensor.basement_door_sensor_sensor
- from: 'off'
- to: 'on'
+ from: "off"
+ to: "on"
condition:
- condition: state
entity_id: sun.sun
- state: 'below_horizon'
+ state: "below_horizon"
action:
- service: switch.turn_on
entity_id: switch.kitchen
- service: timer.start
entity_id: timer.timer_kitchen
-
-# Kitchen:
-# Timer Elapsed - Turn OFF lights
-###############################################################################
+ # Kitchen:
+ # Timer Elapsed - Turn OFF lights
+ ###############################################################################
- alias: Kitchen Timer Elapsed
initial_state: true
trigger:
- platform: event
event_type: timer.finished
- event_data:
- entity_id: timer.timer_kitchen
+ event_data:
+ entity_id: timer.timer_kitchen
condition:
- condition: state
entity_id: sun.sun
- state: 'below_horizon'
+ state: "below_horizon"
action:
- service_template: >
- {% if now().hour|int >= states.sensor.bedtime_hour.state|int and now().minute|int >= states.sensor.bedtime_minute.state|int %}
+ {% if now().hour|int >= states('sensor.bedtime_hour') |int and
+ now().minute|int >= states('sensor.bedtime_minute') |int %}
switch.turn_off
{% else %}
switch.turn_on
{% endif %}
entity_id: switch.kitchen
-
-# Family Room:
-# Motion Detected - When TV is OFF, turn ON the light 100% and extend timer
-###############################################################################
+ # Family Room:
+ # Motion Detected - When TV is OFF, turn ON the light 100% and extend timer
+ ###############################################################################
- alias: Family Room Motion & Timer
initial_state: true
trigger:
- platform: state
- entity_id:
+ entity_id:
- binary_sensor.tv_multi_sensor_sensor
- binary_sensor.motion_sensor_158d0001a25041
- from: 'off'
- to: 'on'
+ from: "off"
+ to: "on"
condition:
- condition: state
entity_id: sun.sun
- state: 'below_horizon'
+ state: "below_horizon"
- condition: template
value_template: "{{ states('input_boolean.movie_time') != 'on' }}"
action:
@@ -215,129 +182,123 @@ automation:
entity_id: light.family_room
data_template:
brightness: >
- {% if states.binary_sensor.sharp_tv.state == "on" %}
+ {% if states('binary_sensor.sharp_tv') == "on" %}
25
{% else %}
254
{% endif %}
color_temp: 154
- transition: 5
+ transition: 5
- service: timer.start
entity_id: timer.timer_familyroom
-
-# Family Room:
-# Timer Elapsed - Turn OFF lights
-###############################################################################
+ # Family Room:
+ # Timer Elapsed - Turn OFF lights
+ ###############################################################################
- alias: Family Room Timer Elapsed
initial_state: true
trigger:
- platform: state
entity_id: timer.timer_familyroom
- from: 'active'
- to: 'idle'
+ from: "active"
+ to: "idle"
action:
- service: light.turn_off
entity_id: light.family_room
- - delay: '00:00:05'
+ - delay: "00:00:05"
- service: light.turn_off
entity_id: light.family_room
-
-# Master Bedroom:
-# Motion Detected - Turn ON the lights and extend timer
-###############################################################################
+ # Master Bedroom:
+ # Motion Detected - Turn ON the lights and extend timer
+ ###############################################################################
- alias: Master Bedroom Motion & Timer
initial_state: true
trigger:
- platform: state
entity_id: binary_sensor.upstairs_multi_sensor_sensor
- from: 'off'
- to: 'on'
+ from: "off"
+ to: "on"
condition:
- condition: state
entity_id: sun.sun
- state: 'below_horizon'
+ state: "below_horizon"
action:
- service: light.turn_on
data:
entity_id: light.master_bedroom_1
- rgb_color: [224,175,102]
+ rgb_color: [224, 175, 102]
brightness: 10
- service: light.turn_on
data:
entity_id: light.master_bedroom_2
- rgb_color: [224,175,102]
+ rgb_color: [224, 175, 102]
brightness: 10
- service: timer.start
entity_id: timer.timer_masterbedroom
-
-# Master Bedroom:
-# Timer Elapsed - Turn OFF lights
-###############################################################################
+ # Master Bedroom:
+ # Timer Elapsed - Turn OFF lights
+ ###############################################################################
- alias: Master Bedroom Timer Elapsed
initial_state: true
trigger:
- platform: state
entity_id: timer.timer_masterbedroom
- from: 'active'
- to: 'idle'
+ from: "active"
+ to: "idle"
action:
- service: light.turn_off
entity_id: light.master_bedroom_1
- service: light.turn_off
entity_id: light.master_bedroom_2
- - delay: '00:00:05'
+ - delay: "00:00:05"
- service: light.turn_off
entity_id: light.master_bedroom
-
-# Garage:
-# Motion Detected - Turn ON the light and extend timer
-#
-# Added a condition - if the lights were just turn off in the last 30 seconds,
-# do not turn ON the lights again
-###############################################################################
+ # Garage:
+ # Motion Detected - Turn ON the light and extend timer
+ #
+ # Added a condition - if the lights were just turn off in the last 30 seconds,
+ # do not turn ON the lights again
+ ###############################################################################
- alias: Garage Motion & Timer
initial_state: true
trigger:
- platform: state
entity_id: binary_sensor.garage_motion
- from: 'off'
- to: 'on'
+ from: "off"
+ to: "on"
condition:
- condition: template
- value_template: '{{ states.input_boolean.working_in_garage.state | lower == "on" }}'
+ value_template: "{{ states('input_boolean.working_in_garage') | lower == 'on' }}"
- condition: template
- value_template: '{{ (as_timestamp(now()) - as_timestamp(states.switch.garage.last_updated)) | int > 30 }}'
+ value_template: "{{ (as_timestamp(now()) - as_timestamp(states.switch.garage.last_updated)) | int > 30 }}"
action:
- service: switch.turn_on
entity_id: switch.garage
-
-# Start the timer when the lights are ON
-###############################################################################
+ # Start the timer when the lights are ON
+ ###############################################################################
- alias: Garage Timer Start When Garage Lights ON
initial_state: true
trigger:
- platform: state
entity_id: switch.garage
- from: 'off'
- to: 'on'
+ from: "off"
+ to: "on"
action:
- service: timer.start
entity_id: timer.timer_garage
-
-# Garage:
-# Timer Elapsed - Turn OFF lights, when "I am not working"
-###############################################################################
+ # Garage:
+ # Timer Elapsed - Turn OFF lights, when "I am not working"
+ ###############################################################################
- alias: Garage Timer Elapsed
initial_state: true
trigger:
- platform: state
entity_id: timer.timer_garage
- from: 'active'
- to: 'idle'
+ from: "active"
+ to: "idle"
condition:
- condition: state
entity_id: input_boolean.working_in_garage
- state: 'off'
+ state: "off"
action:
- service: switch.turn_off
entity_id: switch.garage
diff --git a/packages/notify.yaml b/packages/notify.yaml
index 2475bcf..f8c71f6 100644
--- a/packages/notify.yaml
+++ b/packages/notify.yaml
@@ -6,7 +6,6 @@
###############################################################################
homeassistant:
customize:
-
group.tts_announcements:
order: 52
@@ -41,7 +40,7 @@ notify:
- service: ios_mallika
- service: ios_srinika
- service: ios_hasika
-
+
# make sure you generate app password for your email if you have 2FA enabled!
- name: notify_smtp
platform: smtp
@@ -50,7 +49,7 @@ notify:
timeout: 15
username: !secret smtp_username
password: !secret smtp_password
- sender: !secret smtp_sender
+ sender: !secret smtp_sender
recipient: !secret smtp_recipient
# - name: notify_aws_sns
@@ -67,15 +66,14 @@ tts:
- platform: amazon_polly
aws_access_key_id: !secret aws_access_key_id
aws_secret_access_key: !secret aws_secret_access_key
- region_name: 'us-east-1'
+ region_name: "us-east-1"
text_type: ssml
voice: Joanna
script:
-
-###############################################################################
-# Notify Related Scripts
-###############################################################################
+ ###############################################################################
+ # Notify Related Scripts
+ ###############################################################################
ifttt_notify:
sequence:
- condition: template
@@ -91,15 +89,15 @@ script:
- condition: template
value_template: '{{ value1 | trim != "" }}'
- service: ifttt.trigger
- data_template:
+ data_template:
event: "LEEO_COLOR_CHANGE"
- value1: '{{ value1 }}'
+ value1: "{{ value1 }}"
notify_me:
sequence:
- condition: state
entity_id: input_boolean.text_alerts
- state: 'on'
+ state: "on"
- condition: template
value_template: '{{ message | trim != "" }}'
- service: script.ifttt_notify
@@ -112,38 +110,38 @@ script:
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
+ # 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.state == "on" }}'
+ value_template: "{{ states('input_boolean.voice_notifications') == 'on' }}"
- condition: template
- value_template: '{{ states.input_boolean.do_not_disturb.state | lower == "off" }}'
+ value_template: "{{ states('input_boolean.do_not_disturb') | lower == 'off' }}"
- condition: template
- value_template: '{{ states.media_player.gstreamer.state == "idle" }}'
+ value_template: "{{ states('media_player.gstreamer') == 'idle' }}"
- condition: template
- value_template: '{{ states.media_player.mpd.state != "playing" }}'
+ value_template: "{{ states('media_player.mpd') != 'playing' }}"
- condition: template
- value_template: '{{ message | trim != "" }}'
+ value_template: "{{ message | trim != '' }}"
- condition: state
entity_id: group.all_devices
- state: 'home'
+ state: "home"
- condition: template
value_template: >
- {% if states.input_boolean.emergency_mode.state == "on" %}
+ {% if states('input_boolean.emergency_mode') == "on" %}
true
{% else %}
- {{ states.group.all_devices.state == "home" }}
+ {{ states('group.all_devices') == "home" }}
{% endif %}
- condition: template
value_template: >
{% if only_at_night | default('no', true ) == "yes" %}
- {% if states.sun.sun.state == "above_horizon" %}
+ {% if states('sun.sun') == "above_horizon" %}
false
{% else %}
true
@@ -155,15 +153,15 @@ script:
entity_id: media_player.gstreamer
data_template:
volume_level: >
- {% if states.input_boolean.emergency_mode.state == "on" %}
- {{ states.input_number.tts_volume_level_alert.state }}
+ {% 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.state }}
+ {{ states('input_number.tts_volume_level_morning') }}
{% elif now().hour|int > 12 and now().hour|int < 20 %}
- {{ states.input_number.tts_volume_level_afternoon.state }}
+ {{ states('input_number.tts_volume_level_afternoon') }}
{% else %}
- {{ states.input_number.tts_volume_level_evening.state }}
+ {{ states('input_number.tts_volume_level_evening') }}
{% endif %}
{% endif %}
- service: tts.amazon_polly_say
@@ -196,9 +194,9 @@ script:
{% set msg = msg + " " %}
{{ msg }}
-###############################################################################
-# Greeting
-###############################################################################
+ ###############################################################################
+ # Greeting
+ ###############################################################################
voice_greeting:
sequence:
- service: tts.amazon_polly_say
@@ -224,11 +222,11 @@ script:
{% set msg = msg + " " %}
{{ msg }}
-###############################################################################
-# Status around the house
-###############################################################################
+ ###############################################################################
+ # Status around the house
+ ###############################################################################
home_status:
sequence:
- service: script.voice_notify
data_template:
- message: !include ../templates/home_status.yaml
\ No newline at end of file
+ message: !include ../templates/home_status.yaml
diff --git a/packages/pi_admin.yaml b/packages/pi_admin.yaml
index b744b4f..aa7ccb5 100644
--- a/packages/pi_admin.yaml
+++ b/packages/pi_admin.yaml
@@ -2,17 +2,17 @@
# @author : Mahasri Kalavala
# @date : 12/27/2017
# @package : Pi Admin Package
-# @description : Got way too many Raspberry Pi's and this package is to
+# @description : Got way too many Raspberry Pi's and this package is to
# help me with managing them via Home Assistant.
#
# How Does It Work?
#
-# Each Raspberry Pi runs a service (a python program) locally that listens for
-# commands via MQTT on a pre-defined topic. This package publishes commands
+# Each Raspberry Pi runs a service (a python program) locally that listens for
+# commands via MQTT on a pre-defined topic. This package publishes commands
# to MQTT requesting each Raspberry Pi to respond and or return data.
-# When the responses are received (on a differet topic), the sensors gets
+# When the responses are received (on a differet topic), the sensors gets
# updated automatically and are displayed.
-#
+#
################################################################################
homeassistant:
@@ -32,32 +32,31 @@ input_select:
raspberry_pis:
name: All Raspberry Pis
options:
- - Select One
- - pi_basement
- - pi_theater
- - pi_kitchen
- - pi_familyroom
- - pi_frontroom
- - pi_garage
- - pi_guest1
- - pi_guest2
- - pi_masterbedroom
+ - Select One
+ - pi_basement
+ - pi_theater
+ - pi_kitchen
+ - pi_familyroom
+ - pi_frontroom
+ - pi_garage
+ - pi_guest1
+ - pi_guest2
+ - pi_masterbedroom
initial: Select One
icon: mdi:pig
rpi_commands:
name: RPi Commands
options:
- - Select One
- - Restart Server
- - Shutdown
- - Restart Snapcast
+ - Select One
+ - Restart Server
+ - Shutdown
+ - Restart Snapcast
initial: Select One
icon: mdi:pig
sensor:
-
-## WiFi Information related sensors
+ ## WiFi Information related sensors
- platform: mqtt
state_topic: "/wifi/pi_basement"
name: Basement Pi Signal Level
@@ -67,7 +66,7 @@ sensor:
state_topic: "/wifi/pi_basement"
name: Basement Pi Link Quality
value_template: '{{ value_json["Link Quality"]}}'
-
+
- platform: mqtt
state_topic: "/wifi/pi_theater"
name: Theater Pi Signal Level
@@ -77,7 +76,7 @@ sensor:
state_topic: "/wifi/pi_theater"
name: Theater Pi Link Quality
value_template: '{{ value_json["Link Quality"]}}'
-
+
- platform: mqtt
state_topic: "/wifi/pi_kitchen"
name: Kitchen Pi Signal Level
@@ -148,7 +147,7 @@ sensor:
name: Master Bedroom Pi Link Quality
value_template: '{{ value_json["Link Quality"]}}'
-## Disk Information related Sensors
+ ## Disk Information related Sensors
- platform: mqtt
state_topic: "/disk/pi_basement"
name: Basement Pi Available Disk
@@ -157,7 +156,7 @@ sensor:
state_topic: "/disk/pi_basement"
name: Basement Pi Disk Used
value_template: '{{ value_json["% Used"]}}'
-
+
- platform: mqtt
state_topic: "/disk/pi_theater"
name: Theater Pi Available Disk
@@ -166,7 +165,7 @@ sensor:
state_topic: "/disk/pi_theater"
name: Theater Pi Disk Used
value_template: '{{ value_json["% Used"]}}'
-
+
- platform: mqtt
state_topic: "/disk/pi_kitchen"
name: Kitchen Pi Available Disk
@@ -235,47 +234,47 @@ script:
sequence:
- service: mqtt.publish
data_template:
- topic: '/server/pi_basement'
+ topic: "/server/pi_basement"
payload: CMD_REBOOT_PI
retain: false
- service: mqtt.publish
data_template:
- topic: '/server/pi_theater'
+ topic: "/server/pi_theater"
payload: CMD_REBOOT_PI
retain: false
- service: mqtt.publish
data_template:
- topic: '/server/pi_kitchen'
+ topic: "/server/pi_kitchen"
payload: CMD_REBOOT_PI
retain: false
- service: mqtt.publish
data_template:
- topic: '/server/pi_familyroom'
+ topic: "/server/pi_familyroom"
payload: CMD_REBOOT_PI
retain: false
- service: mqtt.publish
data_template:
- topic: '/server/pi_frontroom'
+ topic: "/server/pi_frontroom"
payload: CMD_REBOOT_PI
retain: false
- service: mqtt.publish
data_template:
- topic: '/server/pi_garage'
+ topic: "/server/pi_garage"
payload: CMD_REBOOT_PI
retain: false
- service: mqtt.publish
data_template:
- topic: '/server/pi_guest1'
+ topic: "/server/pi_guest1"
payload: CMD_REBOOT_PI
retain: false
- service: mqtt.publish
data_template:
- topic: '/server/pi_guest2'
+ topic: "/server/pi_guest2"
payload: CMD_REBOOT_PI
retain: false
- service: mqtt.publish
data_template:
- topic: '/server/pi_masterbedroom'
+ topic: "/server/pi_masterbedroom"
payload: CMD_REBOOT_PI
retain: false
@@ -283,47 +282,47 @@ script:
sequence:
- service: mqtt.publish
data_template:
- topic: '/server/pi_basement'
+ topic: "/server/pi_basement"
payload: CMD_RESTART_SNAPCLIENT
retain: false
- service: mqtt.publish
data_template:
- topic: '/server/pi_theater'
+ topic: "/server/pi_theater"
payload: CMD_RESTART_SNAPCLIENT
retain: false
- service: mqtt.publish
data_template:
- topic: '/server/pi_kitchen'
+ topic: "/server/pi_kitchen"
payload: CMD_RESTART_SNAPCLIENT
retain: false
- service: mqtt.publish
data_template:
- topic: '/server/pi_familyroom'
+ topic: "/server/pi_familyroom"
payload: CMD_RESTART_SNAPCLIENT
retain: false
- service: mqtt.publish
data_template:
- topic: '/server/pi_frontroom'
+ topic: "/server/pi_frontroom"
payload: CMD_RESTART_SNAPCLIENT
retain: false
- service: mqtt.publish
data_template:
- topic: '/server/pi_garage'
+ topic: "/server/pi_garage"
payload: CMD_RESTART_SNAPCLIENT
retain: false
- service: mqtt.publish
data_template:
- topic: '/server/pi_guest1'
+ topic: "/server/pi_guest1"
payload: CMD_RESTART_SNAPCLIENT
retain: false
- service: mqtt.publish
data_template:
- topic: '/server/pi_guest2'
+ topic: "/server/pi_guest2"
payload: CMD_RESTART_SNAPCLIENT
retain: false
- service: mqtt.publish
data_template:
- topic: '/server/pi_masterbedroom'
+ topic: "/server/pi_masterbedroom"
payload: CMD_RESTART_SNAPCLIENT
retain: false
@@ -331,204 +330,203 @@ script:
sequence:
- service: mqtt.publish
data_template:
- topic: '/server/pi_basement'
+ topic: "/server/pi_basement"
payload: CMD_SHUTDOWN_PI
retain: false
- service: mqtt.publish
data_template:
- topic: '/server/pi_theater'
+ topic: "/server/pi_theater"
payload: CMD_SHUTDOWN_PI
retain: false
- service: mqtt.publish
data_template:
- topic: '/server/pi_kitchen'
+ topic: "/server/pi_kitchen"
payload: CMD_SHUTDOWN_PI
retain: false
- service: mqtt.publish
data_template:
- topic: '/server/pi_familyroom'
+ topic: "/server/pi_familyroom"
payload: CMD_SHUTDOWN_PI
retain: false
- service: mqtt.publish
data_template:
- topic: '/server/pi_frontroom'
+ topic: "/server/pi_frontroom"
payload: CMD_SHUTDOWN_PI
retain: false
- service: mqtt.publish
data_template:
- topic: '/server/pi_garage'
+ topic: "/server/pi_garage"
payload: CMD_SHUTDOWN_PI
retain: false
- service: mqtt.publish
data_template:
- topic: '/server/pi_guest1'
+ topic: "/server/pi_guest1"
payload: CMD_SHUTDOWN_PI
retain: false
- service: mqtt.publish
data_template:
- topic: '/server/pi_guest2'
+ topic: "/server/pi_guest2"
payload: CMD_SHUTDOWN_PI
retain: false
- service: mqtt.publish
data_template:
- topic: '/server/pi_masterbedroom'
+ topic: "/server/pi_masterbedroom"
payload: CMD_SHUTDOWN_PI
retain: false
-# Script to Query Disk Information - Publishes message 'CMD_REPORT_WIFI_DETAILS'
-# to MQTT, so that the message gets received by individual Raspberry Pi
-###############################################################################
+ # Script to Query Disk Information - Publishes message 'CMD_REPORT_WIFI_DETAILS'
+ # to MQTT, so that the message gets received by individual Raspberry Pi
+ ###############################################################################
query_wifi_info:
sequence:
- service: mqtt.publish
data:
topic: /server/pi_basement
- payload: 'CMD_REPORT_WIFI_DETAILS'
+ payload: "CMD_REPORT_WIFI_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pi_theater
- payload: 'CMD_REPORT_WIFI_DETAILS'
+ payload: "CMD_REPORT_WIFI_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pi_kitchen
- payload: 'CMD_REPORT_WIFI_DETAILS'
+ payload: "CMD_REPORT_WIFI_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pi_familyroom
- payload: 'CMD_REPORT_WIFI_DETAILS'
+ payload: "CMD_REPORT_WIFI_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pi_frontroom
- payload: 'CMD_REPORT_WIFI_DETAILS'
+ payload: "CMD_REPORT_WIFI_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pi_garage
- payload: 'CMD_REPORT_WIFI_DETAILS'
+ payload: "CMD_REPORT_WIFI_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pi_guest1
- payload: 'CMD_REPORT_WIFI_DETAILS'
+ payload: "CMD_REPORT_WIFI_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pi_guest2
- payload: 'CMD_REPORT_WIFI_DETAILS'
+ payload: "CMD_REPORT_WIFI_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pi_masterbedroom
- payload: 'CMD_REPORT_WIFI_DETAILS'
+ payload: "CMD_REPORT_WIFI_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pizero_green
- payload: 'CMD_REPORT_WIFI_DETAILS'
+ payload: "CMD_REPORT_WIFI_DETAILS"
retain: false
-# Script to Query Disk Information - Publishes message 'CMD_REPORT_DISK_DETAILS'
-# to MQTT, so that the message gets received by individual Raspberry Pi
-###############################################################################
+ # Script to Query Disk Information - Publishes message 'CMD_REPORT_DISK_DETAILS'
+ # to MQTT, so that the message gets received by individual Raspberry Pi
+ ###############################################################################
query_disk_info:
sequence:
- service: mqtt.publish
data:
topic: /server/pi_basement
- payload: 'CMD_REPORT_DISK_DETAILS'
+ payload: "CMD_REPORT_DISK_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pi_theater
- payload: 'CMD_REPORT_DISK_DETAILS'
+ payload: "CMD_REPORT_DISK_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pi_kitchen
- payload: 'CMD_REPORT_DISK_DETAILS'
+ payload: "CMD_REPORT_DISK_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pi_familyroom
- payload: 'CMD_REPORT_DISK_DETAILS'
+ payload: "CMD_REPORT_DISK_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pi_frontroom
- payload: 'CMD_REPORT_DISK_DETAILS'
+ payload: "CMD_REPORT_DISK_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pi_garage
- payload: 'CMD_REPORT_DISK_DETAILS'
+ payload: "CMD_REPORT_DISK_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pi_guest1
- payload: 'CMD_REPORT_DISK_DETAILS'
+ payload: "CMD_REPORT_DISK_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pi_guest2
- payload: 'CMD_REPORT_DISK_DETAILS'
+ payload: "CMD_REPORT_DISK_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pi_masterbedroom
- payload: 'CMD_REPORT_DISK_DETAILS'
+ payload: "CMD_REPORT_DISK_DETAILS"
retain: false
- service: mqtt.publish
data:
topic: /server/pizero_green
- payload: 'CMD_REPORT_DISK_DETAILS'
+ payload: "CMD_REPORT_DISK_DETAILS"
retain: false
###############################################################################
-# _ _ _
-# /\ | | | | (_)
-# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
+# _ _ _
+# /\ | | | | (_)
+# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
# / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \/ __|
# / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | \__ \
# /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_|___/
-#
+#
###############################################################################
# Automations: Various automations to query and issue commands to Raspberry Pis
###############################################################################
automation:
-
-# Queries WiFi Signal Level and Link Quality - it loads during startup, and
-# updates once every 30 minutes
-###############################################################################
+ # Queries WiFi Signal Level and Link Quality - it loads during startup, and
+ # updates once every 30 minutes
+ ###############################################################################
- alias: Query RPi Wifi Data
initial_state: true
trigger:
- platform: time_pattern
- minutes: '/30'
+ minutes: "/30"
- platform: homeassistant
event: start
action:
- service: script.query_wifi_info
-# Queries Disk Available and % Used - it loads during startup, and
-# updates once every 30 minutes
-###############################################################################
+ # Queries Disk Available and % Used - it loads during startup, and
+ # updates once every 30 minutes
+ ###############################################################################
- alias: Query RPi Disk Data
initial_state: true
trigger:
- platform: time_pattern
- minutes: '/30'
+ minutes: "/30"
- platform: homeassistant
- event: start
+ event: start
action:
- service: script.query_disk_info
-# Issues commands to Raspberry Pi via MQTT - On Demand
-###############################################################################
+ # Issues commands to Raspberry Pi via MQTT - On Demand
+ ###############################################################################
- alias: Raspberry Pi Command
initial_state: true
trigger:
@@ -536,18 +534,18 @@ automation:
entity_id: input_select.rpi_commands
condition:
- condition: template
- value_template: '{{ states.input_select.raspberry_pis.state | lower != "select one" }}'
+ value_template: "{{ states('input_select.raspberry_pis') | lower != 'select one' }}"
- condition: template
- value_template: '{{ states.input_select.rpi_commands.state | lower != "select one" }}'
+ value_template: "{{ states('input_select.rpi_commands') | lower != 'select one' }}"
action:
service: mqtt.publish
data_template:
retain: false
- topic: "{{ '/server/' ~ states.input_select.raspberry_pis.state }}"
+ topic: "{{ '/server/' ~ states('input_select.raspberry_pis') }}"
payload: >-
- {% if states.input_select.rpi_commands.state | lower == "restart server" %}
+ {% if states('input_select.rpi_commands') | lower == "restart server" %}
CMD_REBOOT_PI
- {% elif states.input_select.rpi_commands.state | lower == "restart snapcast" %}
+ {% elif states('input_select.rpi_commands') | lower == "restart snapcast" %}
CMD_RESTART_SNAPCLIENT
{% else %}
CMD_SHUTDOWN_PI
diff --git a/packages/qnap.yaml b/packages/qnap.yaml
index e987cc3..5c538cd 100644
--- a/packages/qnap.yaml
+++ b/packages/qnap.yaml
@@ -76,12 +76,12 @@ sensor:
- platform: template
sensors:
nas_memory_usage_above_80:
- value_template: '{{ states.sensor.kalavala_nas_memory_usage.state | int > 80 }}'
+ value_template: "{{ states('sensor.kalavala_nas_memory_usage') | int > 80 }}"
- platform: template
sensors:
nas_cpu_usage_above_80:
- value_template: '{{ states.sensor.kalavala_nas_cpu_usage.state | int > 80 }}'
+ value_template: "{{ states('sensor.kalavala_nas_cpu_usage') | int > 80 }}"
###############################################################################
# _ _ _
diff --git a/packages/quotes.yaml b/packages/quotes.yaml
index 70daff9..bfc8738 100644
--- a/packages/quotes.yaml
+++ b/packages/quotes.yaml
@@ -29,4 +29,4 @@
# - service: persistent_notification.create
# data:
# title: 'Quote:'
-# message: '{{ states.sensor.quote_of_the_day.state }}'
\ No newline at end of file
+# message: '{{ states('sensor.quote_of_the_day') }}'
diff --git a/packages/rfswitches.yaml b/packages/rfswitches.yaml
index a275886..9285e3a 100644
--- a/packages/rfswitches.yaml
+++ b/packages/rfswitches.yaml
@@ -9,7 +9,7 @@
# ###############################################################################
# homeassistant:
# customize:
-
+
# group.etekcity_rf_switches:
# order: 13
@@ -38,7 +38,7 @@
# ###############################################################################
# # RF Switches
# ###############################################################################
-# switch:
+# switch:
# - platform: rpi_rf
# gpio: 17
# switches:
@@ -71,22 +71,22 @@
# state_topic: "/home/rfswitches/switch_one"
# name: "RF Switch One"
# value_template: "{{ value }}"
-
+
# - platform: mqtt
# state_topic: "/home/rfswitches/switch_two"
# name: "RF Switch Two"
# value_template: "{{ value }}"
-
+
# - platform: mqtt
# state_topic: "/home/rfswitches/switch_three"
# name: "RF Switch Three"
# value_template: "{{ value }}"
-
+
# - platform: mqtt
# state_topic: "/home/rfswitches/switch_four"
# name: "RF Switch Four"
# value_template: "{{ value }}"
-
+
# - platform: mqtt
# state_topic: "/home/rfswitches/switch_five"
# name: "RF Switch Five"
@@ -103,7 +103,7 @@
# hide_entity: true
# trigger:
# platform: state
-# entity_id:
+# entity_id:
# - switch.switch_one
# - switch.switch_two
# - switch.switch_three
@@ -123,7 +123,7 @@
# hide_entity: true
# trigger:
# platform: state
-# entity_id:
+# entity_id:
# - sensor.rf_switch_one
# - sensor.rf_switch_two
# - sensor.rf_switch_three
@@ -152,38 +152,38 @@
# - delay:
# minutes: 1
# - service_template: >
-# {%- if states.sensor.rf_switch_one.state | lower == "on" -%}
+# {%- if states('sensor.rf_switch_one') | lower == "on" -%}
# homeassistant.turn_on
# {%- else -%}
# homeassistant.turn_off
-# {%- endif -%}
+# {%- endif -%}
# entity_id: switch.switch_one
# - service_template: >
-# {%- if states.sensor.rf_switch_two.state | lower == "on" -%}
+# {%- if states('sensor.rf_switch_two') | lower == "on" -%}
# homeassistant.turn_on
# {%- else -%}
# homeassistant.turn_off
-# {%- endif -%}
+# {%- endif -%}
# entity_id: switch.switch_two
# - service_template: >
-# {%- if states.sensor.rf_switch_three.state | lower == "on" -%}
+# {%- if states('sensor.rf_switch_three') | lower == "on" -%}
# homeassistant.turn_on
# {%- else -%}
# homeassistant.turn_off
-# {%- endif -%}
+# {%- endif -%}
# entity_id: switch.switch_three
# - service_template: >
-# {%- if states.sensor.rf_switch_four.state | lower == "on" -%}
+# {%- if states('sensor.rf_switch_four') | lower == "on" -%}
# homeassistant.turn_on
# {%- else -%}
# homeassistant.turn_off
-# {%- endif -%}
+# {%- endif -%}
# entity_id: switch.switch_four
# - service_template: >
-# {%- if states.sensor.rf_switch_five.state | lower == "on" -%}
+# {%- if states('sensor.rf_switch_five') | lower == "on" -%}
# homeassistant.turn_on
# {%- else -%}
# homeassistant.turn_off
# {%- endif -%}
# data:
-# entity_id: switch.switch_five
\ No newline at end of file
+# entity_id: switch.switch_five
diff --git a/packages/settings.yaml b/packages/settings.yaml
index f2979bd..070eac5 100644
--- a/packages/settings.yaml
+++ b/packages/settings.yaml
@@ -22,6 +22,7 @@ input_datetime:
has_date: false
has_time: true
initial: "22:00:00"
+
autumn_wakeup_time:
name: Autumn Wakeup Time
has_date: false
@@ -33,6 +34,7 @@ input_datetime:
has_date: false
has_time: true
initial: "22:00:00"
+
winter_wakeup_time:
name: Winter Wakeup Time
has_date: false
@@ -44,6 +46,7 @@ input_datetime:
has_date: false
has_time: true
initial: "22:00:00"
+
spring_wakeup_time:
name: Spring Wakeup Time
has_date: false
@@ -72,56 +75,56 @@ sensor:
wakeup_hour:
friendly_name: Wakeup Hour
value_template: >
- {% if states.sensor.season.state | lower == "summer" %}
- {{ states.input_datetime.summer_wakeup_time.state.split(':')[0] }}
- {% elif states.sensor.season.state | lower == "autumn" %}
- {{ states.input_datetime.autumn_wakeup_time.state.split(':')[0] }}
- {% elif states.sensor.season.state | lower == "winter" %}
- {{ states.input_datetime.winter_wakeup_time.state.split(':')[0] }}
- {% elif states.sensor.season.state | lower == "spring" %}
- {{ states.input_datetime.spring_wakeup_time.state.split(':')[0] }}
+ {% if states('sensor.season') | lower == "summer" %}
+ {{ states('input_datetime.summer_wakeup_time').split(':')[0] }}
+ {% elif states('sensor.season') | lower == "autumn" %}
+ {{ states('input_datetime.autumn_wakeup_time').split(':')[0] }}
+ {% elif states('sensor.season') | lower == "winter" %}
+ {{ states('input_datetime.winter_wakeup_time').split(':')[0] }}
+ {% elif states('sensor.season') | lower == "spring" %}
+ {{ states('input_datetime.spring_wakeup_time').split(':')[0] }}
{% else %}
6
{% endif %}
wakeup_minute:
friendly_name: Wakeup Minute
value_template: >
- {% if states.sensor.season.state | lower == "summer" %}
- {{ states.input_datetime.summer_wakeup_time.state.split(':')[1] }}
- {% elif states.sensor.season.state | lower == "autumn" %}
- {{ states.input_datetime.autumn_wakeup_time.state.split(':')[1] }}
- {% elif states.sensor.season.state | lower == "winter" %}
- {{ states.input_datetime.winter_wakeup_time.state.split(':')[1] }}
- {% elif states.sensor.season.state | lower == "spring" %}
- {{ states.input_datetime.spring_wakeup_time.state.split(':')[1] }}
+ {% if states('sensor.season') | lower == "summer" %}
+ {{ states('input_datetime.summer_wakeup_time').split(':')[1] }}
+ {% elif states('sensor.season') | lower == "autumn" %}
+ {{ states('input_datetime.autumn_wakeup_time').split(':')[1] }}
+ {% elif states('sensor.season') | lower == "winter" %}
+ {{ states('input_datetime.winter_wakeup_time').split(':')[1] }}
+ {% elif states('sensor.season') | lower == "spring" %}
+ {{ states('input_datetime.spring_wakeup_time').split(':')[1] }}
{% else %}
0
{% endif %}
bedtime_hour:
friendly_name: Bedtime Hour
value_template: >
- {% if states.sensor.season.state | lower == "summer" %}
- {{ states.input_datetime.summer_bed_time.state.split(':')[0] }}
- {% elif states.sensor.season.state | lower == "autumn" %}
- {{ states.input_datetime.autumn_bed_time.state.split(':')[0] }}
- {% elif states.sensor.season.state | lower == "winter" %}
- {{ states.input_datetime.winter_bed_time.state.split(':')[0] }}
- {% elif states.sensor.season.state | lower == "spring" %}
- {{ states.input_datetime.spring_bed_time.state.split(':')[0] }}
+ {% if states('sensor.season') | lower == "summer" %}
+ {{ states('input_datetime.summer_bed_time').split(':')[0] }}
+ {% elif states('sensor.season') | lower == "autumn" %}
+ {{ states('input_datetime.autumn_bed_time').split(':')[0] }}
+ {% elif states('sensor.season') | lower == "winter" %}
+ {{ states('input_datetime.winter_bed_time').split(':')[0] }}
+ {% elif states('sensor.season') | lower == "spring" %}
+ {{ states('input_datetime.spring_bed_time').split(':')[0] }}
{% else %}
0
{% endif %}
bedtime_minute:
friendly_name: Bedtime Minute
value_template: >
- {% if states.sensor.season.state | lower == "summer" %}
- {{ states.input_datetime.summer_bed_time.state.split(':')[1] }}
- {% elif states.sensor.season.state | lower == "autumn" %}
- {{ states.input_datetime.autumn_bed_time.state.split(':')[1] }}
- {% elif states.sensor.season.state | lower == "winter" %}
- {{ states.input_datetime.winter_bed_time.state.split(':')[1] }}
- {% elif states.sensor.season.state | lower == "spring" %}
- {{ states.input_datetime.spring_bed_time.state.split(':')[1] }}
+ {% if states('sensor.season') | lower == "summer" %}
+ {{ states('input_datetime.summer_bed_time').split(':')[1] }}
+ {% elif states('sensor.season') | lower == "autumn" %}
+ {{ states('input_datetime.autumn_bed_time').split(':')[1] }}
+ {% elif states('sensor.season') | lower == "winter" %}
+ {{ states('input_datetime.winter_bed_time').split(':')[1] }}
+ {% elif states('sensor.season') | lower == "spring" %}
+ {{ states('input_datetime.spring_bed_time').split(':')[1] }}
{% else %}
0
{% endif %}
@@ -148,7 +151,7 @@ input_boolean:
stream_camera2chromecast:
name: Stream Cameras to Chromecast
icon: mdi:cctv
- initial: off
+ initial: on
home_security:
name: Home Security System
diff --git a/packages/test.yaml b/packages/test.yaml
index 1feaade..b1ffaf7 100644
--- a/packages/test.yaml
+++ b/packages/test.yaml
@@ -1007,4 +1007,3 @@
# data_template:
# entity_id: climate.cooler_fan
# temperature: "{{ states.climate.main_floor.temperature |float }}"
-
diff --git a/packages/tts.yaml b/packages/tts.yaml
index 28d6546..63c9ceb 100644
--- a/packages/tts.yaml
+++ b/packages/tts.yaml
@@ -16,19 +16,19 @@ input_number:
initial: 0.3
min: 0
max: 1
- step: 0.1
+ step: 0.1
tts_volume_level_afternoon:
name: Afternoon TTS Volume
initial: 0.5
min: 0
max: 1
- step: 0.1
+ step: 0.1
tts_volume_level_evening:
name: Evening TTS Volume
initial: 0.3
min: 0
max: 1
- step: 0.1
+ step: 0.1
tts_volume_level_alert:
name: TTS Volume Alert Mode
initial: 1
@@ -37,10 +37,9 @@ input_number:
step: 0.1
automation:
-
-###############################################################################
-# The text entered in the text box will be announced in the house
-###############################################################################
+ ###############################################################################
+ # The text entered in the text box will be announced in the house
+ ###############################################################################
- alias: Text Changed Event
initial_state: true
trigger:
@@ -50,4 +49,4 @@ automation:
- service: script.voice_notify
data_template:
message: "{{ trigger.to_state.state }}"
- greeting: "{{ 'yes' if states.input_boolean.greeting.state == 'on' else 'no' }}"
\ No newline at end of file
+ greeting: "{{ 'yes' if states('input_boolean.greeting') == 'on' else 'no' }}"
diff --git a/packages/usps.yaml b/packages/usps.yaml
index 1e5899f..471e20b 100644
--- a/packages/usps.yaml
+++ b/packages/usps.yaml
@@ -14,13 +14,13 @@ homeassistant:
sensor:
- platform: mqtt
- name: 'USPS Mail'
- state_topic: '/usps/mails'
+ name: "USPS Mail"
+ state_topic: "/usps/mails"
value_template: "{{ value }}"
- platform: mqtt
name: USPS Packages
- state_topic: '/usps/packages'
+ state_topic: "/usps/packages"
value_template: "{{ value }}"
camera:
@@ -29,18 +29,17 @@ camera:
still_image_url: !secret usps_camera_url
###############################################################################
-# _ _ _
-# /\ | | | | (_)
-# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
+# _ _ _
+# /\ | | | | (_)
+# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
# / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \/ __|
# / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | \__ \
# /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_|___/
-#
+#
###############################################################################
automation:
-
-# Notify USPS mails via TTS, and iOS notification with attachment
-###############################################################################
+ # Notify USPS mails via TTS, and iOS notification with attachment
+ ###############################################################################
- alias: Notify USPS Mail
initial_state: true
trigger:
@@ -48,21 +47,23 @@ automation:
entity_id: sensor.usps_mail
condition:
- condition: template
- value_template: '{{ states.sensor.usps_mail.state | int > 0 }}'
+ value_template: "{{ states('sensor.usps_mail') != 'unknown' }}"
- condition: template
- value_template: '{{ ((now().hour | int) > 7) and ((now().hour | int) < 16) }}'
+ value_template: "{{ states('sensor.usps_mail') | int > 0 }}"
+ - condition: template
+ value_template: "{{ ((now().hour | int) > 7) and ((now().hour | int) < 16) }}"
action:
- service: script.voice_notify
data_template:
message: >
- {%- if states.sensor.usps_mail.state | int == 1 -%}
- Attention: USPS is delivering {{ states.sensor.usps_mail.state }} mail today.
+ {%- if states('sensor.usps_mail') | int == 1 -%}
+ Attention: USPS is delivering {{ states('sensor.usps_mail') }} mail today.
{%- else -%}
- Attention: USPS is delivering {{ states.sensor.usps_mail.state }} mails today.
+ Attention: USPS is delivering {{ states('sensor.usps_mail') }} mails today.
{%- endif -%}
- service: notify.ios_devices
data_template:
- message: "USPS will be delivering {{ states.sensor.usps_mail.state }} mail(s) today."
+ message: "USPS will be delivering {{ states('sensor.usps_mail') }} mail(s) today."
data:
push:
category: camera
@@ -71,8 +72,8 @@ automation:
url: "{{ state_attr('camera.usps_mail_pictures', 'entity_picture') }}"
content-type: jpg
-# Notify USPS packages via TTS. Usually there are no pictures for packages
-###############################################################################
+ # Notify USPS packages via TTS. Usually there are no pictures for packages
+ ###############################################################################
- alias: Notify USPS Packages
initial_state: true
trigger:
@@ -80,15 +81,17 @@ automation:
entity_id: sensor.usps_packages
condition:
- condition: template
- value_template: '{{ states.sensor.usps_packages.state | int > 0 }}'
+ value_template: "{{ states('sensor.usps_packages') != 'unknown' }}"
- condition: template
- value_template: '{{ ((now().hour | int) > 7) and ((now().hour | int) < 16) }}'
+ value_template: "{{ states('sensor.usps_packages') | int > 0 }}"
+ - condition: template
+ value_template: "{{ ((now().hour | int) > 7) and ((now().hour | int) < 16) }}"
action:
- service: script.voice_notify
data_template:
message: >
- {%- if states.sensor.usps_packages.state | int == 1 -%}
- Attention: USPS is delivering {{ states.sensor.usps_packages.state }} package today.
+ {%- if states('sensor.usps_packages') | int == 1 -%}
+ Attention: USPS is delivering {{ states('sensor.usps_packages') }} package today.
{%- else -%}
- Attention: USPS is delivering {{ states.sensor.usps_packages.state }} packages today.
- {%- endif -%}
\ No newline at end of file
+ Attention: USPS is delivering {{ states('sensor.usps_packages') }} packages today.
+ {%- endif -%}
diff --git a/packages/weather.yaml b/packages/weather.yaml
index 30fd3b3..99c126b 100644
--- a/packages/weather.yaml
+++ b/packages/weather.yaml
@@ -58,11 +58,6 @@ homeassistant:
icon: mdi:weather-windy-variant
homebridge_hidden: true
-camera:
- - platform: generic
- name: Ohio Doppler Weather
- still_image_url: !secret ohio_doppler_weather
-
input_boolean:
nice_breeze_alert:
name: Nice Breeze Alert
@@ -121,8 +116,8 @@ weather:
- platform: darksky
api_key: !secret darksky_api_key
-openuv:
- api_key: !secret openuv_apikey
+# openuv:
+# api_key: !secret openuv_apikey
# iqvia:
# zip_code: !secret zip_code
@@ -355,13 +350,13 @@ automation:
{%- elif curState == "sleet" %}
input_boolean.sleet_alert
{%- endif %}
+ # - alias: Update OpenUV every hour (24 of 50 calls per day)
+ # trigger:
+ # platform: time_pattern
+ # minutes: "/60"
+ # action:
+ # service: openuv.update_data
- - alias: Update OpenUV every hour (24 of 50 calls per day)
- trigger:
- platform: time_pattern
- minutes: "/60"
- action:
- service: openuv.update_data
# Weather sensors - TBD, too lazy to create them
#
# {{ states.sun.sun.state }}
diff --git a/packages/wfh.yaml b/packages/wfh.yaml
index 04c258e..bf1fec1 100644
--- a/packages/wfh.yaml
+++ b/packages/wfh.yaml
@@ -35,13 +35,13 @@ automation:
seconds: 00
condition:
- condition: template
- value_template: '{{ states.binary_sensor.workday_sensor.state == "on" }}'
+ value_template: "{{ states('binary_sensor.workday_sensor') == 'on' }}"
- condition: template
value_template: "{{ now().hour|int >= 10 and now().hour|int < 17 }}"
- condition: template
- value_template: '{{ states.timer.wfh_timer.state == "idle" }}'
+ value_template: "{{ states('timer.wfh_timer') == 'idle' }}"
- condition: template
- value_template: '{{ states.device_tracker.life360_suresh.state == "home" }}'
+ value_template: "{{ states('device_tracker.life360_suresh') == 'home' }}"
action:
- service: timer.start
entity_id: timer.wfh_timer
@@ -81,7 +81,7 @@ automation:
event: leave
condition:
- condition: template
- value_template: '{{ states.timer.wfh_timer.state == "active" }}'
+ value_template: "{{ states('timer.wfh_timer') == 'active' }}"
action:
- service: timer.cancel
entity_id: timer.wfh_timer
diff --git a/packages/zones.yaml b/packages/zones.yaml
index d82b1b5..e56a437 100644
--- a/packages/zones.yaml
+++ b/packages/zones.yaml
@@ -107,7 +107,7 @@ automation:
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.state | int) + 5 }} minutes.
+ and will be home in {{ (states('sensor.suresh2home') | int) + 5 }} minutes.
{% endif %}
greeting: "no"
@@ -154,13 +154,13 @@ automation:
seconds: "/30"
condition:
- condition: template
- value_template: '{{ states.input_boolean.home_mode_away.state == "off" }}'
+ value_template: "{{ states('input_boolean.home_mode_away') == 'off' }}"
- condition: template
value_template: >
- {% set suresh = states.device_tracker.life360_suresh.state %}
- {% set mallika = states.device_tracker.life360_mallika.state %}
- {% set srinika = states.device_tracker.life360_srinika.state %}
- {% set hasika = states.device_tracker.life360_hasika.state %}
+ {% set suresh = states('device_tracker.life360_suresh') %}
+ {% set mallika = states('device_tracker.life360_mallika') %}
+ {% set srinika = states('device_tracker.life360_srinika') %}
+ {% set hasika = states('device_tracker.life360_hasika') %}
{% if suresh != "home" and mallika != "home" and srinika != "home" and hasika != "home" %}
True
{% else %}
@@ -198,10 +198,10 @@ automation:
message: "Suresh is on his way home, he is within the 5 miles range. Should be home soon!"
- condition: template
value_template: >
- {% set suresh = states.device_tracker.life360_suresh.state %}
- {% set mallika = states.device_tracker.life360_mallika.state %}
- {% set srinika = states.device_tracker.life360_srinika.state %}
- {% set hasika = states.device_tracker.life360_hasika.state %}
+ {% set suresh = states('device_tracker.life360_suresh') %}
+ {% set mallika = states('device_tracker.life360_mallika') %}
+ {% set srinika = states('device_tracker.life360_srinika') %}
+ {% set hasika = states('device_tracker.life360_hasika') %}
{% if suresh != "home" and mallika != "home" and srinika != "home" and hasika != "home" %}
True
{% else %}
diff --git a/packages/zwave_batteries.yaml b/packages/zwave_batteries.yaml
index e08342f..257466a 100644
--- a/packages/zwave_batteries.yaml
+++ b/packages/zwave_batteries.yaml
@@ -33,13 +33,13 @@ input_label:
hasika_wifi:
###############################################################################
-# _ _ _
-# /\ | | | | (_)
-# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
+# _ _ _
+# /\ | | | | (_)
+# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
# / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \/ __|
# / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | \__ \
# /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_|___/
-#
+#
###############################################################################
automation:
@@ -100,11 +100,11 @@ automation:
data_template:
entity_id: "input_label.{{trigger.topic.split('/')[-1]}}_wifi"
value: "{{trigger.topic.split('/')[-1] | title }}'s phone wifi enabled?"
-
+
- service: input_label.set_value
data_template:
entity_id: "input_label.{{trigger.topic.split('/')[-1]}}_battery"
- value: '{{ trigger.payload_json.batt | int }}'
+ value: "{{ trigger.payload_json.batt | int }}"
- service: input_label.set_name
data_template:
entity_id: "input_label.{{trigger.topic.split('/')[-1]}}_battery"
@@ -113,22 +113,22 @@ automation:
data_template:
entity_id: "input_label.{{trigger.topic.split('/')[-1]}}_battery"
value: >
- {% set battery_level = trigger.payload_json.batt | int %}
- {% set battery_round = (battery_level / 10)|int * 10 %}
- {% if trigger.payload_json.charging == 1 %}
- {% if battery_round >= 100 %}
- mdi:battery-charging-100
- {% elif battery_round > 0 %}
- mdi:battery-charging-{{ battery_round }}
- {% else %}
- mdi:battery-alert
- {% endif %}
+ {% set battery_level = trigger.payload_json.batt | int %}
+ {% set battery_round = (battery_level / 10)|int * 10 %}
+ {% if trigger.payload_json.charging == 1 %}
+ {% if battery_round >= 100 %}
+ mdi:battery-charging-100
+ {% elif battery_round > 0 %}
+ mdi:battery-charging-{{ battery_round }}
{% else %}
- {% if battery_round >= 100 %}
- mdi:battery
- {% elif battery_round > 0 %}
- mdi:battery-{{ battery_round }}
- {% else %}
- mdi:battery-alert
- {% endif %}
- {% endif %}
\ No newline at end of file
+ mdi:battery-alert
+ {% endif %}
+ {% else %}
+ {% if battery_round >= 100 %}
+ mdi:battery
+ {% elif battery_round > 0 %}
+ mdi:battery-{{ battery_round }}
+ {% else %}
+ mdi:battery-alert
+ {% endif %}
+ {% endif %}
diff --git a/packages/zwave_sensors.yaml b/packages/zwave_sensors.yaml
index 85d66ce..6fe13a1 100644
--- a/packages/zwave_sensors.yaml
+++ b/packages/zwave_sensors.yaml
@@ -10,8 +10,7 @@
homeassistant:
customize:
-
-# ZWave Binary Sensors
+ # ZWave Binary Sensors
binary_sensor.aeotec_water_sensor_sensor:
friendly_name: Aeotec Water Sensor
## <<: *not_exposed
@@ -58,7 +57,7 @@ homeassistant:
friendly_name: Upstairs Multi Sensor
## <<: *not_exposed
-# ZWave Sensors
+ # ZWave Sensors
sensor.aeotec_water_sensor_alarm_level:
friendly_name: Aeotec Water Sensor Alarm Level
# <<: *not_exposed
@@ -402,7 +401,7 @@ homeassistant:
friendly_name: ZWave Smart Switch Voltage
# <<: *not_exposed
-# ZWave Switches
+ # ZWave Switches
switch.kitchen_siren_switch:
friendly_name: Kitchen Siren Switch 1
@@ -428,16 +427,15 @@ zwave:
network_key: !secret zwave_network_key
###############################################################################
-# _ _ _
-# /\ | | | | (_)
-# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
+# _ _ _
+# /\ | | | | (_)
+# / \ _ _| |_ ___ _ __ ___ __ _| |_ _ ___ _ __ ___
# / /\ \| | | | __/ _ \| '_ ` _ \ / _` | __| |/ _ \| '_ \/ __|
# / ____ \ |_| | || (_) | | | | | | (_| | |_| | (_) | | | \__ \
# /_/ \_\__,_|\__\___/|_| |_| |_|\__,_|\__|_|\___/|_| |_|___/
-#
+#
###############################################################################
automation:
-
- alias: WallMote Button 1 Pressed
trigger:
- platform: event
@@ -471,7 +469,7 @@ automation:
- service: climate.set_away_mode
data_template:
entity_id: climate.dining_room
- away_mode: 'false'
+ away_mode: "false"
- alias: WallMote Button 4 Pressed
trigger:
@@ -484,4 +482,4 @@ automation:
- service: climate.set_away_mode
data_template:
entity_id: climate.dining_room
- away_mode: 'true'
\ No newline at end of file
+ away_mode: "true"
diff --git a/templates/away_status.yaml b/templates/away_status.yaml
index 4307612..d8f018a 100644
--- a/templates/away_status.yaml
+++ b/templates/away_status.yaml
@@ -1,10 +1,10 @@
- >
+>
{% macro weather_update() -%}
- Outside temperature is {{ states.sensor.dark_sky_apparent_temperature.state | round(0) }} degrees.
+ Outside temperature is {{ states('sensor.dark_sky_apparent_temperature') | round(0) }} degrees.
{%- endmacro -%}
-
+
{%- macro uv_levels() -%}
- {%- set uv = states.sensor.pws_uv.state | int -%}
+ {%- set uv = states('sensor.pws_uv') | int -%}
{%- if uv >= 6 and uv <= 7 -%}
Current UV index is high. Please be careful outdoors.
{%- elif uv >= 8 and uv <= 10 -%}
@@ -15,47 +15,47 @@
Good UV levels.
{%- endif -%}
{%- endmacro -%}
-
+
{%- macro USPS() -%}
- USPS is going to deliver {{ states.sensor.usps_mail.state }} mails today.
+ USPS is going to deliver {{ states('sensor.usps_mail') }} mails today.
{%- endmacro -%}
-
+
{%- macro alert_battery_levels() %}
{% for item in states if 'battery_level' in item.attributes and item.attributes.battery_level | int > 0 and item.attributes.battery_level | float <= 10.0 -%}{{- item.attributes.friendly_name ~ " battery is less than 10 percent" -}}
{%- if loop.first %}, {% elif loop.last %}, {% else %}, {% endif -%}
{%- endfor -%}
{%- endmacro -%}
-
+
{%- macro tesla_status() -%}
{%- if states("sensor.tesla_model_3_5yj3e1ea8jf010610_range_sensor") != "unknown" -%}
- Your Tesla car battery is at {{ states.sensor.tesla_model_3_5yj3e1ea8jf010610_battery_sensor.state }} percent ({{ (states.sensor.tesla_model_3_5yj3e1ea8jf010610_range_sensor.state | int) | round(0) }} miles).
+ Your Tesla car battery is at {{ states('sensor.tesla_model_3_5yj3e1ea8jf010610_battery_sensor') }} percent ({{ (states('sensor.tesla_model_3_5yj3e1ea8jf010610_range_sensor') | int) | round(0) }} miles).
{%- endif -%}
{%- endmacro -%}
-
+
{%- macro pollen_levels() -%}
- Pollen level is {{ states.sensor.pollen_level.state }}.
+ Pollen level is {{ states('sensor.pollen_level') }}.
{%- endmacro -%}
-
+
{%- macro humidity_status() -%}
Home humidity is {{ states('sensor.dining_room_thermostat_humidity') }} percent.
{%- endmacro -%}
-
+
{%- macro alarm_status() -%}
Your home is {{ "SECURED!" if states('alarm_control_panel.simplisafe') == "armed_away" or states('alarm_control_panel.simplisafe') == "armed_home" else "UNSECURED!" }}
{%- endmacro -%}
-
+
{%- macro single_car_garage_door_status() -%}
- {%- if states.binary_sensor.single_car_garage_door_tilt_sensor_sensor.state|lower == "on" -%}
+ {%- if states('binary_sensor.single_car_garage_door_tilt_sensor_sensor') |lower == "on" -%}
{{ states.binary_sensor.single_car_garage_door_tilt_sensor_sensor.attributes.friendly_name }} is OPEN
{%- endif -%}
{%- endmacro -%}
{%- macro two_car_garage_door_status() -%}
- {% if states.binary_sensor.two_car_garage_door_tilt_sensor_sensor.state|lower == "on" %}
+ {% if states('binary_sensor.two_car_garage_door_tilt_sensor_sensor') |lower == "on" %}
{{ states.binary_sensor.two_car_garage_door_tilt_sensor_sensor.attributes.friendly_name }} is OPEN
{% endif %}
{%- endmacro -%}
-
+
{%- macro garage_status() -%}
{%- set single_car_garage = single_car_garage_door_status() -%}
{%- set two_car_garage = two_car_garage_door_status() -%}
@@ -67,11 +67,11 @@
Warning! {{ single_car_garage }} {{ two_car_garage }}
{%- endif -%}
{%- endmacro -%}
-
+
{%- macro plural(name) -%}
{{- "true" if name.endswith("s") else "false" -}}
{%- endmacro -%}
-
+
{%- macro light_status() -%}
{%- set lights_switches = ["light.family_room",
"light.master_bedroom",
@@ -94,7 +94,7 @@
{% endif %}
{%- endfor -%}
{%- endmacro -%}
-
+
{%- macro mother_of_all_macros() -%}
{{ alarm_status() }}
{{ garage_status() }}
@@ -107,5 +107,5 @@
{{ alert_battery_levels() }}
{{ light_status() }}
{%- endmacro -%}
-
- {{- mother_of_all_macros() -}}
\ No newline at end of file
+
+ {{- mother_of_all_macros() -}}
diff --git a/templates/goodnight.yaml b/templates/goodnight.yaml
index bf669ca..476c268 100644
--- a/templates/goodnight.yaml
+++ b/templates/goodnight.yaml
@@ -46,23 +46,23 @@
{#- Provides Home Security System Status -#}
{%- macro alarm_status() -%}
- {%- if states.alarm_control_panel.simplisafe.state | lower == "disarmed" -%}
+ {%- if states('alarm_control_panel.simplisafe') | lower == "disarmed" -%}
Your home security system is switched OFF. You may want to turn it ON.
- {%- elif states.alarm_control_panel.simplisafe.state | lower == "armed_away" -%}
+ {%- elif states('alarm_control_panel.simplisafe') | lower == "armed_away" -%}
Your home security system is set to away mode.
- {%- elif states.alarm_control_panel.simplisafe.state | lower == "armed_home" -%}
+ {%- elif states('alarm_control_panel.simplisafe') | lower == "armed_home" -%}
Your home security system is ON, and your home is secured.
{%- endif %}
{%- endmacro -%}
-
+
{#- Provides Trash and Recycle Reminder -#}
{%- macro trash_recycle_status() -%}
{%- set flag = false -%}
- {%- if states.sensor.trash_day.state | lower == "yes" -%}
+ {%- if states('sensor.trash_day') | lower == "yes" -%}
Your trash will be picked up tomorrow. Did you leave the trash bin outside?.
{%- set flag = true -%}
{%- endif %}
- {%- if states.sensor.recycle_day.state | lower == "yes" -%}
+ {%- if states('sensor.recycle_day') | lower == "yes" -%}
{%- if flag -%}
Also, your recycle stuff will be picked up tomorrow as well! Please leave both recycle bin and trash cans outside if you haven't!.
{%- else -%}
@@ -70,19 +70,19 @@
{%- endif -%}
{%- endif %}
{%- endmacro -%}
-
+
{%- macro outside_weather() -%}
{%- if states('sensor.dark_sky_minutely_summary') != "unknown" -%}
Outside, it is going to be {{states('sensor.dark_sky_minutely_summary')}}.
{%- endif -%}
{%- if states('sensor.dark_sky_apparent_temperature') != "unknown" %}
- The temperature outside is around {{ states.sensor.dark_sky_apparent_temperature.state | round(0)}} degrees.
+ The temperature outside is around {{ states('sensor.dark_sky_apparent_temperature') | round(0)}} degrees.
{%- endif -%}
{%- endmacro -%}
-
+
{%- macro pihole() -%}
- {%- if states.sensor.ads_blocked_today.state|int > 100 -%}
- Our internet blocking system has blocked {{states.sensor.ads_blocked_today.state}} ads today.
+ {%- if states('sensor.ads_blocked_today') |int > 100 -%}
+ Our internet blocking system has blocked {{states('sensor.ads_blocked_today') }} ads today.
{%- endif -%}
{%- endmacro -%}
@@ -103,35 +103,35 @@
{#- Provides Garage Doors Status -#}
{%- macro single_car_garage_door_status() -%}
- {% if states.binary_sensor.single_car_garage_door_tilt_sensor_sensor.state|lower == "on" %}
+ {% if states('binary_sensor.single_car_garage_door_tilt_sensor_sensor') |lower == "on" %}
{{ states.binary_sensor.single_car_garage_door_tilt_sensor_sensor.attributes.friendly_name }} is OPEN
{% endif %}
{%- endmacro -%}
-
+
{%- macro two_car_garage_door_status() -%}
- {% if states.binary_sensor.two_car_garage_door_tilt_sensor_sensor.state|lower == "on" %}
+ {% if states('binary_sensor.two_car_garage_door_tilt_sensor_sensor') |lower == "on" %}
{{ states.binary_sensor.two_car_garage_door_tilt_sensor_sensor.attributes.friendly_name }} is OPEN
{% endif %}
{%- endmacro -%}
{%- macro tesla_status() %}
{%- if states("binary_sensor.tesla_model_3_5yj3e1ea8jf010610_charger_sensor") != "unknown" -%}
- Your Tesla Car is {{ 'not' if states.binary_sensor.tesla_model_3_5yj3e1ea8jf010610_charger_sensor.state == "off" }} plugged in.
+ Your Tesla Car is {{ 'not' if states('binary_sensor.tesla_model_3_5yj3e1ea8jf010610_charger_sensor') == "off" }} plugged in.
{% endif %}
{%- if states("sensor.tesla_model_3_5yj3e1ea8jf010610_battery_sensor") != "unknown" and states("sensor.tesla_model_3_5yj3e1ea8jf010610_range_sensor") != "unknown" and states('sensor.tesla_model_3_5yj3e1ea8jf010610_battery_sensor') | int > 0 -%}
- Tesla Car battery is at {{ states.sensor.tesla_model_3_5yj3e1ea8jf010610_battery_sensor.state }}%, and you can drive about {{ (states.sensor.tesla_model_3_5yj3e1ea8jf010610_range_sensor.state | int) | round(0) }} miles.
+ Tesla Car battery is at {{ states('sensor.tesla_model_3_5yj3e1ea8jf010610_battery_sensor') }}%, and you can drive about {{ (states.sensor.tesla_model_3_5yj3e1ea8jf010610_range_sensor.state | int) | round(0) }} miles.
{% endif %}
{%- endmacro %}
{#- Check for low humidity levels in autumn, winter and high levels during rest of the year -#}
{%- macro humidity_status() -%}
- {%- if states.sensor.season.state| lower == "autumn" or states.sensor.season.state| lower == "winter" %}
- {%- if states.sensor.dining_room_thermostat_humidity.state | int < 30 -%}
+ {%- if states('sensor.season') | lower == "autumn" or states('sensor.season') | lower == "winter" %}
+ {%- if states('sensor.dining_room_thermostat_humidity') | int < 30 -%}
Home humidity is less than 30%.
{%- endif -%}
{% else %}
- {%- if states.sensor.dining_room_thermostat_humidity.state | default(0) | int > 60 -%}
+ {%- if states('sensor.dining_room_thermostat_humidity') | default(0) | int > 60 -%}
Home humidity is more than 60%.
{%- endif -%}
{%- endif -%}
@@ -187,5 +187,5 @@
{{- humidity_status() -}}
{{- outside_weather() }} Everything else looks good. {{ getGreeting() }}
{%- endmacro -%}
-
+
{{- clean_up(run_script()) -}}
diff --git a/templates/home_status.yaml b/templates/home_status.yaml
index a7194b6..c20968c 100644
--- a/templates/home_status.yaml
+++ b/templates/home_status.yaml
@@ -6,13 +6,15 @@
{%- endmacro %}
{# Birthday notifications #}
- {%- macro birthday_countdown( name, days2go ) -%}
- {%- if days2go == 0 -%}
- Today is {{name}}'s Birthday!. Happy Birthday to you, my dear {{name}}!!!.
- {%- elif days2go == 1 -%}
- Tomorrow is {{name}}'s Birthday! HURRAY!!!
- {%- elif days2go > 1 and days2go <= 10 -%}
- {{name}}'s Birthday is in {{days2go}} days! HURRAY!!!
+ {%- macro birthday_countdown(name, days2go) -%}
+ {%if days2go != 'unknown' %}
+ {%- if days2go |int == 0 -%}
+ Today is {{name}}'s Birthday!. Happy Birthday to you, my dear {{name}}!!!.
+ {%- elif days2go |int == 1 -%}
+ Tomorrow is {{name}}'s Birthday! HURRAY!!!
+ {%- elif days2go |int > 1 and days2go |int <= 10 -%}
+ {{name}}'s Birthday is in {{days2go}} days! HURRAY!!!
+ {%- endif -%}
{%- endif -%}
{%- endmacro -%}
@@ -58,7 +60,7 @@
{% else %}
{% set days2NextEvent = strptime((now().year ~ "-12-31 12:02:05"), '%Y-%m-%d %H:%M:%S').strftime('%j') | int - (now().strftime('%j') | int) + (strptime(states.calendar.suresh_kalavala.attributes.start_time, '%Y-%m-%d %H:%M:%S').strftime('%j') | int) -%}
{% endif -%}
- {% if days2NextEvent <= (states.input_number.calendar_remind_before_days.state | int) %}
+ {% if days2NextEvent <= states('input_number.calendar_remind_before_days') | int %}
Your next event. {{ states.calendar.suresh_kalavala.attributes.message }} . starts
{% if days2NextEvent == 0 | int %}
today at {{ strptime(states.calendar.suresh_kalavala.attributes.start_time, '%Y-%m-%d %H:%M:%S').strftime('%I:%M %p') }}.
@@ -83,7 +85,7 @@
{% else %}
{% set days2NextEvent = strptime((now().year ~ "-12-31 12:02:05"), '%Y-%m-%d %H:%M:%S').strftime('%j') | int - (now().strftime('%j') | int) + (strptime(states.calendar.holidays_in_india.attributes.start_time, '%Y-%m-%d %H:%M:%S').strftime('%j') | int) -%}
{% endif -%}
- {% if days2NextEvent <= (states.input_number.calendar_remind_before_days.state | int) %}
+ {% if days2NextEvent <= (states('input_number.calendar_remind_before_days') | int) %}
{% if days2NextEvent == 0 | int %}
Today is {{ states.calendar.holidays_in_india.attributes.message | replace(".", "")}}.
{%- elif days2NextEvent == 1 %}
@@ -106,7 +108,7 @@
{% else %}
{% set days2NextEvent = strptime((now().year ~ "-12-31 12:02:05"), '%Y-%m-%d %H:%M:%S').strftime('%j') | int - (now().strftime('%j') | int) + (strptime(states.calendar.holidays_in_united_states.attributes.start_time, '%Y-%m-%d %H:%M:%S').strftime('%j') | int) -%}
{% endif -%}
- {% if days2NextEvent <= (states.input_number.calendar_remind_before_days.state | int) %}
+ {% if days2NextEvent <= (states('input_number.calendar_remind_before_days') | int) %}
{% if days2NextEvent == 0 | int %}
Today is {{ states.calendar.holidays_in_united_states.attributes.message | replace(".", "")}}.
{%- elif days2NextEvent == 1 %}
@@ -161,9 +163,9 @@
{# Drone Flying Weather #}
{%- macro drone_weather() -%}
- {% if states.binary_sensor.good_weather_to_fly_drones.state| lower == "on" and
- states.device_tracker.life360_suresh.state == "home" and
- states.sun.sun.state == "above_horizon" %}
+ {% if states('binary_sensor.good_weather_to_fly_drones')| lower == "on" and
+ states('device_tracker.life360_suresh') == "home" and
+ states('sun.sun') == "above_horizon" %}
It is now a great weather to fly drone outside.
{% endif %}
{%- endmacro -%}
@@ -202,9 +204,9 @@
{{ USPS() }}
{{ tesla_status() }}
{{ drone_weather() }}
- {{ birthday_countdown("Mallika", states.input_label.mallika_birthday_days2go.state | int ) }}
- {{ birthday_countdown("Srinika", states.input_label.srinika_birthday_days2go.state | int ) }}
- {{ birthday_countdown("Hasika", states.input_label.hasika_birthday_days2go.state | int ) }}
+ {{ birthday_countdown("Mallika", states('input_label.mallika_birthday_days2go')) }}
+ {{ birthday_countdown("Srinika", states('input_label.srinika_birthday_days2go')) }}
+ {{ birthday_countdown("Hasika", states('input_label.hasika_birthday_days2go')) }}
{%- endmacro -%}
{# Call the macro #}
diff --git a/zwcfg_0xd89c4f0c.xml b/zwcfg_0xd89c4f0c.xml
index 3ced8d6..58c8e55 100644
--- a/zwcfg_0xd89c4f0c.xml
+++ b/zwcfg_0xd89c4f0c.xml
@@ -34,10 +34,10 @@
-
+
-
+
@@ -168,7 +168,7 @@
-
+
@@ -208,7 +208,7 @@
-
+
@@ -216,9 +216,9 @@
-
+
-
+
@@ -350,7 +350,7 @@
-
+
@@ -390,7 +390,7 @@
-
+
@@ -415,7 +415,7 @@
-
+
@@ -574,7 +574,7 @@
-
+
@@ -728,9 +728,9 @@
-
+
-
+
@@ -984,7 +984,7 @@
-
+
@@ -1006,12 +1006,12 @@
-
-
+
+
-
-
-
+
+
+
@@ -1190,8 +1190,8 @@
-
-
+
+
@@ -1339,7 +1339,7 @@
-
+
@@ -1369,7 +1369,7 @@
-
+
@@ -2038,7 +2038,7 @@
-
+
@@ -2238,7 +2238,7 @@
-
+
@@ -2253,7 +2253,7 @@
-
+
@@ -2405,9 +2405,9 @@
-
+
-
+
@@ -2580,7 +2580,7 @@
-
+
@@ -2666,7 +2666,7 @@
-
+