Home-AssistantConfig/packages/network.yaml

174 lines
5.6 KiB
YAML
Raw Normal View History

2018-01-02 00:00:45 +00:00
#-------------------------------------------
# Network Related Packages
# @CCOSTAN
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
#-------------------------------------------
#-------------------------------------------
sensor:
- platform: template
sensors:
network:
friendly_name: 'Network Monitor'
value_template: >
{%- set domains = ['device_tracker'] -%}
{%- for domain in domains -%}
2018-01-19 20:55:12 +00:00
{%- 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',
2018-01-19 21:49:10 +00:00
'Carlo',
'Entry Alarm Panel',
'Dash Button',
'Master Bedroom Roku',
2018-02-03 22:15:56 +00:00
'Juicebox',
'Brother Printer',
2018-01-19 21:49:10 +00:00
'Stacey',
'Wii',
'Withings Scale'
])
and(as_timestamp(now()) - as_timestamp(item.last_changed)) > 600 -%}
2018-01-19 21:34:49 +00:00
{{ item.attributes.friendly_name }}
{%- if not loop.last -%}
{{'
'}}
{%- endif -%}
{%- endfor -%}
{%- endfor -%}
2018-01-19 20:55:12 +00:00
2018-01-19 21:49:10 +00:00
- 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
[
'Carlo_Bolt_EV',
2018-01-19 21:49:10 +00:00
'Chromecast Audio 2',
2018-01-21 21:12:10 +00:00
'JuiceBox',
2018-01-19 21:49:10 +00:00
'Carlo',
'Entry Alarm Panel',
'Dash Button',
'Ipmdemounit',
'Living Room Roku',
2018-01-19 21:49:10 +00:00
'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 -%}
2018-01-02 00:00:45 +00:00
group:
network:
entities:
- sensor.ha_installed_version
- sensor.ha_uptime
- sensor.since_last_boot_templated
2018-02-11 16:22:04 +00:00
- sensor.disk_use_percent_
- sensor.database_sensor
2018-01-02 00:00:45 +00:00
- sensor.speedtest_download
- sensor.speedtest_upload
- binary_sensor.carlowink
- sensor.network
2018-01-19 21:49:10 +00:00
- sensor.network_detail
# # Create full group with Loop!:
# {% for state in states.device_tracker-%}
# - {{ state.entity_id | lower }}
# {{ ' '}}
# {%- endfor -%}.
network_detail:
entities:
- device_tracker.alexa_echo
- device_tracker.amazon_dot_2
- device_tracker.amazon_fire_stick
- device_tracker.amazon_tap
- device_tracker.bedroom_alarm_panel
- device_tracker.brother_printer
- device_tracker.carlo
- device_tracker.carlo_bolt
- device_tracker.carlo_laptop
- device_tracker.carlo_nvr
- device_tracker.carlobhmain
- device_tracker.carlopihole
- device_tracker.chromecast_audio_1
- device_tracker.chromecast_audio_2
- device_tracker.circle
- device_tracker.entry_alarm_panel
- device_tracker.garage_ap
- device_tracker.gatorade_dash
- device_tracker.hue_hub_1
- device_tracker.hue_hub_2
- device_tracker.ipmdemounit
2018-02-03 22:15:56 +00:00
- device_tracker.juicebox
- device_tracker.justin_dot
- device_tracker.large_garage
- device_tracker.living_room_amp_outlet
- device_tracker.living_room_roku
- device_tracker.living_room_ultra
- device_tracker.master_bedroom_roku
- device_tracker.nest_downstairs
- device_tracker.nest_upstairs
- device_tracker.nodemcu1
- device_tracker.nodemcu2
- device_tracker.nodemcu3
- device_tracker.nodemcu4
- device_tracker.noon_switch
- device_tracker.rachio
- device_tracker.rgb_led_garage_large
- device_tracker.rgb_led_garage_small
- device_tracker.rgb_led_outdoor_den
- device_tracker.rm_pro
- device_tracker.samsungtv
- device_tracker.skybell
- device_tracker.sleep_number_bed
- device_tracker.small_garage
- device_tracker.smart_water_meter
- device_tracker.stacey
- device_tracker.study_ap
- device_tracker.tablotv
- device_tracker.unifi_ap_office
- device_tracker.wii
- device_tracker.withings_scale
2018-01-02 00:00:45 +00:00
#-------------------------------------------------------------------------------------
automation:
- alias: 'Device Status'
hide_entity: True
trigger:
2018-01-19 20:55:12 +00:00
- platform: state
entity_id:
- sensor.network
- binary_sensor.carlowink
2018-01-02 00:00:45 +00:00
2018-02-01 03:17:09 +00:00
condition:
- condition: template
value_template: >
{% if not is_state('sensor.network_detail', ' ') %}
false
{% else %}
true
{% endif %}
2018-01-02 00:00:45 +00:00
action:
- service: script.notify_engine
data_template:
2018-01-19 19:52:57 +00:00
value1: 'Offline Devices:'
value3: "{{ states.sensor.network_detail.state }}"
2018-01-02 00:00:45 +00:00
who: 'carlo'
2018-01-19 20:55:12 +00:00
# - service: script.speech_engine
# data_template:
# value1: "The following Devices are in an Offline state {{ trigger.to_state.state }}"