{"id":30363114,"url":"https://github.com/leosperry/ha-kafka-net","last_synced_at":"2025-08-19T18:04:34.335Z","repository":{"id":216017011,"uuid":"737344984","full_name":"leosperry/ha-kafka-net","owner":"leosperry","description":"Integration that uses Home Assistant Kafka integration for creating home automations in .NET and C#","archived":false,"fork":false,"pushed_at":"2025-08-17T21:01:24.000Z","size":2949,"stargazers_count":131,"open_issues_count":1,"forks_count":1,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-08-17T23:18:55.063Z","etag":null,"topics":["c-sharp","csharp","dotnet","home-assistant","home-assistant-integration","home-automation","homeassistant","kafka"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leosperry.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}},"created_at":"2023-12-30T17:36:40.000Z","updated_at":"2025-08-17T21:01:28.000Z","dependencies_parsed_at":"2024-04-17T12:35:53.341Z","dependency_job_id":"b7260a88-5cc6-4e4c-a9cc-d3c4b529988c","html_url":"https://github.com/leosperry/ha-kafka-net","commit_stats":null,"previous_names":["leosperry/ha-kafka-net"],"tags_count":73,"template":false,"template_full_name":null,"purl":"pkg:github/leosperry/ha-kafka-net","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leosperry%2Fha-kafka-net","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leosperry%2Fha-kafka-net/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leosperry%2Fha-kafka-net/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leosperry%2Fha-kafka-net/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leosperry","download_url":"https://codeload.github.com/leosperry/ha-kafka-net/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leosperry%2Fha-kafka-net/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271198092,"owners_count":24717121,"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","status":"online","status_checked_at":"2025-08-19T02:00:09.176Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["c-sharp","csharp","dotnet","home-assistant","home-assistant-integration","home-automation","homeassistant","kafka"],"created_at":"2025-08-19T18:03:01.592Z","updated_at":"2025-08-19T18:04:34.287Z","avatar_url":"https://github.com/leosperry.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003cimg src=\"/images/hkn_128.png?raw=true\" align=\"left\" /\u003e\n\n\u003ch3\u003eHaKafkaNet\u003c/h3\u003e \nA library for easily creating Home Assistant automations in .NET and C#.\n\nKafka ensures automations are durable and state is restored between restarts.\n\n***\nVersion 11, is released and uses .NET 9. It also introduces integration testing. See [special release statement](https://github.com/leosperry/ha-kafka-net/wiki/Updating-to-Version-11) for details.\n***\nFeatured on an episode of [On .NET Live](https://www.youtube.com/live/rEY9Bi0jOiE) !\n\n[![HaKafkaNet featured On .NET Live](http://img.youtube.com/vi/rEY9Bi0jOiE/hqdefault.jpg)](https://www.youtube.com/live/rEY9Bi0jOiE)\n\n***\n\nIt was created with the following goals:\n* Create Home Assistant automations in .NET / C# with abilities to:\n  * track/retrieve states of all entities in Home Assistant\n  * respond to Home Assistant state changes\n  * call Home Assistant RESTful services\n* Enable all automation code to be fully unit testable\n\n## Example\nExample of multiple durable automations. See [Tutorial](https://github.com/leosperry/ha-kafka-net/wiki/Tutorial-%E2%80%90-Creating-Automations) for more examples.\n```csharp\nregistrar.TryRegister(\n    _factory.SunRiseAutomation(\n        cancelToken =\u003e _api.TurnOff(\"light.night_light\", cancelToken)),\n    _factory.SunSetAutomation(\n        cancelToken =\u003e _api.TurnOn(\"light.night_light\", cancelToken),\n        TimeSpan.FromMinutes(-10))\n);\n```\n\n## Resources\n* [Documentation](https://github.com/leosperry/ha-kafka-net/wiki)\n* [Nuget package](https://www.nuget.org/packages/HaKafkaNet/)\n* Join the [Discord Server](https://discord.gg/RaGu72RbCt)\n\n## Why ha-kafka-net ? \n* [Strongly typed](https://github.com/leosperry/ha-kafka-net/wiki/State-Extension-Methods) access to entities\n* Durable - Automations that [survive restarts](https://github.com/leosperry/ha-kafka-net/wiki/Durable-Automations). See also [Event Timings](https://github.com/leosperry/ha-kafka-net/wiki/Event-Timings)\n* Fast - Automations run in [parallel](https://github.com/leosperry/ha-kafka-net/wiki/Parallelism-and-threads-in-automations) and asynchronously.\n* [UI](https://github.com/leosperry/ha-kafka-net/wiki/UI) to manage your automations and inspect Kafka consumers. \n* Observability through\n  * [ISystemMonitor](https://github.com/leosperry/ha-kafka-net/wiki/System-Monitor)\n  * [Tracing with log capturing](https://github.com/leosperry/ha-kafka-net/wiki/Tracing)\n  * [Open Telemetry Instrumentation](https://github.com/leosperry/ha-kafka-net/wiki/Open-Telemetry-Instrumentation)\n* [Pre-built automations](https://github.com/leosperry/ha-kafka-net/wiki/Factory-Automations)\n* Extensible framework - [create your own reusable automations](https://github.com/leosperry/ha-kafka-net/wiki/Tutorial:-Creating-Automations)\n  * Extend automation factory with extension methods\n  * Create your own automations from scratch\n* [Automation builder](https://github.com/leosperry/ha-kafka-net/wiki/Automation-Builder) with fluent syntax for quickly creating automations.\n* Full unit testability for custom automations and integration testing for all registered automations.\n* MIT license\n\n## What others have said:\n\u003e All in all, I'm really happy HaKafkaNet is a thing! It's a really ergonomic way of writing automations that make sense.\n\n\u003e I converted the automations for 3 rooms from Home Assistant automations to C#, and those work good! So I'm really satisfied with the project.\n\n### Dashboard\n![Image of dashboard](https://raw.githubusercontent.com/leosperry/ha-kafka-net/main/images/UI%20Examples/Dashboard-V5_5.PNG)\nThis is an image of the dashboard from the example app. See [UI](https://github.com/leosperry/ha-kafka-net/wiki/UI) for additional details.\n\n## How it works\n* State changes are sent from Home Assistant to a Kafka topic\n* HaKafkaNet reads all state changes\n* States for every entity are cached allowing for faster retrieval later.\n  - It also allows us to have some knowledge about which events were not handled between restarts and which ones were. The framework will tell your automation about such timings to allow you to handle messages appropriately.\n* It then looks for automations which want to be notified.\n  - If the entity id of the state change matches any of the `TriggerEntityIds` exposed by your automation, and the timing of the event matches your specified timings, then the `Execute` method of your automation will be called with a new `Task`.\n  - All of your automations will be called asynchronously and in parallel. \n\n## More examples\nI have made [my personal repository](https://github.com/leosperry/MyHome) public so that users can see working examples of some moderately complex automations.\n\nIf you have some examples you would like to share, please start a [discussion](https://github.com/leosperry/ha-kafka-net/discussions). I'd be happy to link it here.\n\nHappy Automating!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleosperry%2Fha-kafka-net","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleosperry%2Fha-kafka-net","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleosperry%2Fha-kafka-net/lists"}