IP-Symcon Module for the Foobot Air Sensor from Airboxlab.
Content
This Module uses the Open API from Foobot to retrieve information and data from the Air Sensors associated to a specific User account. When the instance is created, it automatically sets up a Dummy Module Instance for each Air Sensor associated to the account. Variables for the sensor measurements are added below each Module. The variables are updated by a Script which is copied below the Foobot Module Instance. The script is triggered regularly by a timer with the update interval provided in the settings of the Instance.
The Module supports multiple Foobot Sensors. This has however not been tested. Feedback is welcome on the IP-Symcon forum thread dedicated to this module.
- IPS 4.x
- Foobot Air Sensor(s)
- Foobot API registration
Add the following URL in the Modules Control (Core Instances > Modules:
git://github.com/naphane/IPSFoobot.git
It will then be possible to add a Foobot Instance.
Parameter | Type | Default value | Description |
---|---|---|---|
Username | string | Username from Foobot | |
Password | string | Password | |
Update interval | integer | 600 | Interval in seconds |
Once the changes have been applied, the "Check Devices" button of the Test Center will be enabled. This button must be clicked when new Air Sensors are added. The new Sensor will be detected and instances and variables will be created automatically.
The screenshot below shows the Variables created in IP-Symcon for each sensor along with their types.
For each variable, a corresponding profile with the data type and coloring schemes according to limits recommended by WHO is created and associated to the variable.
Variable | Type | Unit | Limits |
---|---|---|---|
Carbon dioxyde | integer | ppm | 1000, 2000 |
Volatile compounds | integer | ppb | 500 |
Particulate Matters (PM2.5) | float | ug/m3 | 25.0 |
Golbal Pollution Index | float | % | - |
An example of visualisation of the Foobot Variables in the IP-Symcon Webfront.
These functions will be available automatically after the module is imported with the module control and will be callable from PHP and JSON-RPC
array FOO_GetDevices(integer $InstanceID);
Gets the Devices associated with the User account along with name and uuid. Returns an Array of Devices.
array FOO_UpdateDevices(integer $InstanceID);
Updates Device Instances and Variables. Returns true if success.
array FOO_GetData(integer $InstanceID, string $uuid, $from, $to, integer $sampling);
Gets Data points for a specific period. string $from Time stamp for start of sampling period, e.g. 2014-10-25T00:00:00. string $to Time stamp for end period. integer $sampling Sampling in seconds (default NULL). Returns Array of Data points.
array FOO_GetDataLast(integer $InstanceID, string $uuid, $from, $to, integer $sampling);
Gets Data points for last period
string $uuid UUID of the Device.
integer $period Period in seconds before last point to be sampled.
integer $sampling Sampling in seconds (default NULL).
Returns Array of Data points.
A Script with the name "Foobot Update" is added below the Instance. This script will be triggered regularly with the interval specified in the configuration settings of the Instance. The script does not need to be edited, even after adding new devices at a later stage.
Changelog:
Version 0.9:
- Beta Release