Volkszähler Befehle

Auslesen von Daten direkt auf dem Server per SQL unter Umgehung des Timestamps

SELECT * FROM `data` WHERE UNIX_TIMESTAMP('2023-01-09 12:10')*1000 < TIMESTAMP AND UNIX_TIMESTAMP('2023-03-10 12:15')*1000 > TIMESTAMP;

Abfrage der Daten eines bestimmten Kanals mit Darstellung des korrekten Datums

select
Concat(Date(FROM_UNIXTIME(CAST(Q.timestamp/1000 AS INTEGER))), “ „, TIME(FROM_UNIXTIME(CAST(Q.timestamp/1000 AS INTEGER)))) as Date,
timestamp, CONVERT(CONVERT(Q.value*100, UNSIGNED)/100, DECIMAL(10,2)) as value
from (select timestamp,channel_id, value
from data
where timestamp > (UNIX_TIMESTAMP()-(243600400))*1000
) Q
WHERE Q.channel_id = 6
GROUP BY DATE(FROM_UNIXTIME(CAST(Q.timestamp/1000 AS INTEGER)))

ORDER BY timestamp INTO OUTFILE ‚/tmp/values.csv‘ FIELDS TERMINATED BY ‚;‘
OPTIONALLY ENCLOSED BY ‚“‚
LINES TERMINATED BY ‚\r\n‘

Durchschnittsleistung pro Tag

http://ip-adresse/?from=2024-01-01&to=2024-02-01&group=day&style=steps&fillstyle=0.01

admin has written 159 articles