Files
Home-Assistant-Configs/packages/sysmon.yaml

88 lines
2.7 KiB
YAML

sensor:
- platform: command_line
name: Lines of Code
command: "find /config -name '*.yaml' | xargs cat | wc -l"
scan_interval: 20000
- platform: template
sensors:
min_ping:
friendly_name: "Min Ping"
value_template: "{{ state_attr('binary_sensor.internet','round_trip_time_min') }}"
availability_template: >-
{% if is_state('binary_sensor.internet','on') %}
true
{% else %}
false
{% endif %}
unit_of_measurement: "ms"
avg_ping:
friendly_name: "Avg Ping"
value_template: "{{ state_attr('binary_sensor.internet','round_trip_time_avg') }}"
availability_template: >-
{% if is_state('binary_sensor.internet','on') %}
true
{% else %}
false
{% endif %}
unit_of_measurement: "ms"
max_ping:
friendly_name: "Max Ping"
value_template: "{{ state_attr('binary_sensor.internet','round_trip_time_max') }}"
availability_template: >-
{% if is_state('binary_sensor.internet','on') %}
true
{% else %}
false
{% endif %}
unit_of_measurement: "ms"
template:
- binary_sensor:
- name: Tony Desktop On
state: "{{ states('sensor.tony_desktop_power') | int > 10 }}"
device_class: power
attributes:
power_usage: "{{ states('sensor.tony_desktop_power') }}"
- binary_sensor:
- name: Tina Desktop On
state: "{{ states('sensor.tina_desktop_power') | int > 10 }}"
device_class: power
attributes:
power_usage: "{{ states('sensor.tina_desktop_power') }}"
- binary_sensor:
- name: Kallen Desktop On
state: "{{ states('sensor.kallen_desktop_power') | int > 10 }}"
device_class: power
attributes:
power_usage: "{{ states('sensor.kallen_desktop_power') }}"
- binary_sensor:
- name: Basement Server On
state: "{{ states('sensor.basement_server_power') | int > 10 }}"
device_class: power
attributes:
power_usage: "{{ states('sensor.basement_server_power') }}"
# - platform: influxdb
# host: 192.168.1.26
# port: 8086
# username: homeassistant
# password: !secret influxdb_pass
# scan_interval: 3600
# queries:
# - name: InfluxDB Database Size
# unit_of_measurement: MB
# value_template: "{{ (value | float(0) / 1024 /1024) | round(1) }}"
# group_function: sum
# measurement: '"monitor"."shard"'
# database: _internal
# where: '"database"=''homeassistant'' AND time > now() - 5m'
# field: diskBytes
binary_sensor:
- platform: ping
name: Internet
host: 8.8.8.8
scan_interval: 5