17.01.2025, 08:09
You always fetch a full day, that is why my sample is using yesterday until 4 days back, so 3 full days..
From the knowledge base (time values are ignored) :
You can get today via:
To see the full data used just change -> trends.fetchone into -> trends.fetch, here you will see all samples of today
From the knowledge base (time values are ignored) :
Code:
1
dates - Lua table with two items - start and end, each item must contain year, month, day keys, time values (hours, minutes and seconds) are ignoredYou can get today via:
Code:
123456789
require('trends')
local today = {}
today['start'] = os.date('*t', os.time())
today['end'] = os.date('*t', os.time() + 86400)
-- Fetch the average temperature for the timespan
local todayaverage = trends.fetchone('Temperatuur Woonkamer', today)
log(todayaverage)To see the full data used just change -> trends.fetchone into -> trends.fetch, here you will see all samples of today