Sign in Join
Wiki copytemporary

Foobot: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11## Lazarus and the Foobot air quality monitor
22
33- Foobot(http://foobot.io/) is an InternetOfThings gadget that monitors indoor air quality
44- Unfortunately, the company currently only supplies mobile phone apps to access the Foobot
55- They do however publish an API which returns JSON data when queried, so I decided to port it to the PC using Lazarus and FPC
66- The API page is here: <https://api.foobot.io/apidoc/index.html>
77
88### Screenshots
99
1010- Foobot Monitor
1111
12-<figure>
13-<img src="foobotmonitorscreenshot.jpg" title="foobotmonitorscreenshot.jpg" />
14-<figcaption>foobotmonitorscreenshot.jpg</figcaption>
15-</figure>
12+![](/wiki-images/d/d3/Foobotmonitorscreenshot.jpg)
1613
1714- Foobot monitor configuration window
1815
19-<figure>
20-<img src="foobotmonitorscreenshot1.jpg" title="foobotmonitorscreenshot1.jpg" />
21-<figcaption>foobotmonitorscreenshot1.jpg</figcaption>
22-</figure>
16+![](/wiki-images/d/d8/Foobotmonitorscreenshot1.jpg)
2317
2418- Foobot Interrogator
2519
2620![](/wiki-images/6/64/Foobotinterrogator1.jpg)\
2721![](/wiki-images/9/90/Foobotinterrogator2.jpg)
2822
2923### What you will need
3024
31251\. A Foobot\
32262\. A Foobot account\
33273\. A free API Key (get one from the API page: <https://api.foobot.io/apidoc/index.html>)
3428
3529### Binary Downloads: Foobot Monitor
3630
3731Windows 32/64 binaries:\
3832<https://svn.code.sf.net/p/lazarus-ccr/svn/applications/foobot/monitor/innosetup/setup_foobotmonitor.exe>\
3933Linux 32/64 binaries:\
4034<https://svn.code.sf.net/p/lazarus-ccr/svn/applications/foobot/monitor/linuxbinaries/foobotmonitor.zip>
4135
4236### Binary Downloads: Foobot Interrogator
4337
4438Windows 32/64 binaries:\
4539<https://svn.code.sf.net/p/lazarus-ccr/svn/applications/foobot/innosetup/foobotinterrogator_setup.exe>\
4640Linux 32/64 binaries:\
4741<https://svn.code.sf.net/p/lazarus-ccr/svn/applications/foobot/compiled/linuxbinaries.zip>)
4842
4943### Source
5044
5145Source code is in Lazarus CCR here: <https://svn.code.sf.net/p/lazarus-ccr/svn/applications/foobot/>
5246
5347#### Functions
5448
5549There are two main functions in foobot_utility.pas for you to use. Both will populate TObjects in foobot_objects.pas which you can read.
5650
5751``` pascal
5852// Populates FoobotIdentityObject.TFoobotIdentityList collection
5953function FetchFoobotIdentity(aUsername, aSecretKey: string): boolean;
6054
6155// Populates FoobotDataObject
6256function FetchFoobotData(DataFetchType: TDataFetchType = dfLast;
6357 iCurrentFoobot: integer = 0; iLastIntervalSeconds: integer = 3600;
6458 iLastAverageBySeconds: integer = 0; iStartTimeSeconds: int64 = 0;
6559 iEndTimeSeconds: int64 = 0; aSecretKey: string = 'unknown'): boolean;
6660
6761// Populates datapoint arrays from FoobotIdentityObject for easy access
6862// - also populates HighLow arrays
6963function FoobotDataObjectToArrays: boolean;
7064```
7165
7266### Security
7367
7468- When first run Foobot Monitor will prompt you to enter your Foobot Username and an API Key.
7569- These values are then stored in an encrypted configuration file so that they will load automatically in future
7670- The configurarion file is located:
7771 - Windows: %APPDATA%\username\Local\foobotmonitor\\
7872 - Linux /home/.config
7973- You can alter/update the stored login data in the following way:
8074
81751\. Open the foobotmonitor.cfg file\
82762\. Make a new entry thus, then save the file. (using your values instead of the example \<..\> ones)
8377
8478``` pascal
8579[Config]
8680Foobot User=<username>
8781Secret Key=<Secret API Key>
8882```
8983
9084- Next time Foobot Monitor is run, these values are read, then encrypted and the plaintext is deleted
9185 - You can do this as many times as you like
9286
9387### Licence
9488
9589License is GPLV2 (https://en.wikipedia.org/wiki/GNU_General_Public_License)
9690
9791### Updates
9892
9993- From V0.1.1.0 you can configure the colours, Max and Min values for all the sensor displays.
10094- The configurarion file is located:
10195 - Windows: %APPDATA%\username\Local\foobotmonitor\\
10296 - Linux /home/.config
10397- You can alter/update the colors and Max/Min values in the following way:
10498
105991\. Open the foobotmonitor.cfg file\
1061002\. Edit the \[Config\] section
107101
108102``` pascal
109103[Config]
110104pmColour=clGreen
111105tmpColour=clRed
112106humColour=clMaroon
113107co2Colour=clLime
114108vocColour=clBlue
115109allpolluColour=clFuchsia
116110pmMinValue=0
117111pmMaxValue=1000
118112tmpMinValue=0
119113tmpMaxValue=40
120114humMinValue=10
121115humMaxValue=100
122116co2MinValue=450
123117co2MaxValue=3000
124118vocMinValue=125
125119vocMaxValue=1000
126120allpolluMinValue=0
127121allpolluMaxValue=700
128122DisplayYellowLines=0
129123DisplayRedLines=1
130124```
131125
132126Minesadorada
133127
134128---
135129*From the Free Pascal wiki, page "Foobot", as it stood on 2019-08-30 after a change by Minesadorada, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
136130Category: Applications created with Lazarus

Back to history