Coder Social home page Coder Social logo

deviceinfo_to_homeassistant's Introduction

Device info to homeassistant

Send hdd and ram data to home assistant with python.

 

Requirements

Python 3.3 or newer.
shutil.disk_usage requires Python 3.3 and above.

 

How to use

I have this script on all my servers so I get info of hdd and memory use sent to Home Assistant at regular intervals. The script makes inegrations in Home Assistant like this if the hostname is webserver:

input_number.webserver_memory_used

  I have the script shared through NFS so I only need to change it on one server for it to update on all of them.
But that is not necessary, you can put it where you like, just change the cron accordingly. My crontab -e looks like this:

# Send device info to Home Assistant
* * * * * /usr/bin/python3 /mnt/script/deviceinfo.py

Which will send the info every minute.

 

Instructions

Change http://192.168.44.27 to the IP of your Home Assistant instance.
Change YOUR-LONG-LIVED-TOKEN to your long lived access token, you can make one in your profile.
Scroll to the bottom, click Create Token. Give it a suitable name and paste it in this script.\

deviceinfo_to_homeassistant's People

Contributors

alexbergsland avatar

Watchers

 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.