{"id":20899404,"url":"https://github.com/michelep/raspiupsmonitor","last_synced_at":"2025-08-22T22:08:34.063Z","repository":{"id":42060840,"uuid":"116068472","full_name":"michelep/RaspiUpsMonitor","owner":"michelep","description":"a Python monitor script for Raspi UPS HAT","archived":false,"fork":false,"pushed_at":"2022-04-14T17:38:05.000Z","size":29,"stargazers_count":3,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-01T14:58:50.875Z","etag":null,"topics":["hat","raspberry-pi","ups"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michelep.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-02T23:34:56.000Z","updated_at":"2024-08-12T19:35:13.000Z","dependencies_parsed_at":"2022-08-12T03:40:57.369Z","dependency_job_id":null,"html_url":"https://github.com/michelep/RaspiUpsMonitor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michelep%2FRaspiUpsMonitor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michelep%2FRaspiUpsMonitor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michelep%2FRaspiUpsMonitor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michelep%2FRaspiUpsMonitor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michelep","download_url":"https://codeload.github.com/michelep/RaspiUpsMonitor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253853915,"owners_count":21974185,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hat","raspberry-pi","ups"],"created_at":"2024-11-18T11:13:58.860Z","updated_at":"2025-05-13T01:31:45.104Z","avatar_url":"https://github.com/michelep.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"RaspiUpsMonitor\n===============\n\n### a Python monitor script for Raspi UPS HAT\n\n[Raspi UPS HAT](https://it.aliexpress.com/item/Geekworm-RPi-UPS-HAT-Board-for-Raspberry-Pi-3-Model-B-Pi-2B-B/32766227090.html) was a board for Raspberry Pi with a controller and a LiPo battery that act like an UPS. On board, there's a MAX17034 chip (connected to i2c bus) that could be asked for battery voltage and remaining capacity (0-100%).\nWith this simple script, far to be perfect (and you are encouraged to fix and improve it !), you can shutdown safely your RPi when battery on UPS Hat reach a critical level, avoid any potentials data loss.\n\n### Requirements\n\nYou need to install smbus2 with *sudo pip install smbus2*\n\n### Install\n\nInstallation is pretty simple: just do *python setup.py build* and *sudo python setup.py install*. If you want to execute as a daemon on startup, just copy `raspiupsmonitor.initd` to `/etc/init.d` (`cp raspiupsmonitor.initd /etc/init.d/raspiupsmonitor`, `sudo chmod +x /etc/init.d/raspiupsmonitor`, `sudo update-rc.d /etc/init.d/raspiupsmonitor defaults`) and the wrapper `raspiupsmonitor.sh` to `/usr/local/bin`. \nThen you can use it as other system services with:\n\n*/etc/init.d/raspiupsmonitor [start|stop]*\n\n### Configure\n\nConfiguration is in `raspiupsmonitor.cfg` must be copied to either \n* `/etc/raspiupsmonitor.cfg`  \n* `~/.raspiupsmonitor.cfg`\n* `raspiupsmonitor.cfg`\n\nand the relevant part is [Monitor]:\n\n    [Monitor]\n    # On alert level of 10%, just alert all users...\n    alert_level=10\n    alert_action=/usr/bin/wall \"UPS Battery is dying...\"\n    # When battery is dying, halt the system safely\n    critical_level=5\n    critical_action=/sbin/halt -p\n\n\"level\" is the percentage of power remained, in a range from 0 to 100. When battery is discharging and reach the alert or critical level, \"action\" was executed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichelep%2Fraspiupsmonitor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichelep%2Fraspiupsmonitor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichelep%2Fraspiupsmonitor/lists"}