{"id":36893215,"url":"https://github.com/f18m/rpi2home-assistant","last_synced_at":"2026-01-18T12:26:51.202Z","repository":{"id":221604094,"uuid":"754736612","full_name":"f18m/rpi2home-assistant","owner":"f18m","description":"Expose Raspberry PI inputs and outputs to HomeAssistant through MQTT","archived":false,"fork":false,"pushed_at":"2025-12-10T10:31:03.000Z","size":2015,"stargazers_count":4,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-12-10T13:55:16.659Z","etag":null,"topics":["gpio-pins","home-assistant","mqtt","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":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/f18m.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-02-08T17:08:53.000Z","updated_at":"2025-11-20T21:49:40.000Z","dependencies_parsed_at":"2024-02-22T16:26:29.207Z","dependency_job_id":"abe22541-f9aa-4718-863a-549380e31962","html_url":"https://github.com/f18m/rpi2home-assistant","commit_stats":null,"previous_names":["f18m/ha-alarm-raspy2mqtt","f18m/rpi2home-assistant"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/f18m/rpi2home-assistant","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f18m%2Frpi2home-assistant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f18m%2Frpi2home-assistant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f18m%2Frpi2home-assistant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f18m%2Frpi2home-assistant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/f18m","download_url":"https://codeload.github.com/f18m/rpi2home-assistant/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f18m%2Frpi2home-assistant/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28341194,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["gpio-pins","home-assistant","mqtt","raspberry-pi"],"created_at":"2026-01-12T15:39:52.863Z","updated_at":"2026-01-12T15:39:55.947Z","avatar_url":"https://github.com/f18m.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rpi2home-assistant\n\n![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/f18m/rpi2home-assistant/main.yml)\n![PyPI - Version](https://img.shields.io/pypi/v/rpi2home-assistant)\n\nThis project provides a Python daemon to **transform a [Raspberry PI](https://www.raspberrypi.com/) into a bridge between GPIO inputs/outputs and [Home Assistant](https://www.home-assistant.io/), through MQTT**.\n\nIn particular this software allows to:\n* sample low-voltage inputs from Raspberry GPIO pins directly (with no isolation/protection/HAT), publish them on MQTT and get them exposed to Home Assistant as [binary sensors](https://www.home-assistant.io/integrations/binary_sensor.mqtt/);\n* sample a wide range of electrical signals (voltages) from 3V-48V AC or DC, using a dedicated Raspberry HAT, publish them on MQTT and get them exposed to Home Assistant as [binary sensors](https://www.home-assistant.io/integrations/binary_sensor.mqtt/);\n* expose Raspberry GPIO output pins in Home Assistant as [switches](https://www.home-assistant.io/integrations/switch.mqtt/) or as [buttons](https://www.home-assistant.io/integrations/button.mqtt/) to e.g. activate relays, using a dedicated Raspberry HAT / relay board or just drive low-voltage electrical devices;\n\nAll these features are implemented in an [Home Assistant](https://www.home-assistant.io/)-friendly fashion.\nFor example, this utility requires **no configuration on Home Assistant-side** thanks to [MQTT discovery messages](https://www.home-assistant.io/integrations/mqtt/#mqtt-discovery) that are automatically published and let Home Assistant automatically discover the devices. In other words you will just need to prepare 1 configuration file (the _rpi2home-assistant_ config file) and that's it.\nAll properties of the exposed devices (names, icons, descriptions, etc) can be provided/customized in the _rpi2home-assistant_ config file.\n\nAn example of a panel of sensors/actuators created using _rpi2home-assistant_ in Home Assistant 2024.5 (sensor/switch/button names have been blurred for privacy reasons; binary sensor status is shown in Italian language):\n\n![Home Assistant screenshot](/docs/screenshot1.png?raw=true \"Home Assistant screenshot\")\n\n\n# Prerequisites\n\nSee [prerequisites.md](docs/prerequisites.md).\n\n# Documentation\n\n## Installation\n\nSee [install.md](docs/install.md).\n\n## Configuration file\n\nThe configuration file of _rpi2home-assistant_ is of course `/etc/rpi2home-assistant.yaml`.\nDuring the installation the default config file with dummy options is installed.\nIt is useful to showcase the syntax. See [config.yaml](config.yaml) for \nthe full documentation of the configuration options.\n\n## Permissions\n\nThis python code needs to run as `root` due to ensure access to the Raspberry I2C and GPIO peripherals.\n\n## Logs\n\nAfter starting the application you can verify from the logs whether it's running successfully:\n\n```sh\njournalctl -u rpi2home-assistant --since=\"5min ago\"\n```\n\n\n# Development\n\nSee [development.md](docs/development.md).\n\n\n# Useful links\n\n* [Sequent Microsystem 16 opto-insulated inputs python library](https://github.com/SequentMicrosystems/16inpind-rpi)\n* [aiomqtt python library](https://github.com/sbtinstruments/aiomqtt)\n* [AsyncIO tutorial](https://realpython.com/python-concurrency/#asyncio-version)\n* [Home Assistant](https://www.home-assistant.io/)\n\nVery similar project, more flexible and much bigger, targeting specific sensor boards:\n* [mqtt-io](https://github.com/flyte/mqtt-io)\n\n\n# TODO\n\n- Eventually get rid of GPIOZERO + PIGPIOD which consume CPU and also force use of e.g. the queue.Queue due to\n  the multithreading issues; replace these 2 parts with direct Raspberry PI GPIO access?\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff18m%2Frpi2home-assistant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ff18m%2Frpi2home-assistant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff18m%2Frpi2home-assistant/lists"}