OpenSCADAWiki: Home Page En/Using/ Smart House ...

Home | Index | Changes | Comments | Users | Registration | Login  Password:  
 
This is an old revision of HomePageEn/Using/SmartHouse from 2011-07-18 12:42:37..

Apartment house automation - "Smart House" (HouseSpirit)

Name: "Smart House" (HouseSpirit)
Start: 03(March) 28 2011
Finish: 06(June) 12 2011
Location: Khanty-Mansiysk city
Performers: Oleg Sidashov, Roman Savochenko
Description: Implementation of the apartment house automation project - "Smart House" (HouseSpirit).


Contents

Translation is in progress

Introduction

The object of automation is the house with equipment - the subject to automation. The system is designed to automate the actions performed by the user or service personnel to provide security, comfort, convenience at the automation object - the living room ( apartment, private house), as well as at the surrounding area (land, yard, garden) .


The system is designed for the solution of following tasks:


Objectives of the creation of the system are:

1. Automation object

The area of the automation object - 300 m2. The air temperature in rooms intended for the server, sensors and actuators placement from 10 to 25 degrees Celsius. The air temperature outside the premises where the sensors and actuators are placed: from - 30 to 30 ° C.
The levels of pollution, humidity, light, noise and ionizing radiation correspond to sanitary and epidemiological requirements for residential buildings and premises (САНПИН 2.1.2.1002-00).


At the object there is electromagnetic radiation induced by the appliances, as well as by means of different equipment (Bluetooth, Wi-Fi, GSM).


The "Smart house. Control Server" system is a hardware-software module, which is the main control center of the automation object. The server receives and processes signals from various sensors, generates and transmits signals to control actuators, communicating with the user via GSM. Management of the system is made via the web interface.


The "Smart house. Control Server" system includes the following subsystems:

  1. Access control subsystem.
  2. Lighting control subsystem.
  3. Climate control subsystem.
  4. Water network control subsystem.
  5. Household and multimedia devices control subsystem.
  6. Subsystem of the processing the information from the sensors.
  7. Subsystem for the providing the interaction with the user through the Web-interface and via GSM.
  8. Authorization subsystem.
  9. The reporting subsystem.
  10. Configuration subsystem provides mechanisms to add, remove or edit information in the used database for the 1-8 subsystems.

The block diagram of the house automation system is shown in Figure 1.


file:struct.png
Fig. 1. The block diagram of the house automation system

To control the various hardware of the house it was designed the hub and built the wireless network ZigBee of the devices for the equipment control. Overall equipment control, as well as providing the Web-based user interface and other methods of notification are made by the dedicated server of house automation. The hub if the ZigBee network is connected to the server through the RS-232 and ModBus/RTU protocol. Alarms in the automatics' control area will be sent to the user via SMS-notifications through the connected GSM-modem.


Wireless controller has the following specifications:


GSM-module has the following specifications (Siemens TC65):


The hardware of the server:


As a software environment, to serve the house automation functions - "Smart House" an open SCADA system OpenSCADA is used, in the environment of which it is designed the Web-based user interface "Smart House", and implemented the interrogation and control of devices via ZigBee concentrator.

2. Automation system

OpenSCADA system has several ways of forming visualization user interfaces, stating from integrated development tools of standard interfaces of controls the various areas of automation and ending by the low-level mechanisms of libraries and interfaces of graphic concepts.


The integrated interfaces of OpenSCADA are:


The low-level mechanisms of constructing the user interfaces include any other graphics libraries, which have a rapid development tools of the user interface. The co-operation with OpenSCADA is produced as with data source and with the interface of the unified control of the equipment under different protocols.


In order to provide the ability of user's Web-interfaces formation directly in the OpenSCADA, the module "UI.WebUser" module is provided. Overall, the OpenSCADA contains all the basic functions of a typical Web-server, as follows:

Consequently, for the construction of any user control interface it is enough to have installed OpenSCADA system with the following modules: Transport.Sockets?, Transport.SSL, Protocol.HTTP and UI.WebUser.

2.1. The structure and location of files

In order to reduce the load on the fully dynamic formation of the user interface, as well as to facilitate the future expansion and modification of style the Web-interface was divided into static and dynamic parts.


The static part consists of a set of template HTML-files with labels of the dynamics placement and resource files: CSS, JavaScript and images. In general, the static part is represented by files, which are described in the table below:


File Description
HTML-templates (HouseSpirit/Web/*)
main.html The main user interface template. Contains a general user interface with location tag of the pages' content "#####CONTEXT#####".
auth.html Template of the authorization interface with the tag of content's location "#####CONTEXT#####". It is created for using by the HTTP protocol module (/sub_Protocol/mod_HTTP).
access.html Access control template.
temperature.html Climate control template.
light.html Lighting control template.
water.html Water supply subsystem control template.
tech.html Electronic and household appliances control template.
friend.html User devices control template.
user.html Users manager template.
devices.html Device manager template.
loginError.html Page of authentication error messages, or lack of it.
mess.html Active alarm messages template.
report.html Template for alarms', actions and system messages reports formation.
welcome.html The welcome page displayed by default in the content field.
Resources (HouseSpirit/Web/res/*)
stylesheet.css Cascading Style Sheets of the user interface.
main.js JavaScript code of the main template for the time counter and session.
devMon.js JavaScript code that implements a dynamic AJAX interface for the monitoring of subsystems' device.
access.png, accesson.png Images of the access control subsystem.
temperature.png, temperatureon.png Images of the climate control subsystem.
light.png, lighton.png Images of the lightning control subsystem.
water.png, wateron.png Images of the water supply control subsystem.
tech.png, techon.png Images of the electronic appliances control subsystem.
friend.png, friendon.png Images of the user's devices control subsystem.
user.png, useron.png Images of the users' Manager.
devices.png, deviceson.png Images of the devices' manager.
report.png, reporton.png Images of the alarms, actions and system messages reports formation.
help.png, helpon.png Images of the help page.
HouseSpirit.ico Icon of the Web-based interface.
hd_l.png, hd_r.png The left and right parts of the header.
select_l.png, select_r.png Background images of the selected menu item on the left and right
space_l.png, space_r.png Images of the free menu item on the left and right.
status_l.png, status_r.png status_edge.png Images of the status bar.
Report files (HouseSpirit/Web/reports/*)
rep_{user}.html The latest report of the "user" user.

The dynamic part is implemented by the scripts in the internal language of OpenSCADA - JavaLikeCalc, which are described in the table below:

Script address Description
The script of the Web-site (/sub_UI/mod_WebUser/)
up_hs

Main Web-site script, which performs direct reception, initial processing and forming the definitive reply, namely:

  • Processing the requests to the template-pages:
    • read the file of the selected template-page, if the selection had taken place;
    • reading and parsing of the file of the main interface template (main.html);
    • placing the current server time in the "value" attribute of the element of the main template tree with the "time_vl" ID;
    • placement of the initial counter value of an active session in the "value" attribute of the element of the main template tree with the "ses_vl" ID;
    • checking the public access of the authenticated user to some parts of the interface and to hiding items that do not have access to be viewed;
    • processing the selected menu item of the page:
      • backlight of the menu item of the active page;
      • search and call of the (/sub_DAQ/mod_JavaLikeCalc/lib_web/*) dynamics script from the "script URL" argument of the selected page.
    • reading of the welcome page file (welcome.html), in the case of absence the selected page from the menu;
    • setting the values ​​of the current page and the user in the status bar;
    • placing of the page context to the main template of the interface.
  • Processing the requests to the resource files and reports:
    • Processing the resource files extension and the formation of the attribute of (Content-Type) type for the transmitted content.
  • Generation the replies with an error if there is no template-pages, or resource files.
Script library of the template-pages, and system processes (/sub_DAQ/mod_JavaLikeCalc/lib_web/*)
user Script of the template-page "Users Manager" implements the function of the formation of form for the users' management, depending on the rights of the logged in user.
devices Script of the template-page "Devices Manager" implements the function of forming the devices' control and the alarms generation form for two types of devices: decimal and dynamic.
devMon The script of the formation of the monitoring interface and form of the devices' management, configured in the "Devices Manager". This script is used by all subsystems of the devices monitoring.
alarms Script of the periodical task that checks the value of variables of devices for the configured alarms. In addition to the direct formation of alarms the script provides the SMS-notification messages to users' phones, set for notification via SMS.
mess Script of the template-page "Alarms" implements the function of forming the active list of alarms.
report Script of the template-page "Reports" implements the function of forming the table-report with the events in the system and in the various subsystems for a specified period of time. Report is generated simultaneously on the screen and in the file that can be downloaded separately by the link.

In general, the algorithm processing the requests to the pages is(on the example of http://localhost:10002/WebUser/temperature?script=devMon):

2.2. Devices Manager

The Devices Manager is available only for root and builds the form (Fig. 2) for edit, and and remove devices of two types: binary and decimal.


file:devMan.png
Fig. 2. Devices Manager.

The created device are placed in the attributes list of the parameter of the specifically taken subsystem of "ZigBee" controller of the data source module ModBus (/sub_DAQ/mod_ModBus/cntr_ZegBee/). Recording format of an attribute is as follows:


In addition to direct sensors the configuration and formation of alarms is made in the form of text procedure. The program of formation is placed in the "var" attribute of the alarms controller parameter /sub_DAQ/mod_JavaLikeCalc/cntr_alarms/prm_rules.
The "var" attribute contains the following XML tree:

<ALARMS>
  <it id = "temperature.cond1">
    if(x&lt;10) err = &quot;Low temperature: &quot;+x+&quot; &lt; 10&quot;;
  </it>
</ALARMS>


According to the XML-tree the formation of alarms and sending SMS-notifications to the subscribed users is made in the controller's task /sub_DAQ/mod_JavaLikeCalc/cntr_alarms, which is executed with a period of 1 minute.


SMS-notifications are sent via the serial transport /sub_Transport/mod_Serial/out_GSM and through the user's SMS-protocol (/sub_Protocol/mod_UserProtocol/up_SMS).


You can also select the delayed giving of the control action. To do this, the user sets the right time, in the form of: {Min}:{Sec}. Processing of the delayed control is made in the controller /sub_DAQ/mod_JavaLikeCalc/cntr_timers by setting the "var" attribute of the "rules" parameter with the help of requests in the XML tree:

<TIMERS>
  <timer id="temperature.tGhost1" tm="60" user="root">20</timer>
  <timer id="temperature.cond1" tm="10" user="root">0</timer>
</TIMERS>

2.3. Subsystems

All visualization subsystems are served by the /sub_DAQ/mod_JavaLikeCalc/lib_web/devMon script. В этом скрипте осуществляется обработка запросов от скрипта динамической визуализации Web-браузера и передача ему данных об устройствах подсистемы, необходимых для визуализации (рис.3). Данные об устройствах передаются в соответствии с правами доступа вошедшего пользователя.


file:subCntr.png
Рис. 3. Управление подсистемой.

Конфигурация датчиков читается из параметра, соответствующего подсистеме контроллера «ZigBee» (/sub_DAQ/mod_ModBus/cntr_ZegBee). Значения читаются и записываются в атрибуты датчиков этих параметров или через контроллер отложенного управления.


Задача контроллера «ZigBee» исполняется с периодом 1 секунда, в процессе чего осуществляется запрос текущих значений всех сконфигурированных датчиков. Запись значений осуществляется по факту модификации независимо от задачи периодического опроса или через контроллер отложенного управления в случае установки ненулевого времени таймера.


Связь контроллера «ZigBee» осуществляется через последовательный исходящий транспорт /sub_Transport/mod_Serial/out_ZegBee.

2.4. Менеджер пользователей

Менеджер пользователей (рис.4) предназначен для создания, удаления и редактирования учётных записей обычных пользователей.


file:usersMan.png
Рис. 4. Менеджер пользователей.

Пользователи условно делятся на администраторов и простых пользователей. Идентификация пользователя как администратора, в системе OpenSCADA, осуществляется включением его в группу «WebRoot» (/sub_Security/grp_WebRoot). Обычный пользователь включается в группу «Web» (/sub_Security/grp_Web).


В системе OpenSCADA у каждого пользователя (/sub_Security/usr_test1/) есть текстовое поле описания, которое в данном случае служит для хранения его специализированных параметров в виде:

TEL: +380679859815
SMS: true
Report: false
sub_access: --
sub_friend: --
sub_light: --
sub_tech: --
sub_temperature: rw
sub_water: --


В случае с администратором записи прав доступа к подсистемам отсутствуют, но присутствуют общесистемные параметры вроде времени жизни сеанса (/sub_Protocol/mod_HTTP).

2.5. Сообщения

Список сообщений формируется, исходя из перечня активных нарушений по их категории «ALARM:House:*» в виде таблицы с временем, категорией, уровнем и сообщением нарушения (рис.5).


file:messages.png
Рис. 5. Сообщения.

2.6. Отчёты

В формировании отчёта указывается временной диапазон и выбираются типы сообщений. Предусмотрена генерация сообщений для типов:


Протокол формируется в виде таблицы (рис.6) с временем, категорией, уровнем и сообщением нарушения, которая также записывается в отдельный файл отчёта, в последствии доступный по ссылке для отдельного открытия.


file:report.png
Рис. 6. Отчёты.

Ссылки

Referring pages: HomePageEn/Using/SmartHouse


 
There are no files on this page.[Display files/form]
There is no comment on this page. [Display comments/form]