![]() |
|
LM overload and Trends gap - Printable Version +- LogicMachine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: General (https://forum.logicmachine.net/forumdisplay.php?fid=2) +--- Thread: LM overload and Trends gap (/showthread.php?tid=6509) |
LM overload and Trends gap - gdimaria - 14.07.2026 hi, Following a freeze caused by a script sending telemetry to Thingsboard (now resolved), there was a loss of trend data for the period between 12:00 and the machine's automatic restart (21:00).
I recovered the missing data using the attached script and have also included screenshots of the trends.
My question is: if the data was still visible (at least partially) at 18:00 but was lost upon restart (resulting in flat lines), how was I still able to recover the data, and why is it no longer visible?
How does trend rendering work?
Thanks in advance
Peppe
Code: -- Export completo di tutti i trend del 13/07/2026 in CSV, con indirizzo GA, inviato via mail
require('trends')
require('user.InvioMail') -- fornisce mail() e mailattach()
local ga_map = {
['T° Camera'] = '12/1/61',
['T° da Um Camera DX'] = '12/1/216',
['Piastre Radianti B2'] = '12/7/113',
['Com. Da Scheduler P. Radianti B2'] = '12/7/253',
['Com. Da Pulsante P. Radianti B2'] = '12/7/13',
['SetPoint SC'] = '12/1/15',
['Temp. SC'] = '12/1/11',
['Umidità Rel. SC'] = '12/1/201',
['Comfort/Spento SC'] = '12/2/12',
['Cnt VLV SC'] = '12/3/13',
['Stato Relè VLV SC'] = '12/3/10',
['Richiesta Caldo SC'] = '12/1/18',
['Richiesta Freddo SC'] = '12/1/17',
['SetPoint GBA'] = '12/1/25',
['Temp. GBA'] = '12/1/21',
['Umidità Rel. GBA'] = '12/1/202',
['Comfort/Spento GBA'] = '12/2/22',
['Cnt VLV GBA'] = '12/3/23',
['Stato Relè VLV Caldo GBA'] = '12/3/20',
['Richiesta Caldo GBA'] = '12/1/28',
['Richiesta Freddo GBA'] = '12/1/27',
['SetPoint Bagno 2'] = '12/1/35',
['Temp. Bagno 2'] = '12/1/31',
['Umidità Rel. Bagno 2'] = '12/1/203',
['Comfort/Spento Bagno 2'] = '12/2/32',
['Cnt VLV Bagno 2'] = '12/3/33',
['Stato Relè VLV Caldo Bagno 2'] = '12/3/30',
['Richiesta Caldo Bagno 2'] = '12/1/38',
['Richiesta Freddo Bagno 2'] = '12/1/37',
['SetPoint Sala TV'] = '12/1/45',
['Temp. Sala TV'] = '12/1/41',
['Umidità Rel. Sala TV'] = '12/1/204',
['Comfort/Spento Sala TV'] = '12/2/42',
['Cnt VLV Sala TV'] = '12/3/43',
['Stato Relè VLV Caldo Sala TV'] = '12/3/40',
['Richiesta Caldo Sala TV'] = '12/1/48',
['Richiesta Freddo Sala TV'] = '12/1/47',
['SetPoint Bagno 1'] = '12/1/55',
['Temp. Bagno 1'] = '12/1/51',
['Umidità Rel. Bagno 1'] = '12/1/205',
['Comfort/Spento Bagno 1'] = '12/2/52',
['Cnt VLV Bagno 1'] = '12/3/53',
['Stato Relè VLV Caldo Bagno 1'] = '12/3/50',
['Richiesta Caldo Bagno 1'] = '12/1/58',
['Richiesta Freddo Bagno 1'] = '12/1/57',
['SetPoint Camera'] = '12/1/65',
['Temp. Camera bak'] = '12/1/61',
['Umidità Rel. Camera bak'] = '12/1/206',
['Comfort/Spento Camera'] = '12/2/62',
['Cnt VLV Camera'] = '12/3/63',
['Stato Relè VLV Caldo Camera'] = '12/3/60',
['Richiesta Caldo Camera'] = '12/1/68',
['Richiesta Freddo Camera'] = '12/1/67',
['SetPoint Relax'] = '13/1/15',
['Temp. Relax'] = '13/1/11',
['Umidità Rel. Relax'] = '13/1/201',
['Comfort/Spento Relax'] = '13/2/12',
['Cnt VLV Relax'] = '13/3/13',
['Stato Relè VLV Caldo Relax'] = '13/3/10',
['Richiesta Caldo Relax'] = '13/1/18',
['Richiesta Freddo Relax'] = '13/1/17',
['SetPoint Pranzo'] = '13/1/25',
['Temp. Pranzo'] = '13/1/21',
['Umidità Rel. Pranzo'] = '13/1/202',
['Comfort/Spento Pranzo'] = '13/2/22',
['Cnt VLV Pranzo'] = '13/3/23',
['Stato Relè VLV Caldo Pranzo'] = '13/3/20',
['Richiesta Caldo Pranzo'] = '13/1/28',
['Richiesta Freddo Pranzo'] = '13/1/27',
['SetPoint Bagno 3'] = '13/1/35',
['Temp. Bagno 3'] = '13/1/31',
['Umidità Rel. Bagno 3'] = '13/1/203',
['Comfort/Spento Bagno 3'] = '13/2/32',
['Cnt VLV Bagno 3'] = '13/3/33',
['Stato Relè VLV Caldo Bagno 3'] = '13/3/30',
['Richiesta Caldo Bagno 3'] = '13/1/38',
['Richiesta Freddo Bagno 3'] = '13/1/37',
['SetPoint Cucina'] = '13/1/45',
['Temp. Cucina'] = '13/1/41',
['Umidità Rel. Cucina'] = '13/1/204',
['Comfort/Spento Cucina'] = '13/2/42',
['Cnt VLV Cucina'] = '13/3/43',
['Stato Relè VLV Caldo Cucina'] = '13/3/40',
['Richiesta Caldo Cucina'] = '13/1/48',
['Richiesta Freddo Cucina'] = '13/1/47',
['SetPoint Sala Ospiti'] = '13/1/55',
['Temp. Sala Ospiti'] = '13/1/51',
['Umidità Rel. Sala Ospiti'] = '13/1/205',
['Comfort/Spento Sala Ospiti'] = '13/2/52',
['Cnt VLV Sala Ospiti'] = '13/3/53',
['Stato Relè VLV Caldo Sala Ospiti'] = '13/3/50',
['Richiesta Caldo Sala Ospiti'] = '13/1/58',
['Richiesta Freddo Sala Ospiti'] = '13/1/57',
['SetPoint Camere Ospiti'] = '13/1/65',
['Temp. Camera Ospiti'] = '13/1/61',
['Umidità Rel. Camera Ospiti'] = '13/1/206',
['Comfort/Spento Camera Ospiti'] = '13/2/62',
['Cnt VLV Camera Ospiti'] = '13/3/63',
['Stato Relè VLV Caldo Camera Ospiti'] = '13/3/60',
['Richiesta Caldo Camera Ospiti'] = '13/1/68',
['Richiesta Freddo Camera Ospiti'] = '13/1/67',
['Stato Operativo UTA'] = '21/2/107',
['Flussostato UTA'] = '21/2/106',
['Setpoint Umidità UTA'] = '21/1/101',
['Setpoint Temperatura UTA'] = '21/2/105',
['Temperatura Mandata UTA'] = '21/2/108',
['Temperatura Esterna UTA'] = '21/1/104',
['SetFan UTA'] = '21/2/102',
['Valvola Caldo UTA'] = '21/3/103',
['Valvola Freddo UTA'] = '21/3/102',
['Umidificatore Richiesta - UTA'] = '21/6/241',
['Stato Modo UTL1 RLX'] = '21/2/17',
['Fluss. ( 0=Flusso ) UTL1 RLX'] = '21/2/16',
['SetPoint Umidità UTL1 RLX'] = '21/1/11',
['Umidità Mandata UTL1 RLX'] = '21/1/16',
['Setpoint Temperatura UTL1 RLX'] = '21/2/15',
['Temperatura Mandata UTL1 RLX'] = '21/1/14',
['SetFan UTL1 RLX'] = '21/2/12',
['Valvola Caldo UTL1 RLX'] = '21/3/13',
['Valvola Freddo UTL1 Relax'] = '21/3/12',
['Stato Modo UTL2 Cucina'] = '21/2/27',
['Fluss. ( 0=Flusso ) UTL2 Cucina'] = '21/2/26',
['SetPoint Umidità UTL2 Cucina'] = '21/1/21',
['Umidità Mandata UTL2 Cucina'] = '21/1/26',
['Setpoint Temperatura UTL2 Cucina'] = '21/2/25',
['Temperatura Mandata UTL2 Cucina'] = '21/1/24',
['SetFan UTL2 Cucina'] = '21/2/22',
['Valvola Caldo UTL2 Cucina'] = '21/3/23',
['Valvola Freddo UTL2 Cucina'] = '21/3/22',
['Stato Modo UTL2 Ospiti'] = '21/2/37',
['Fluss. ( 0=Flusso ) UTL3 Ospiti'] = '21/2/36',
['SetPoint Umidità UTL3 Ospiti'] = '21/1/31',
['Umidità Mandata UTL3 Ospiti'] = '21/1/36',
['Setpoint Temperatura UTL3 Ospiti'] = '21/2/35',
['Temperatura Mandata UTL3 Ospiti'] = '21/1/34',
['SetFan UTL3 Ospiti'] = '21/2/32',
['Valvola Caldo UTL3 Ospiti'] = '21/3/33',
['Valvola Freddo UTL3 Ospiti'] = '21/3/32',
['Stato Modo UTL4 Pranzo'] = '21/2/47',
['Fluss. ( 0=Flusso ) UTL4 Pranzo'] = '21/2/46',
['SetPoint Umidità UTL4 Pranzo'] = '21/1/41',
['Umidità Mandata UTL4 Pranzo'] = '21/1/46',
['Setpoint Temperatura UTL4 Pranzo'] = '21/2/45',
['Temperatura Mandata UTL4 Pranzo'] = '21/1/44',
['SetFan UTL4 Pranzo'] = '21/2/42',
['Valvola Caldo UTL4 Pranzo'] = '21/3/43',
['Valvola Freddo UTL4 Pranzo'] = '21/3/42',
['Stato Modo UTL6 GBA'] = '21/2/67',
['Fluss. ( 0=Flusso ) UTL6 GBA'] = '21/2/66',
['SetPoint Umidità UTL6 GBA'] = '21/1/61',
['Umidità Mandata UTL6 GBA'] = '21/1/66',
['Setpoint Temperatura UTL6 GBA'] = '21/2/65',
['Temperatura Mandata UTL6 GBA'] = '21/1/64',
['SetFan UTL6 GBA'] = '21/2/62',
['Valvola Caldo UTL6 GBA'] = '21/3/63',
['Valvola Freddo UTL6 GBA'] = '21/3/62',
['Stato Modo UTL7 Sala TV'] = '21/2/77',
['Fluss. ( 0=Flusso ) UTL7 Sala TV'] = '21/2/76',
['SetPoint Umidità UTL7 Sala TV'] = '21/1/71',
['Umidità Mandata UTL7 Sala TV'] = '21/1/76',
['Setpoint Temperatura UTL7 Sala TV'] = '21/2/75',
['Temperatura Mandata UTL7 Sala TV'] = '21/1/74',
['SetFan UTL7 Sala TV'] = '21/2/72',
['Valvola Caldo UTL7 Sala TV'] = '21/3/73',
['Valvola Freddo UTL7 Sala TV'] = '21/3/72',
['Stato Modo UTL8 Camera'] = '21/2/87',
['Fluss. ( 0=Flusso ) UTL8 Camera'] = '21/2/86',
['SetPoint Umidità UTL8 Camera'] = '21/1/81',
['Umidità Mandata UTL8 Camera'] = '21/1/86',
['Setpoint Temperatura UTL8 Camera'] = '21/2/85',
['Temperatura Mandata UTL8 Camera'] = '21/1/84',
['SetFan UTL8 Camera'] = '21/2/82',
['Valvola Caldo UTL8 Camera'] = '21/3/83',
['Valvola Freddo UTL8 Camera'] = '21/3/82',
['T° Serbatoio DOWN'] = '22/2/1',
['T° Mandata Utenze'] = '22/2/2',
['T° di Ritorno'] = '22/2/3',
['Contattore Resist. Bollitore'] = '21/4/243',
['Temp. Camera'] = '12/1/61',
['Umidità Rel. Camera'] = '12/1/206',
['Temperatura Circuito Caldo'] = '1/0/221',
['Temperatura Circuito Freddo'] = '1/0/211',
['SET % Portata Virtuale'] = '0/1/137',
['T° Ritorno Radianti'] = '21/3/202',
['Operating Mode'] = '22/1/37',
['Water Inlet Temp.'] = '22/1/42',
['Water Outlet Temp.'] = '22/1/34',
['Force DHW'] = '22/1/138',
['Finestra I'] = '1/7/214',
['Finestra II'] = '1/7/215',
['Finestra III'] = '1/7/216',
['Finestra Bagno 1'] = '1/7/217',
['Finestra Sala TV'] = '1/7/213',
['Finestra Scarpiera'] = '1/7/210',
['Finestra Guardaroba'] = '1/7/211',
['Finestra Bagno 2'] = '1/7/212',
['Finestra I Relax'] = '1/7/203',
['Finestra II Relax'] = '1/7/204',
['Finestra III Relax'] = '1/7/205',
['Finestra Sala Pranzo'] = '1/7/218',
['Finestra Bagno 3'] = '1/7/202',
['Finestra Cucina'] = '1/7/206',
['Finestra Sala Ospiti'] = '1/7/209',
['Finestra I Camera Ospiti'] = '1/7/207',
['Finestra II Camera Ospiti'] = '1/7/208',
['Memory Load'] = '18/0/5',
['Carico CPU'] = '18/0/4',
}
local dates = {
start = { year = 2026, month = 7, day = 13 },
['end'] = { year = 2026, month = 7, day = 14 }
}
local lines = {}
table.insert(lines, 'trend_name;indirizzo_ga;timestamp;datetime;value')
for name, ga in pairs(ga_map) do
local ok, data = pcall(trends.fetch, name, dates, 900, true)
if ok and data then
for _, row in ipairs(data) do
local ts, val = row[1], row[2]
if val ~= val then val = 'NaN' end
local dt = os.date('%Y-%m-%d %H:%M', ts)
table.insert(lines, name .. ';' .. ga .. ';' .. tostring(ts) .. ';' .. dt .. ';' .. tostring(val))
end
else
table.insert(lines, name .. ';' .. ga .. ';ERRORE;;impossibile leggere il trend')
end
end
local csv = table.concat(lines, '\n')
local destinatari = { 'giuseppexxx@xxx' }
local oggetto = 'Export trend 13/07/2026'
local corpo = 'In allegato il CSV con tutti i trend del 13/07/2026 (con indirizzo GA), risoluzione 15 minuti.\n\nRighe totali: ' .. #lines
mailattach(destinatari, oggetto, corpo, 'export_trend_13072026.csv', csv, 'text/csv')
log('Export inviato via mail: ' .. #lines .. ' righe')RE: LM overload and Trends gap - admin - 14.07.2026 Trend logs are synced less often than the main database. The more trends you have the longer is the sync interval. Once LM reboots the data that has not been synced is lost. RE: LM overload and Trends gap - gdimaria - 14.07.2026 (Yesterday, 10:48)admin Wrote: Trend logs are synced less often than the main database. The more trends you have the longer is the sync interval. Once LM reboots the data that has not been synced is lost. Ok, so I rescue data from DB, not from trends. is there no way to force a resync? RE: LM overload and Trends gap - admin - 14.07.2026 It's not possible to add historical data to a trend log. |