DataLogger

From ago control wiki
Revision as of 12:48, 24 December 2012 by Jaeger (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Data Logger

The data logger logs all events which are sent by devices. You can request values in a specific time range for a device and you will get them back in JSON format. You have to set up a database first:

cd /opt/agocontrol/bin
sqlite3 agodatalogger.db

Create the primary table:

CREATE TABLE data(id INTEGER PRIMARY KEY AUTOINCREMENT, uuid TEXT, environment TEXT, unit TEXT, level REAL, timestamp TIMESTAMP);

Start the Logger (perhaps in a screen session):

python agodatalogger.py

Now the data logger is logging all events to the SQLite DB and you can get out data with the messagesend command:

/opt/agocontrol/bin/messagesend.py -c getloggergraph -p deviceid=000000-0000-0000-0000-000000000000 -p start="2012-12-24 12:00:00" -p end="2012-12-24 13:00:00" -p env="temperature" -p freq="5Min"

For the command getloggergraph you need this parameters:

  • deviceid = UUID of device
  • start = Start time for e.g.: 2012-12-24 12:00:00
  • end = End time e.g.: 2012-12-24 13:00:00
  • env = environment e.g.: temperature
  • freq = frequency e.g.: 5Min for 5 minutes - or 10Min, 15Min

With command getdeviceenvironments you will get back a JSON with all devices and their environment's.

Personal tools