There are two kinds of Services in Automate: UserServices and SystemServices.
SystemServices are mainly designed to implement a practical way of writing an interface between your
custom SystemObjects and their corresponding resources (devices for example). For example,
provide access to Raspberry Pi GPIO pins for
and ArduinoService, correspondingly, provides access to Arduino devices for ArduinoActuator and ArduinoSensors.
(Arduino and RPIO support are provided by extensions, see Extensions).
UserServices, on the other hand, provide user interfaces to the system. For example,
provides access to the system via web browser,
via IPython shell and
via XmlRPC (remote procedure call) interface for other applications.
If not automatically loaded (services with
autoload set to
they need to be instantiated (contrary to
outside the System, and given in the initialization of the system (
For example of initialization and configuring of
WebService, see “Hello World” in Automate.
Services Class Definitions¶
Base class for System and UserServices
If set to True, service is loaded automatically (if not explicitly prevented in
automate.system.System.exclude_services). Overwrite this in subclasses,
Initialize service here. Define in subclasses.
Cleanup actions must be performed here. This must be blocking until service is fully cleaned up.
Define in subclasses.
Baseclass for UserServices. These are set up on startup. They provide usually user interaction services.
Baseclass for SystemServices. These are set up by when first requested by Sensor or other object.
Provides interface to log output. Used by WebService.
The most recent log line is always updated here. t Subscription to this attribute can be used to follow new log entries.
Service which is responsible for scheduling dumping system into file periodically.
Dump saving interval, in seconds. Default 30 minutes.
Provides UML diagrams of the system as SVG images. Used by WebService.
PLantUMLService requires either PlantUML software (which is opensource software written in Java) to be installed locally (see http://plantuml.sourceforge.net/) or it is possible to use online service of plantuml.com In addition you need python package
plantuml(available via PYPI).
URL of PlantUML Java Service. To use PlantUML online service, set this to ‘http://www.plantuml.com/plantuml/svg/‘
Arrow colors as HTML codes stored as a dictionary with keys: controlled_target, active_target, inactive_target, trigger
Background colors as HTML codes, stored as a dictionary with keys: program, actuator, sensor
Writes PUML from the system. If filename is given, stores result in the file. Otherwise returns result as a string.
Returns PUML from the system as a SVG image. Requires plantuml library.
Provides interactive Python shell frontend to the System. Uses IPython if it is installed. Provides couple of functions to the System namespace.
List actuators, programs or sensors (what is string)
Print Automate help if no parameter is given. Otherwise, act as pydoc.help()
Start Text UI main loop