smartgage.de Docs
MySQL Queries
read configuration tables
Schritt 1
Feststellen, ob während der letzten 60 Minuten eine neue Konfiguration für die Device angelegt wurde
SELECT property, lastdate, number, diff FROM config
WHERE device_serialnumber = '17261591' AND username = 'me-systeme'
AND lastdate > (NOW() - INTERVAL 1 HOUR);
Ergebnis
property | lastdate | number | diff |
---|---|---|---|
timer | 2019-08-11 15:03:08 | 33 | timer_upload = 300;timer_average = 300;timer_config = 300 |
scaling | 2019-08-11 15:05:21 | 34 | field_1_label = Temp;field_2_label = Signal;field_1_unit = °C;field_2_unit = V;field_1_factor = 64;field_2_factor = 1 |
Schritt 2
Auslesen der Tabelle(n)
SELECT timer_upload, timer_average, timer_config FROM timer
WHERE device_serialnumber = 'mySerialnumber' AND username = 'myUsername';
SELECT * FROM scaling
WHERE device_serialnumber = 'mySerialnumber' AND username = 'myUsername';