/homewsn.webui

Web user interface

Primary LanguageJavaScriptGNU General Public License v2.0GPL-2.0

Setting Up the Web User Interface (WebUI)

This repository is a part of the HomeWSN project.

Web user interface requires the web server, PHP and MySQL database. The web server may be any on any operating system, the main requirement is PHP support. The best choice is a simple small and easy to use standalone web server with PHP support like civetweb. To setup WebUI just copy all the files and subfolders into your web site document root (or another) folder.

The MySQL database is required to collect and store data received from the sensors and actuators. Web user interface also uses the database to obtain the properties of the devices, and their collected data. These data are typically long values, but may be floats and strings. The devices initially send their properties to the whsnbg, which in turn stores them in the database:

  • Actuator #, Actuator IP in the 'Actuators' table (DB Tables -> Actuators -> Locations menu);
  • Param #, Unit and Data type in the 'Actuators parameters' table (DB Tables -> Actuators -> Device types menu);
  • Sensor #, Sensor IP in the 'Sensors' table (DB Tables -> Sensors -> Locations menu);
  • Param #, Unit and Data type in the 'Sensors parameters' table (DB Tables -> Sensors -> Measured parameters menu);

The end user complements this data via the web interface. Sensor and actuator location is entered into Location field in the 'Sensors' and 'Actuators' database tables respectively. Other visual properties can be modified in the 'Sensors parameters' and 'Actuators parameters' tables. The Image type field is used to define the graphical representation of the measured parameter.

  • The ImageFile option is used for the parameters which may have only two states, like on-off or open-close etc. It's needed to additionally enter icons urls to the Image n/a, Image 0 and Image 1 fields if this option is selected. State 0 and State 1 are used for verbal designation of the device status.
  • The LinearGauge and CircularGauge options are used for the numerical parameters. Therefore State 0 and State 1 are used for minimal and maximum values of this numeric parameter. Image n/a, Image 0 and Image 1 are not required to fill in.

The Type field is used to create the appropriate element under the Types of devices in the Actuators drop-down menu or under the Types of measured parameters in the Sensors drop-down menu respectively.

When all the required fields in the database tables will be filled in correctly, the corresponding elements in the Actuators and Sensors drop-down menus appear.

External dependencies

WebUI depends on external javascript and css libraries and each has its own license. The total list of the dependencies is provided below:

HomeWSN WebUI javascript code itself licensed under GPLv2.