{"id":46613691,"url":"https://github.com/modrisb/pijups","last_synced_at":"2026-03-07T19:07:02.896Z","repository":{"id":163982970,"uuid":"599290288","full_name":"modrisb/pijups","owner":"modrisb","description":"UPS automation support for PiJuice HAT","archived":false,"fork":false,"pushed_at":"2025-01-24T18:16:27.000Z","size":135,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-24T19:23:23.524Z","etag":null,"topics":["automation","home-assistant","pijuice","raspberry-pi"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/modrisb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-08T20:50:26.000Z","updated_at":"2025-01-24T18:14:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"c9e26088-3355-4ef5-a4fb-e5fa1e54874d","html_url":"https://github.com/modrisb/pijups","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/modrisb/pijups","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modrisb%2Fpijups","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modrisb%2Fpijups/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modrisb%2Fpijups/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modrisb%2Fpijups/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/modrisb","download_url":"https://codeload.github.com/modrisb/pijups/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modrisb%2Fpijups/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30226865,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T19:01:10.287Z","status":"ssl_error","status_checked_at":"2026-03-07T18:59:58.103Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["automation","home-assistant","pijuice","raspberry-pi"],"created_at":"2026-03-07T19:07:02.405Z","updated_at":"2026-03-07T19:07:02.887Z","avatar_url":"https://github.com/modrisb.png","language":"Python","readme":"# PiJups - Home Assistant PiJuice Integration\n\n[![hacs_badge](https://img.shields.io/badge/HACS-Default-orange.svg)](https://github.com/custom-components/hacs) (https://github.com/modrisb/pijups/releases)\n\n\nPiJups exposes [PiJuice](https://github.com/PiSupply/PiJuice) sensor values in [Home Assistant](https://home-assistant.io) and allows to use this HAT in HA automations to handle battery low cases and other.\n\n## Sensors supported\n* Battery status\n* Power input status\n* Power input I/O status\n* Charge in %\n* Temperature (native format)\n* Battery voltage\n* Battery current\n* I/O voltage\n* I/O current\n* External Power\n\n## Prerequisite\nEnable I2C bus on the host system, like described in : https://www.home-assistant.io/common-tasks/os/#enable-i2c\u003cbr\u003e\n\n## Manual installation \n1. Inside the `custom_components` directory, create a new folder called `pijups`.\n2. Download all files from the `custom_components/pijuice/` repository to this directory `custom_components/pijups`.\n3. Install integration from Home Assistant Settings/Devices \u0026 Services/Add Integration. HAT should be detected automatically within ~ 20s.\n\nHACS might be used for installation too - check repository 'PiJuice Hat'.\n\n## Configuration\nParameters for hardware configuration, default values reflect current HAT's settings: \n1. Battery temperature sense source selection - impacts HAT temperature sensor.\n2. Battery battery profile. This impacts HAT funstionaly - battery charge options, by default set to smallest by capacity battery.\n\nParameters for HAT circular log configuration - select events to store in log. Default selections corresponf to HAT's current settings.\n\nParameters to control integration behaviour on shutdown/restart and sensor polling rate: \n1. Power Off Delay, specifies time HAT will delay switch off power, this gives time to HA to perform software shutdown actions. Default - 120s might be too much for most cases, need to measure time needed. Noticed ~ 1 minute run time uses ~ 1% of battery charge, but this may vary per hardware.\n2. Wake On Delta specifies HAT action after power is resumed. -1 forces reboot right after power is resumed, any positive value is added to charge % and reboot should happen when battery reaches this level after power resume. Idea to always have capacity to do shutdown without data loss.\n3. Sensor refresh interval in seconds. This time period applies to Battery status, Power input status, Power input I/O status and External Power, others are updated every 6th cycle. Integration need to be reloaded to start using new scan interval value, HA restart works too.\n\n\n## Example automation\nAutomation example below is triggered by battery status change and in case of no external power and battery capacity below specified limit initiates HA shutdown and then HAT switch off:\n```\nalias: UPS\ndescription: \"\"\ntrigger:\n  - platform: state\n    entity_id:\n      - sensor.pijups_charge\ncondition:\n  - condition: and\n    conditions:\n      - condition: state\n        entity_id: sensor.pijups_power_input_io_status\n        state: NOT_PRESENT\n      - condition: state\n        entity_id: sensor.ppijups_power_input_status\n        state: NOT_PRESENT\n      - condition: numeric_state\n        entity_id: sensor.pijups_charge\n        below: 25\naction:\n  - delay:\n      hours: 0\n      minutes: 0\n      seconds: 10\n      milliseconds: 0\n  - service: hassio.host_shutdown\n    data: {}\nmode: single\n```\n\n## Credits\n[PiJuice](https://pi-supply.com/) : PiJuice Pi supply hardware/software platform to support Raspberry Pi, Arduino. PiJups uses PiJuice API with very little changes, see published pull request on github\u003cbr\u003e\n[Home Assistant](https://github.com/home-assistant) : Home Assistant open-source powerful domotic plateform.\u003cbr\u003e\n[HACS](https://hacs.xyz/) : Home Assistant Community Store gives you a powerful UI to handle downloads of all your custom needs.\u003cbr\u003e\n[smbus2 library](https://pypi.org/project/smbus2) : PyPI library for I2C access\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodrisb%2Fpijups","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmodrisb%2Fpijups","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodrisb%2Fpijups/lists"}