.NET automations now with UI

I just released version 2 of HaKafkaNet, which comes with some pretty big QOL improvements.

First, it now ships with a minimal UI. This UI is not intended to create automations, but rather display information about the compiled automations you have running.

It is possible to enable/disable automations from the dashboard which is handy for anytime you want to disable an automation quickly, but don’t want to shut down your docker image, make adjustments, recompile, and redeploy. Future versions may add troubleshooting information such as logs. It also has a link to the KafkaFlow admin dashboard which will allow you to inspect any Kafka consumers you have running.

Next up, we now have an automation builder class for rapidly create automations. Here’s a code snippet from one of the examples which you can see in the image above:

     _builder.CreateConditional()
        .WithName("Office Light Off When No Motion")
        .WithDescription("from builder")
        .WithTriggers(OFFICE_MOTION)
        .When(stateChange => stateChange.New.State == "off")
        .ForMinutes(5)
        .Then(ct => _services.Api.LightTurnOff(OFFICE_LIGHT, ct))
        .Build();  

There are a few overloads in the builder methods and a bunch of optional.

Finally, in line with one of the goals of the project to make all automations testable without needing to connect to Home Assistant, there is now a Test Harness for component level testing which ships with a separate nuget package. You can still fully unit test any custom automations you write. However, for scenarios like the one above, unit testing may not be feasible. That’s where the Test Harness comes in and will allow you to still in memory test all your automations regardless of how they are constructed.

I know some of you out there have downloaded this project from either github or nuget. I’d love to hear what you’re doing with it and any features you might like to see.

Official documentation for all the new features will be written soon.