Home-AssistantConfig/config/packages/network.yaml.disabled

158 lines
5.2 KiB
Plaintext
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'
entity_id: []
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',
'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'
entity_id: []
2018-01-19 21:49:10 +00:00
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',
'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 -%}
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.camera1
- device_tracker.camera2
- device_tracker.camera3
- 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.sleep_number_bed
- device_tracker.small_garage
- device_tracker.smart_water_meter
- device_tracker.stacey
- device_tracker.study_ap
- device_tracker.tablotv
- device_tracker.tesla_powerwall
- device_tracker.unifi_ap_office
- device_tracker.wii
- device_tracker.withings_scale
2018-01-02 00:00:45 +00:00
#-------------------------------------------------------------------------------------
automation:
- alias: 'Device Status'
2020-07-20 18:33:03 +00:00
id: dab5cc2c-d17b-42c2-938b-153003a8c461
2020-06-06 22:13:19 +00:00
2018-01-02 00:00:45 +00:00
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:
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:
2018-01-19 20:55:12 +00:00
# value1: "The following Devices are in an Offline state {{ trigger.to_state.state }}"