datamine to mySql, background descriptions ?

i have decided to “use” datamine features to capture sensor data in mysql.

on the machine the mysql server is running, there is also a apache2 active for localnet requests. so i wrote a tiny php file
tp opke the data into the mysql server.

so far i came up with a structure like this:

CREATE TABLE `dataMine` (
  `Service` varchar(200) DEFAULT NULL,
  `Type` varchar(32) DEFAULT NULL,
  `Device` int(8) unsigned NOT NULL,
  `LastVal` varchar(32) DEFAULT NULL,
  `Id` int(9) DEFAULT NULL,
  `Ghost` varchar(32) DEFAULT NULL,
  `LastRec` int(16) unsigned DEFAULT NULL,
  `DrowsyError` int(2) unsigned DEFAULT NULL,
  `FilterMaximum` varchar(32) DEFAULT NULL,
  `DrowsyWarning` varchar(32) DEFAULT NULL,
  `LastHistory` int(16) unsigned DEFAULT NULL,
  `FirstRec` varchar(32) DEFAULT NULL,
  `FilterMinimum` varchar(32) DEFAULT NULL,
  `DataType` int(2) unsigned DEFAULT NULL,
  `DataOffset` varchar(32) DEFAULT NULL,
  `Name` varchar(255) DEFAULT NULL,
  `FilterEnable` varchar(32) DEFAULT NULL,
  `Logging` int(2) unsigned DEFAULT NULL,
  `Variable` varchar(255) DEFAULT NULL,
  `historyState` varchar(32) DEFAULT NULL,
  `event_id` int(15) unsigned NOT NULL AUTO_INCREMENT,
  `RAW` tinytext DEFAULT NULL,
  PRIMARY KEY (`event_id`,`Device`)
) ENGINE=InnoDB DEFAULT CHARSET=utf-8;

since i dont really know what the content of each field “could” be the size and the datatype may be wrong.
maybe someone can help me in getting this “better” organised ?
and maybe comment the fields as well . as i not sure of all of them … and if the fieldset is complete either.

all fields comming 1:1 from datamine, exept of “event_id” and “RAW”
event_id is just a id, and RAW holds the original json set sumited.

I had a quick look at this and came up with the following, which is also probably incomplete and will/may contain errors. I resorted yours, then added some additional fields at the end. Can I suggest you update your first post with any new info as it comes to hand?

[code]signed int (offset the var by this) DataOffset varchar(32) DEFAULT NULL,
see dataTypeArray in Lua file DataType int(2) unsigned DEFAULT NULL,
unsigned int (the watched device) Device int(8) unsigned NOT NULL,
unsigned int (a Unix time offset ???) DrowsyError int(2) unsigned DEFAULT NULL,
unsigned int (a Unix time offset ???) DrowsyWarning varchar(32) DEFAULT NULL,
unsigned int event_id int(15) unsigned NOT NULL AUTO_INCREMENT,
bool 0 or 1 (validate data on/off) FilterEnable varchar(32) DEFAULT NULL,
signed int (max data value) FilterMaximum varchar(32) DEFAULT NULL,
signed int (min data value) FilterMinimum varchar(32) DEFAULT NULL,
Unix timestamp FirstRec varchar(32) DEFAULT NULL,
bool ‘true’ or ‘false’ (was watched) Ghost varchar(32) DEFAULT NULL,
??? historyState varchar(32) DEFAULT NULL,
unsigned int (the channel number) Id int(9) DEFAULT NULL,
Unix timestamp LastHistory int(16) unsigned DEFAULT NULL,
Unix timestamp LastRec int(16) unsigned DEFAULT NULL,
last value of the Var LastVal varchar(32) DEFAULT NULL,
bool 0 or 1 (enable logging of var) Logging int(2) unsigned DEFAULT NULL,
User’s description Name varchar(255) DEFAULT NULL,
RAW tinytext DEFAULT NULL,
upnp service name Service varchar(200) DEFAULT NULL,
see serviceTypeArray in Lua file Type varchar(32) DEFAULT NULL,
upnp service variable name Variable varchar(255) DEFAULT NULL,

??? “Archive”: “1 _Temperature Sensor - CurrentTemperature”
bool 0 or 1 (var is alpha not number) “Alpha”: 1
unsigned int (a table index) “EnergyCat” : 0
if ‘Alpha’ use this ‘Lookup’ table “Lookup”: {“stop”: 1, “pause”: 2, “play”: 3}
units text “Units”: “Centigrade”[/code]

Just to bring into the mix some work that I had done one this to with MySQL

I used the instructions for @Quinten’s - How to set up an alternative Event Server for the relational table structure and then worked on creating my own ‘user’ updates to it.

http://forum.micasaverde.com/index.php/topic,16713.msg128214.html#msg128214

@nullx8 - to help others find this thread, maybe add MySQL to the Subject of your first post above, possibly call it “How To - Using MySQL to capture DataMine data”. - it’ll compliment the CIFS one I posted a while back…