Automation Engine With Python

Notice: This article is maintained for historical purposes. The Bixly Automate/Nebri OS platform that Bixly built, and this article features, is no longer available. Checkout Serverless Providers as an alternative.

What’s interesting is that the word automation is so attractive, yet it seems to mean almost anything. It’s in danger of meaning nothing. But we all know there is something here and we won’t give up the search for a great automation tool!

Personally I think the very best and highest ideal for an automation engine is based on rules. Otherwise what would separate automation from just writing a standard program? We don’t call it automating, we call it programming – for a reason.  Now rules, they provide a new vision for automation. It allows you to define the operating principles of whatever you want to automate in terms of rules, wisdom, what you are sure of.  Examples?

  • I know when the fridge gets below this temperature it needs attention
  • I know that when inventory is this low, we need to create an order
  • I know that 100 customer complaints per week is cause for introspection
  • I know that anybody who is in X group can see Y documents

IF, and that’s a big IF, your rules are followed across every instrument or person or software or machine, you have saved yourself time and created a juggernaut. The difficulty of course if having a system where every change is checked against your rules in an efficient way.

That’s what we have built. It allows you to write pure Python and funnel all system changes into one check-able stream of data.  Here’s an example script:

class high_temp_shutdown(NebriOS):
    listens_to == ['shared.temperature'] 

    def check(self):
        return self.temperature > 220

    def action(self):
            # assuming this is an available call

We thought it was going to be simple to write, this rules engine. The truth is we are exploring a different computational model and building a whole SAS system around it. It’s not simple. It’s deep and philosophical and causes architecture conversations weekly that are hours long. Anyone that tells you a rules based automation system in Python is easy to build hasn’t done it to the degree we have. I would put money on that!

But I digress.

We have made the code snippet above work. It will always work against any change in the system. Stand on our shoulders why don’t you? The price is low and the risk is just about nothing.