OHAS Introduction

Back

OHAS is a web based framework that makes it possible to construct interactive user interfaces that interact with a remote VSCP daemon.This project is seperate from the VSCP project (m2m). OHAS contains graphical widgets as well as code for interacting with the histed code. Here are some examples that explain what the OHAS framework can do.

23.1 Example 1 - Remote device control button

A web page contains a button in the form of a javascript widget. When the button is pressed it should light up a lamp on a remote location. When the lamp is actually lit the button should indicate this. This is acomplished in the following way

1. The button is pressed.

2. A ON event is sent to a PHP page on a remote server by a XHttpRequest call. Also information that we expect a Turned-on event as a confirmation is supplied

3. The PHP script parse this information and connects to the VSCP daemon and send the event. It then waits for the respons.

4. When the response event arrives or a timeout/error occures the PHP scripts dipslyas a XML page with status and event data.

5. The Javascript parse this information and update the status of the button.

Buttons can be easily placed on any web page in any number and on any location. Any event(s) can be sent and any event(s) can be expected as a response. Note that as the VSCP daemon can handle any technology the button can control a RF, KNX, X10 or whatever device on the remote location.There is also no need to change the code to handle the user interface if the controling harware is changed.

23.2 Example 2 - Remote device value display

A user want to monitor a register on a remote device. He/she then place a register widget on a web page and configure it to update on a specific interval.

1. Javascript code is run that update the widget data

2. A register read event is sent to a PHP page on a remote server by a XHttpRequest call.

3. The PHP script parse this information and connects to the VSCP daemon and send the event. It then waits for the respons with register data.

4. When the response event arrives or a timeout/error occures the PHP scripts dipslyas a XML page with status and event data.

5. The Javascript parse this information and update the value of the register.

This functionality can equally well be connected to a gauge, a slider etc to get a better visual indication on the register content.

23.3 Example 3 - Temperature widget

A temperature widget that show like a thermometer can be placed anywhere on a web page. It can be configured to show temperature from a remote location. There are two ways to solve this. The first is to solve it as in the above examples. That is ask the server for a value from the remote device on certain intervals. This will do the job. Another way is to use the VSCP daemons possibility to write incoming event data to named variables when they arrive. Instead of reading a register this named variable value can be read and returned to the client so it can update it's status. The VSCP daemon part of this works like this

1. And event is receeived by the daemon.

2. When it is feed to the internal decison matrix of the daemon the value is written to a variable. The value of this variable can be read through the TCP/IP interface.

The process to read the variable from the javascript that control the temperature widget then work as the above examples. Note that with the same method a temperture value can be set in any text on a web page and it will be dynamicly updated.

23.4 Example 4 - Temperature diagram

This works the same as the temperature widget above but use the servers capability to save incoming events in limited round robin lists just the same as to a variable. This list is displayed by the widget diagram and a dynamic temperature diagram is therefore easy to create. Complex diagrams can be displayd this way.

Back

ohas/intro.txt ยท Last modified: 2010/08/19 02:55 (external edit)
Public Domain
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0