It’s been a couple weeks since I posted on this topic, and I just pushed V3 of HaKafkaNet which allows you to write automations in .NET. Here are all the significant changes since then, including V2.1 changes.
System Monitor
The ISystemMonitor
interface has 3 methods.
- Callback for when the state handler is initialized.
- Global Error handler
- Method for discovering non-responsive entities
That last one is very handy. On a schedule of your choosing, it will inspect all entities which trigger automations and any additional entities that you specify. If any of them report “unavailable”, “unknown”, or “none” you can be alerted. This is especially handy for that one integration you have that likes to unload itself from time to time.
UI updates
The UI now shows all entitles tracked by the above-mentioned system monitor and has some useful links.
Delayable automations
Unlike the already available IConditionalAutomation
, which looks for some state to exist for some amount of time, the ISchedulableAutomation
allows you to schedule automations based on information in the state change itself. For Example: if you have a calendar integration, you could run automations based on the next event on your calendar.
Prebuilt Sun based Automations
Using the above-mentioned delayable automations, you can now easily create automations based on sun rise/set/etc. and you can specify an offset. For example: Turn on the front porch light 15 minutes before sunset. That is a very easy automation to accomplish in Home Assistant by default, but here’s an example of how I’m using it: In my house, we have a bearded dragon and we want some of his lights controlled based on the sun. By putting those automations in HaKafkaNet and by using the system monitor mentioned above, I can easily set up notifications for when his environment potentially has issues, with little extra effort.
Happy Automating!