(22.11.2023, 09:01)admin Wrote: You can simply delete the trend file then it will be re-created automatically.
Code:id = 99
file = '/tmp/trends/t' .. id .. '.trend'
os.remove(file)
Making a script that modifies internal trend values is possible but it's a complex task.
thks admin and daniel.
This first solution will be cool.
Can you send some key I will dig in it for the second one ?
For the first solution, this scipt with your help do the job.
I would prefer the second solution where I don't need to put the name... but only a value max
Code:
tabCurveName= {
'ECLAIRAGE-TOTAL-KWH',
'GENERAL_ELEC-TOTAL-KWH'
}
for _, curveName in ipairs(tabCurveName) do
id = db:getone('SELECT id FROM trends WHERE name=?', curveName)
if id then
file = '/tmp/trends/t' .. id .. '.trend'
os.remove(file)
end
end
script.disable(_SCRIPTNAME)
-----------
FRANCE SMARTHOME & SMARTBUILDING INTEGRATION
SE ECO EXPERT
FRANCE SMARTHOME & SMARTBUILDING INTEGRATION
SE ECO EXPERT