{"id":20936917,"url":"https://github.com/shmuelie/mfi-custom-code","last_synced_at":"2026-04-02T18:36:50.412Z","repository":{"id":217616541,"uuid":"742266516","full_name":"shmuelie/mfi-custom-code","owner":"shmuelie","description":"Providing custom code to run on Ubiquiti's mFi Devices","archived":false,"fork":false,"pushed_at":"2026-03-29T03:08:26.000Z","size":525,"stargazers_count":3,"open_issues_count":8,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-29T04:30:47.525Z","etag":null,"topics":["buildroot","home-assistant","mfi","mongoose","mqtt","ubiquiti"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shmuelie.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-01-12T05:11:17.000Z","updated_at":"2026-03-29T03:08:29.000Z","dependencies_parsed_at":"2024-06-28T05:43:01.745Z","dependency_job_id":"0edd297c-d280-46bf-b222-f273342968e2","html_url":"https://github.com/shmuelie/mfi-custom-code","commit_stats":null,"previous_names":["shmuelie/mfi-custom-code"],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/shmuelie/mfi-custom-code","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shmuelie%2Fmfi-custom-code","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shmuelie%2Fmfi-custom-code/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shmuelie%2Fmfi-custom-code/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shmuelie%2Fmfi-custom-code/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shmuelie","download_url":"https://codeload.github.com/shmuelie/mfi-custom-code/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shmuelie%2Fmfi-custom-code/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31313021,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["buildroot","home-assistant","mfi","mongoose","mqtt","ubiquiti"],"created_at":"2024-11-18T22:30:00.371Z","updated_at":"2026-04-02T18:36:50.401Z","avatar_url":"https://github.com/shmuelie.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ubiquiti mFi Custom Code\n\nCustom firmware applications for Ubiquiti's mFi line of power monitoring and\nswitching devices. Includes an MQTT client for Home Assistant integration, a REST\nAPI server, and a CLI tool — all built on a shared C++ library that wraps the mFi\nhardware interface.\n\n## Architecture\n\n```\nmfi-mqtt-client ─┬─ hass_mqtt_device (Home Assistant MQTT discovery)\n                 ├─ mfi (hardware abstraction: sensors, relays, LEDs)\n                 └─ shmuelie-shared (string utilities)\n\nmfi-rest-server ─┬─ mgpp (Mongoose C++ wrapper)\n                 ├─ mfi\n                 └─ shmuelie-shared\n\nmfi-cli ─────────┬─ mfi\n                 └─ shmuelie-shared\n```\n\n## Projects\n\n### Executables\n\n| Project | Description | Version |\n|---------|-------------|---------|\n| [mfi-mqtt-client](mfi-mqtt-client/) | MQTT client with Home Assistant auto-discovery | 1.2.0 |\n| [mfi-rest-server](mfi-rest-server/) | HTTP REST API server | 1.2.2 |\n| [mfi-cli](mfi-cli/) | CLI tool for device inspection | 1.0.1 |\n\n### Libraries\n\n| Project | Description | Version |\n|---------|-------------|---------|\n| [mfi](mfi/) | Hardware abstraction for sensors, relays, LEDs | 1.0.0 |\n| [hass_mqtt_device](hass_mqtt_device/) | Home Assistant MQTT device library | 1.0.0 |\n| [mgpp](mgpp/) | C++ wrapper around Mongoose | 1.0.0 |\n| [shmuelie-shared](shmuelie-shared/) | String helper functions | 1.0.0 |\n\n## Alternatives\n\nThere are several community shell-script projects for controlling mFi devices.\nThis project differs in being a compiled C++ solution with a proper hardware\nabstraction layer, native MQTT, and Home Assistant auto-discovery.\n\n| Feature | mfi-custom-code | [mpower-tools](https://github.com/magcode/mpower-tools) | [mFi-tools](https://github.com/maletazul/mFi-tools) |\n|---|---|---|---|\n| Language | C++ | Shell scripts | Shell scripts |\n| MQTT | Native (libmosquitto) | Via `mosquitto_pub` | Via `mosquitto_pub` |\n| Home Assistant | Auto-discovery (switches + sensors) | Manual YAML config | Manual YAML config |\n| REST API | Yes (Mongoose) | No | No |\n| CLI tool | Yes | No | No |\n| Sensor data | Power, current, voltage, power factor | Power, energy | Power, energy |\n| Change-only updates | Yes (reduces MQTT traffic) | No (polls on interval) | No (polls on interval) |\n| Hardware abstraction | C++ library | Direct file I/O | Direct file I/O |\n| Cross-compilation | Buildroot toolchain | Not needed | Not needed |\n| Unit tests | Catch2 | None | None |\n| Install complexity | Build + deploy binary | Copy scripts | Copy scripts |\n\n## Documentation\n\n- [Building](docs/building.md) — packages, CMake presets, build commands, testing\n- [Deploying](docs/deploying.md) — binary sizes, UPX, boot scripts, SCP\n- [mFi Notes](docs/mfi-notes.md) — persistent storage, save, boot hooks\n- [cfgmtd](docs/cfgmtd.md) — flash configuration utility internals","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshmuelie%2Fmfi-custom-code","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshmuelie%2Fmfi-custom-code","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshmuelie%2Fmfi-custom-code/lists"}