Files
Home-Assistant-Configs/packages/sysmon.yaml
Tony Stork d49563435d Raise threshold to show computers on, ignore idle power spikes
This caused my computer to briefly register as on, and thus my Awake switch was turned on and prevented Emma's door alert from playing in the bedroom
2025-03-24 18:38:38 -04:00

152 lines
5.0 KiB
YAML

input_select:
log_level:
name: Log Level
options:
- critical
- fatal
- error
- warning
- warn
- info
- debug
- notset
initial: fatal
icon: mdi:bug
default_log_level:
name: Default Log Level
options:
- critical
- fatal
- error
- warning
- warn
- info
- debug
- notset
initial: error
icon: mdi:bug
input_number:
basement_computers_idle_time:
name: Basement Computers Idle Time
min: 0
max: 120
unit_of_measurement: m
step: 5
icon: mdi:timer
first_floor_computers_idle_time:
name: First Floor Computers Idle Time
min: 0
max: 120
unit_of_measurement: m
step: 5
icon: mdi:timer
command_line:
- sensor:
name: Lines of Code
unique_id: 1bbf11f9-28d3-4575-83e8-f1a277687724
command: "find /config -name '*.yaml' | xargs cat | wc -l"
scan_interval: 20000
unit_of_measurement: ''
mqtt:
sensor:
- name: "Uptime Kuma Status"
unique_id: 6f8256c6-d1b3-4f32-9ea1-8131cc2cc114
state_topic: "glances/basement-server/docker/uptime-kuma/status"
icon: mdi:monitor-dashboard
value_template: "{{ value }}"
qos: 1
template:
- binary_sensor:
- name: Tony Desktop On
unique_id: 82ce673a-96ad-4af5-a8d1-be9ca9fa9c36
state: "{{ states('sensor.tony_desktop_power') | int > 25 }}"
device_class: running
attributes:
power_usage: "{{ states('sensor.tony_desktop_power') | int }}W"
- name: Tina Desktop On
unique_id: 8484dbd4-2fae-4368-a4bc-d1bdc09e003f
state: "{{ states('sensor.tina_desktop_power') | int > 25 }}"
device_class: running
attributes:
power_usage: "{{ states('sensor.tina_desktop_power') | int }}W"
- name: Kallen Desktop On
unique_id: ccc25d75-4915-449d-9b2e-09ad14ffac29
state: "{{ states('sensor.kallen_desktop_power') | int > 25 }}"
device_class: running
attributes:
power_usage: "{{ states('sensor.kallen_desktop_power') | int }}W"
- name: Basement Server On
unique_id: e6df7d98-d3ba-4e01-bae2-2ebafc8d78d6
state: "{{ states('sensor.basement_server_power') | int > 25 }}"
device_class: running
attributes:
power_usage: "{{ states('sensor.basement_server_power') | int }}W"
- name: Tony Desktop Idle
unique_id: f0ace986-a874-4fb0-ad29-8f3ebf95d8cc
state: "{{ (states('sensor.tony_asus_system_idle_time') | int) > (states('input_number.basement_computers_idle_time') | int * 60) }}"
- name: Tina Desktop Idle
unique_id: 1933c638-c94b-468e-bb7a-c1c5b36c3651
state: "{{ (states('sensor.xia_desktop_system_idle_time') | int) > (states('input_number.first_floor_computers_idle_time') | int * 60) }}"
- name: Kallen Desktop Idle
unique_id: 680c6ae3-2ed2-451e-858b-2aee688af461
state: "{{ (states('sensor.kallen_desktop_system_idle_time') | int) > (states('input_number.basement_computers_idle_time') | int * 60) }}"
- name: Asus Laptop Idle
unique_id: 7d8eb80a-0a2e-48a9-84b3-33175304dd95
state: "{{ states('sensor.asus_laptop_system_idle_time') | int > 1800 }}"
- sensor:
- name: "Min Ping"
unique_id: ddcb9f6f-7c94-41fe-9453-2a2205b078e0
state: "{{ state_attr('binary_sensor.internet','round_trip_time_min') }}"
availability: "{{ is_state('binary_sensor.internet','on') }}"
unit_of_measurement: "ms"
- name: "Avg Ping"
unique_id: 79a13c64-7508-48de-8b44-2a23c59917c8
state: "{{ state_attr('binary_sensor.internet','round_trip_time_avg') }}"
availability: "{{ is_state('binary_sensor.internet','on') }}"
unit_of_measurement: "ms"
- name: "Max Ping"
unique_id: c9c71ab6-c7fa-4425-a4ed-768d60e93781
state: "{{ state_attr('binary_sensor.internet','round_trip_time_max') }}"
availability: "{{ is_state('binary_sensor.internet','on') }}"
unit_of_measurement: "ms"
# - 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
automation:
- id: 22b034d3-a7c2-4499-9db5-6e36dd1c8be4
alias: Log Level
trigger:
- platform: state
entity_id: input_select.log_level
action:
- service: logger.set_level
data:
homeassistant.components: "{{ states('input_select.log_level') }}"
- id: e901db33-a6ab-4ee4-b13a-7b37991e0d85
alias: Default Log Level
trigger:
- platform: state
entity_id: input_select.default_log_level
action:
- service: logger.set_default_level
data:
level: "{{ states('input_select.default_log_level') }}"