Skip to content

Commit

Permalink
Add monitoring of door lock batteries and status on UI
Browse files Browse the repository at this point in the history
  • Loading branch information
nalipaz committed Mar 28, 2018
1 parent 330244d commit e982e3f
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 1 deletion.
3 changes: 2 additions & 1 deletion config/groups/batteries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ batteries:
- group.fire_alarm_batteries
- group.door_batteries
- group.slider_batteries
- group.window_batteries
- group.window_batteries
- group.door_lock_batteries
1 change: 1 addition & 0 deletions config/groups/default_view.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ default_view:
- group.thermostat
- group.fire_alarms
- media_player.roku_5s56d1020224
- group.lock_status
86 changes: 86 additions & 0 deletions config/packages/door_locks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,20 @@ automation:


group:
door_lock_batteries:
name: Door Locks
entities:
- sensor.door_lock_batteries_4thbedroom_door
- sensor.door_lock_batteries_front_door
- sensor.door_lock_batteries_garageside_door
- sensor.door_lock_batteries_rear_door
lock_status:
name: Lock Status
entities:
- zwave.lock.4thbedroom_door
- zwave.lock.front_door
- zwave.lock.garageside_door
- zwave.lock.rear_door
keypads:
name: Personal Entry Codes
view: yes
Expand Down Expand Up @@ -3102,6 +3116,78 @@ script:
sensor:
- platform: template
sensors:
door_lock_batteries_fourth_bedroom_door:
value_template: '{{states["zwave"]["lock_4thbedroom_door"]["attributes"]["battery_level"]}}'
friendly_name: Fourth Bedroom
unit_of_measurement: '%'
icon_template: >-
{% set level = ((states["zwave"]["lock_4thbedroom_door"]["attributes"]["battery_level"]*0.1)|round)*10|int %}
mdi:battery
{%- if level > 90 -%}
{%- elif level > 70 or ( level < 31 and level > 10 ) -%}
-{{ level }}
{%- elif level > 50 -%}
-60
{%- elif level > 30 -%}
-40
{%- else -%}
-alert
{%- endif -%}
door_lock_batteries_front_door:
value_template: '{{states["zwave"]["lock_front_door"]["attributes"]["battery_level"]}}'
friendly_name: Front Door
unit_of_measurement: '%'
icon_template: >-
{% set level = ((states["zwave"]["lock_front_door"]["attributes"]["battery_level"]*0.1)|round)*10|int %}
mdi:battery
{%- if level > 90 -%}
{%- elif level > 70 or ( level < 31 and level > 10 ) -%}
-{{ level }}
{%- elif level > 50 -%}
-60
{%- elif level > 30 -%}
-40
{%- else -%}
-alert
{%- endif -%}
door_lock_batteries_garageside_door:
value_template: '{{states["zwave"]["lock_garageside_door"]["attributes"]["battery_level"]}}'
friendly_name: Garage Side Door
unit_of_measurement: '%'
icon_template: >-
{% set level = ((states["zwave"]["lock_garageside_door"]["attributes"]["battery_level"]*0.1)|round)*10|int %}
mdi:battery
{%- if level > 90 -%}
{%- elif level > 70 or ( level < 31 and level > 10 ) -%}
-{{ level }}
{%- elif level > 50 -%}
-60
{%- elif level > 30 -%}
-40
{%- else -%}
-alert
{%- endif -%}
door_lock_batteries_rear_door:
value_template: '{{states["zwave"]["lock_rear_door"]["attributes"]["battery_level"]}}'
friendly_name: Rear Door
unit_of_measurement: '%'
icon_template: >-
{% set level = ((states["zwave"]["lock_rear_door"]["attributes"]["battery_level"]*0.1)|round)*10|int %}
mdi:battery
{%- if level > 90 -%}
{%- elif level > 70 or ( level < 31 and level > 10 ) -%}
-{{ level }}
{%- elif level > 50 -%}
-60
{%- elif level > 30 -%}
-40
{%- else -%}
-alert
{%- endif -%}
keypad_1_temp_lock_turn_on:
friendly_name: Turn keypad 1 on
entity_id: sensor.date__time
Expand Down

0 comments on commit e982e3f

Please sign in to comment.