mirror of
https://github.com/skalavala/mysmarthome.git
synced 2025-08-28 08:50:57 +00:00
minor updates
This commit is contained in:
@@ -407,31 +407,31 @@ automation:
|
||||
data_template:
|
||||
message: "{{ trigger.to_state.attributes.friendly_name.split(' ')[1] }}'s phone battery is : {{ trigger.to_state.attributes.battery }}%."
|
||||
|
||||
- alias: Alert Low Battery
|
||||
trigger:
|
||||
- platform: template
|
||||
value_template: >
|
||||
{% set ns = namespace(lowBattery=false) %}
|
||||
{%- for x in states if x.attributes and x.attributes.battery_level and x.attributes.battery_level |int <= 24 %}
|
||||
{% set ns.lowBattery = true %}{% endfor %}
|
||||
{{ ns.lowBattery }}
|
||||
condition:
|
||||
- condition: template
|
||||
value_template: "{{ ((trigger.to_state.state | int) < states('sensor.battery_alert_threshold') | int) }}"
|
||||
action:
|
||||
- service: script.voice_notify
|
||||
data_template:
|
||||
message: >
|
||||
{% set ns = namespace(lowBattery="") %}
|
||||
{%- for x in states if x.attributes and x.attributes.battery_level and x.attributes.battery_level |int <= 24 %}
|
||||
{%- if loop.first %}The {% elif loop.last %} and the {% else %}, the {% endif -%}
|
||||
{% set ns.lowBattery = ns.lowBattery ~ ',' ~ x.name %}
|
||||
{%- endfor %}
|
||||
{{ ns.lowBattery -}}
|
||||
{{- ' battery is ' if ns.lowBattery.split(',')|count == 2 else ' batteries are ' -}} less than 25 percent.
|
||||
- service: script.led_message
|
||||
data_template:
|
||||
message: "{{ trigger.to_state.attributes.friendly_name.split(' ')[1] }}'s phone battery is : {{ trigger.to_state.attributes.battery }}%."
|
||||
# - alias: Alert Low Battery
|
||||
# trigger:
|
||||
# - platform: template
|
||||
# value_template: >
|
||||
# {% set ns = namespace(lowBattery=false) %}
|
||||
# {%- for x in states if x.attributes and x.attributes.battery_level and x.attributes.battery_level |int <= 24 %}
|
||||
# {% set ns.lowBattery = true %}{% endfor %}
|
||||
# {{ ns.lowBattery }}
|
||||
# condition:
|
||||
# - condition: template
|
||||
# value_template: "{{ ((trigger.to_state.state | int) < states('sensor.battery_alert_threshold') | int) }}"
|
||||
# action:
|
||||
# - service: script.voice_notify
|
||||
# data_template:
|
||||
# message: >
|
||||
# {% set ns = namespace(lowBattery="") %}
|
||||
# {%- for x in states if x.attributes and x.attributes.battery_level and x.attributes.battery_level |int <= 24 %}
|
||||
# {%- if loop.first %}The {% elif loop.last %} and the {% else %}, the {% endif -%}
|
||||
# {% set ns.lowBattery = ns.lowBattery ~ ',' ~ x.name %}
|
||||
# {%- endfor %}
|
||||
# {{ ns.lowBattery -}}
|
||||
# {{- ' battery is ' if ns.lowBattery.split(',')|count == 2 else ' batteries are ' -}} less than 25 percent.
|
||||
# - service: script.led_message
|
||||
# data_template:
|
||||
# message: "{{ trigger.to_state.attributes.friendly_name.split(' ')[1] }}'s phone battery is : {{ trigger.to_state.attributes.battery }}%."
|
||||
|
||||
- alias: Check Wi-Fi Status of iPhones At Home
|
||||
initial_state: true
|
||||
|
@@ -717,6 +717,10 @@ automation:
|
||||
(states.binary_sensor.motion_sensor_158d00024ee084.last_updated ~ '').replace('-','_')
|
||||
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
|
||||
caption: "Garage"
|
||||
- file: "{{ '/config/www/downloads/camera/porch/porch_' ~
|
||||
(states.binary_sensor.motion_sensor_158d00024ee084.last_updated ~ '').replace('-','_')
|
||||
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
|
||||
caption: Porch
|
||||
|
||||
- service: notify.notify_smtp
|
||||
data_template:
|
||||
@@ -733,6 +737,9 @@ automation:
|
||||
- "{{ '/config/www/downloads/camera/garage/garage_' ~
|
||||
(states.binary_sensor.motion_sensor_158d00024ee084.last_updated ~ '').replace('-','_')
|
||||
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
|
||||
- "{{ '/config/www/downloads/camera/porch/porch_' ~
|
||||
(states.binary_sensor.motion_sensor_158d00024ee084.last_updated ~ '').replace('-','_')
|
||||
.replace(' ', '_').replace(':','_').replace('.','_').replace('+','_') ~ '.jpg' }}"
|
||||
|
||||
- condition: template
|
||||
value_template: "{{ states('device_tracker.life360_suresh') == 'home' }}"
|
||||
|
@@ -210,7 +210,6 @@ automation:
|
||||
# A gentle 10 minute reminder that the Home Security system is OFF
|
||||
###############################################################################
|
||||
- alias: Home Security System WatchDog 10 minutes
|
||||
initial_state: true
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
@@ -227,7 +226,6 @@ automation:
|
||||
# A gentle reminder that the home security is OFF for more than 30 minutes
|
||||
###############################################################################
|
||||
- alias: Home Security System WatchDog 30 minutes
|
||||
initial_state: true
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id:
|
||||
|
@@ -110,6 +110,7 @@ tplink:
|
||||
#name: Upstairs Fragrance Outlet
|
||||
- host: !secret tplink_kids_bed_accent_light
|
||||
#name: Kids Bed Accent Light
|
||||
- host: !secret tplink_3d_printer
|
||||
dimmer:
|
||||
- host: !secret tplink_bathroom_lights
|
||||
strip:
|
||||
|
@@ -65,5 +65,6 @@ telegram_bot:
|
||||
# Add Polling
|
||||
- platform: polling
|
||||
api_key: !secret telegram_apikey
|
||||
parse_mode: html
|
||||
allowed_chat_ids:
|
||||
- !secret telegram_chatid
|
||||
|
@@ -148,7 +148,7 @@ sensor:
|
||||
value_template: "{{value_json.Location.periods[1].Index}}"
|
||||
scan_interval: 21600
|
||||
headers:
|
||||
Referer: "https://www.pollen.com"
|
||||
Referer: !secret weather_pollen_url
|
||||
|
||||
- platform: rest
|
||||
name: cold_flu
|
||||
@@ -156,7 +156,7 @@ sensor:
|
||||
value_template: "{{value_json.Location.periods[0].Index}}"
|
||||
scan_interval: 21600
|
||||
headers:
|
||||
Referer: "https://www.pollen.com"
|
||||
Referer: !secret weather_pollen_url
|
||||
|
||||
###############################################################################
|
||||
# _ _ _
|
||||
|
Reference in New Issue
Block a user