#285 - I think this is it!

This commit is contained in:
ccostan 2018-01-19 16:49:10 -05:00
parent c8b349dee8
commit 1a08b1d5d4
1 changed files with 33 additions and 1 deletions

View File

@ -17,10 +17,12 @@ sensor:
if (item.attributes.source_type is defined and item.state != 'home' and item.attributes.friendly_name not in
[
'Chromecast Audio 2',
'Carlo',
'Entry Alarm Panel',
'Dash Button',
'Master Bedroom Roku',
'Brother Printer',
'Stacey',
'Wii',
'Withings Scale'
])
@ -33,6 +35,35 @@ sensor:
{%- endfor -%}
{%- endfor -%}
- platform: template
sensors:
network_detail:
friendly_name: 'Network Monitor Detail'
value_template: >
{%- set domains = ['device_tracker'] -%}
{%- for domain in domains -%}
{%- for item in states[domain]
if (item.attributes.source_type is defined and item.state != 'home' and item.attributes.friendly_name not in
[
'Chromecast Audio 2',
'Carlo',
'Entry Alarm Panel',
'Dash Button',
'Master Bedroom Roku',
'Brother Printer',
'Stacey',
'Wii',
'Withings Scale'
])
and(as_timestamp(now()) - as_timestamp(item.last_changed)) > 600 -%}
{{ item.attributes.friendly_name }} - {{((as_timestamp(now()) - as_timestamp(item.last_changed))/60) | round() }} minutes
{%- if not loop.last -%}
{{'
'}}
{%- endif -%}
{%- endfor -%}
{%- endfor -%}
group:
network:
entities:
@ -43,7 +74,7 @@ group:
- sensor.speedtest_download
- sensor.speedtest_upload
- binary_sensor.carlowink
- sensor.network
- sensor.network_detail
#-------------------------------------------------------------------------------------
automation:
- alias: 'Device Status'
@ -58,6 +89,7 @@ automation:
- service: script.notify_engine
data_template:
value1: 'Offline Devices:'
value2: '{{((as_timestamp(now()) - as_timestamp(item.last_changed))/60) | round() }} minutes'
value3: "{{ trigger.to_state.state }}"
who: 'carlo'