PlugWeb: System architecture overview

PlugWeb goals

The first goal of this project is create a component which is able to communicate with the plugwise devices in a linux environment. After this goal has been achieved it is time to use the component to create various scripts and interface. The features/wishlist of the project is listed below:

System architecture overview

The PlugWeb system consist of several components. Below is an overview of the components and their relations.

Component: Driver This is the most essential component of the system. The driver component handles all the communication with the Plugwise usb stick.

Component: Daemon The daemon components is process running in the background for switching on/off devices on-demand and also for polling the devices periodically and saving the results in the database.

Component: Database A sqlite database is used for storing historical device information.

Component: Models The models form an abstraction layer between the software objects and the physical storage of these objects.  The component provides a way to define models for retrieving and storing domain specific information in a structured manner.

Component: Service layer The service layer handles the database operations and the communication with the daemon. The website will make use of the service layer for retrieving information about the Plugwise network.

Component: Website The website consist of three pages which all need authorisation.

Optional Component: Mobile Application Possibly in the future the project could be extended with an mobile (Android, iPhone) application to monitor and control your devices always and everywhere. Such mobile application should also use the service layer. The service layer minimises code duplication and enables easy future extensions.

The database

Below is the proposed database structure for the plugweb project. The main entity is a device, containing a mac address, name and descriptions. Devices can be grouped into types (lamp, tv, etc) and area's (living room, bed room, etc). The daemon collects historical power usage information which is saved in the history table. The daemon also checks the states of devices regularly. State changes are saved in the log table. Users can create planning rules for switching devices on/off automatically. The planning is executed by the daemon, which stores information about executed actions in the action table. In this post I provided the system architecture and database structure of the PlugWeb system. Next time I will blog about the concept and implementation of the plugwise driver.

Blog posts in this series

This blog post is an item in a series of blog posts about the development of the PlugWeb system. The following blog posts of this series have been published in the past:

Next time I will blog about the following aspects of the PlugWeb system.

Rendered Content in 0.002 seconds

Rendered UI Widgets in 0.002 seconds

Want to see the cheezy internals?
twig layout template | twig page template | json data