Introduction¶
What is Automate?¶
Automate is a general purpose automatization library for Python. Its objective is to offer convenient and robust object-oriented programming framework for complex state machine systems. Automate can be used to design complex automation systems, yet it is easy to learn and fun to use. It was originally developed with home robotics/automatization projects in mind, but is quite general in nature and one could find applications from various fields that could take advantage of Automate. Automate can be embedded in other Python software as a component, which runs its operations in its own threads.
Highlights¶
- Supported hardware:
- Raspberry Pi GPIO input/output ports (Raspberry Pi GPIO Support for Automate via RPIO library)
- Arduino analog and digital input/output ports (Arduino Support for Automate via pyFirmata library)
- Easy to write extensions to support other hardware, see Making your own Automate Extensions
- System State Saving and Restoring via Serialization
- Intelligent design:
- RPC and Websocket interfaces (provided by Remote Procedure Call Support for Automate and Web User Interface for Automate) to connect between other applications or other Automate systems.
- Comprehensive and customizable Web User Interface via Web User Interface for Automate
- UML graphs can be drawn automaticlaly of the system (as can be seen in the examples of this documentation)
“Hello World” in Automate¶
Let us consider following short Automate program as a first example:
from automate import *
class MySystem(System):
# HW swtich connected Raspberry Pi GPIO port 1
hardware_switch = RpioSensor(port=1)
# Switch that is controllable, for example, from WEB interface
web_switch = UserBoolSensor()
# Lamp relay that switches lamp on/off, connected to GPIO port 2
lamp = RpioActuator(port=2)
# Program that controls the system behaviour
program = Program(
active_condition=Or('web_switch', 'hardware_switch'),
on_activate=SetStatus('lamp', True)
)
my_system = MySystem(
services=[WebService()]
)
This simple example has two sensors hardware_switch
, web_switch
, actuator (lamp
) and a program
that
contains logic what to do and when. Here, lamp
is switched on if either web_switch
or hardware_switch
has
status True. WebService
with default settings is enabled so that user can
monitor system and set
status of web_switch
. The following figure (generated via WebService
interface)
illustrates the system in UML graph:
Original application¶
Automate was originally developed in order to enable simple and robust way of programming home automatization with Raspberry Pi minicomputer, to obtain automatization and automatic monitoring of rather complex planted aquarium safety/controlling system.