.NET Core automation framework

As promised, here's my automation framework for .NET Core developers, Puppet!

The README should (hopefully) have everything you need. Here's the basics:

How it works

  1. An event on one of your devices is triggered.

    Example: Your pantry door opens, triggering a contact sensor to send open.

  2. An instance of this app is configured to send a webhook to the Puppet Web app.

    Example: The webhook app posts the event containing the open status to http://some.address.on.my.network:5000/api/automation/?automationName=pantry_door

  3. The web app handles the request by passing the event information to the Puppet Executive app, which runs in a separate process that manages task state.

  4. The Puppet Executive passes the name of the automation to the AutomationFactory. The AutomationFactory class instantiates the correct implementation of IAutomation and returns it to the Executive.

    Example: The Executive asks AutomationFactory for an object to handle the automation named pantry_door. It returns an instance of Puppet.Automation.PantryLightAutomation.

  5. The Executive executes the Handle() method on the IAutomation object. The object can manipulate other devices via the HomeAutomationPlatform class, of which an instance can be passed in by the Executive.

BEST EXAMPLE: The logic in Puppet.Automation.PantryLightAutomation should be pretty self-explanatory. :slight_smile:

Let me know if you have any questions, or send me a PR if you want to make improvements! Also check out my Twitch stuff (listed in the README) to see me working on it.

7 Likes