Advertisement
energywave

Raspberry Pi monitor automations

Oct 1st, 2022 (edited)
1,207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 6.07 KB | None | 0 0
  1. sensor:
  2.   - platform: command_line
  3.     name: "Temperatura Raspberry Home Assistant"
  4.     command: "cat /sys/class/thermal/thermal_zone0/temp"
  5.     unit_of_measurement: "°C"
  6.     value_template: "{{ value | multiply(0.001) | round(1)}}"
  7.   - platform: systemmonitor
  8.     resources:
  9.       - type: disk_use_percent
  10.         arg: /
  11.       - type: disk_free
  12.       - type: memory_use_percent
  13.       - type: swap_use_percent
  14.       - type: load_1m
  15.       - type: processor_use
  16.       - type: last_boot
  17.  
  18. automation:
  19.   - id: b3b947dc-68ae-4118-99c3-f59e6c188a65
  20.     alias: "Sistema - Notifica - Utilizzo disco > 80%"
  21.     description: "Invia una notifica quando l'utilizzo del disco dati supera l'80%"
  22.     trigger:
  23.       - platform: numeric_state
  24.         entity_id: sensor.disk_use_percent
  25.         above: 80
  26.     action:
  27.       - alias: "Invia notifica"
  28.         service: script.multinotify
  29.         data:
  30.           title: "Disco quasi pieno!"
  31.           message: "Sull'host di Home Assistant il disco SSD è occupato oltre l'80%!"
  32.           alexa_target: media_player.ovunque
  33.           alexa_volume: 0.8
  34.           tts_target: media_player.google_mansarda
  35.           tts_volume: 0.8
  36.           notify_app: notify.mobile_app_tel_henrik
  37.           notify_html5: notify.html5_hsozzi_pc
  38.           notify_pushover: notify.pushover
  39.           notify_ha: true
  40.           channel: warning
  41.           url: "/lovelace/tech"
  42.  
  43.   - id: 7f5ea1af-1de3-40fe-bd41-c085f7831b9f
  44.     alias: "Sistema - Notifica - Utilizzo CPU > 80% per 5 min"
  45.     description: "Invia una notifica quando l'utilizzo della CPU supera l'80% per più di 5 minuti"
  46.     trigger:
  47.       - platform: numeric_state
  48.         entity_id: sensor.processor_use
  49.         above: 80
  50.         for:
  51.           minutes: 5
  52.     action:
  53.       - alias: "Invia notifica"
  54.         service: script.multinotify
  55.         data:
  56.           title: "Utilizzo CPU troppo elevato!"
  57.           message: "Sull'host di Home Assistant la cpu è utilizzata oltre l'80% da più di 5 minuti!"
  58.           alexa_target: media_player.ovunque
  59.           alexa_volume: 0.8
  60.           tts_target: media_player.google_mansarda
  61.           tts_volume: 0.8
  62.           notify_app: notify.mobile_app_tel_henrik
  63.           notify_html5: notify.html5_hsozzi_pc
  64.           notify_pushover: notify.pushover
  65.           notify_ha: true
  66.           channel: warning
  67.           url: "/lovelace/tech"
  68.  
  69.   - id: a6cb1bf4-494c-48f2-b466-5c7f48209a7a
  70.     alias: "Sistema - Notifica - Utilizzo memoria > 70% per 5 min"
  71.     description: "Invia una notifica quando l'utilizzo della RAM supera il 70% per più di 5 minuti"
  72.     trigger:
  73.       - platform: numeric_state
  74.         entity_id: sensor.memory_use_percent
  75.         above: 70
  76.         for:
  77.           minutes: 5
  78.     action:
  79.       - alias: "Invia notifica"
  80.         service: script.multinotify
  81.         data:
  82.           title: "Utilizzo memoria troppo elevato!"
  83.           message: "Sull'host di Home Assistant la memoria occupata supera il 70% da più di 5 minuti!"
  84.           alexa_target: media_player.ovunque
  85.           alexa_volume: 0.8
  86.           tts_target: media_player.google_mansarda
  87.           tts_volume: 0.8
  88.           notify_app: notify.mobile_app_tel_henrik
  89.           notify_html5: notify.html5_hsozzi_pc
  90.           notify_pushover: notify.pushover
  91.           notify_ha: true
  92.           channel: warning
  93.           url: "/lovelace/tech"
  94.  
  95.   - id: 44554830-a418-4871-8cc1-757f5faec4da
  96.     alias: "Sistema - Notifica - Log oltre 100 MB"
  97.     description: "Invia una notifica quando il log supera i 100 MB di dimensione"
  98.     trigger:
  99.       - platform: numeric_state
  100.         entity_id: sensor.home_assistant_log_size
  101.         above: 100
  102.     action:
  103.       - alias: "Invia notifica"
  104.         service: script.multinotify
  105.         data:
  106.           title: "Log troppo grande!"
  107.           message: "Sull'host di Home Assistant il log ha superato i 100 megabyte!"
  108.           alexa_target: media_player.ovunque
  109.           alexa_volume: 0.8
  110.           tts_target: media_player.google_mansarda
  111.           tts_volume: 0.8
  112.           notify_app: notify.mobile_app_tel_henrik
  113.           notify_html5: notify.html5_hsozzi_pc
  114.           notify_pushover: notify.pushover
  115.           notify_ha: true
  116.           channel: warning
  117.           url: "/lovelace/tech"
  118.  
  119.   - id: 490f3a1a-687e-4374-9e74-c393ce17e5d3
  120.     alias: "Sistema - Notifica - Problema alimentazione Raspberry Pi"
  121.     description: "Invia una notifica quando c'è un problema di alimentazione del Raspberry Pi di Home Assistant"
  122.     trigger:
  123.       - platform: state
  124.         entity_id: binary_sensor.rpi_power_status
  125.         to: "on"
  126.     action:
  127.       - alias: "Invia notifica"
  128.         service: script.multinotify
  129.         data:
  130.           title: "Problema alimentazione RPI!"
  131.           message: "Sull'host di Home Assistant c'è un problema di alimentazione insufficiente!"
  132.           alexa_target: media_player.ovunque
  133.           alexa_volume: 0.8
  134.           tts_target: media_player.google_mansarda
  135.           tts_volume: 0.8
  136.           notify_app: notify.mobile_app_tel_henrik
  137.           notify_html5: notify.html5_hsozzi_pc
  138.           notify_pushover: notify.pushover
  139.           notify_ha: true
  140.           channel: warning
  141.           url: "/lovelace/tech"
  142.  
  143.   - id: e8d5665b-190e-44a5-9624-d91bce82031c
  144.     alias: "Sistema - Notifica - Database oltre 2 GB"
  145.     description: "Invia una notifica quando il database supera i 2GB"
  146.     trigger:
  147.       - platform: numeric_state
  148.         entity_id: sensor.home_assistant_v2_db_size
  149.         above: 2048
  150.     action:
  151.       - alias: "Invia notifica"
  152.         service: script.multinotify
  153.         data:
  154.           title: "DB troppo grande!"
  155.           message: "Sull'host di Home Assistant il database ha superato i 2 gigabyte!"
  156.           alexa_target: media_player.ovunque
  157.           alexa_volume: 0.8
  158.           tts_target: media_player.google_mansarda
  159.           tts_volume: 0.8
  160.           notify_app: notify.mobile_app_tel_henrik
  161.           notify_html5: notify.html5_hsozzi_pc
  162.           notify_pushover: notify.pushover
  163.           notify_ha: true
  164.           channel: warning
  165.           url: "/lovelace/tech"
  166.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement