Coder Social home page Coder Social logo

diskspace's Introduction

hacs_badge

Disk space sensor for Home Assistant.

Example configuration.yaml

sensor:
  - platform: diskspace
    name: Main Disk
    path: "/"
    unit_of_measure: "GB"

Unit of Measure:

  • GB - Gigabytes
  • MB - Megabytes
  • TB - Terabyes
  • Anything else - Raw data which is given in bytes.

This uses 1000MB = 1GB

Name: Anything you like. The sensor will then be sensor.disk_space_name

Path: Where the mount path is. This can be found from the command line using the command mount for instance.

Notes

This is an example of what a sensor looks like.

Sensor State Attributes
sensor.disk_space_main_disk 368 total: 490 used: 97 free: 368

Notice that Total - Used doesn't equal Free. This is a limitation of the operating system and happens on both MacOS and Linux.

Notification Template

- id: "2121054773"
  alias: Low Disk Space
  description: "Notify me of low disk space"
  trigger:
    - platform: template
      value_template: "{{ state_attr('sensor.disk_space_main_disk', 'percentage_free') < 10 }}"
  action:
    - data:
        message: Main disk is almost full
      service: notify.slack

diskspace's People

Contributors

kuchel77 avatar ludeeus avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.