This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Trend clean
#7
(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
Reply


Messages In This Thread
Trend clean - by domotiqa - 22.11.2023, 07:12
RE: Trend clean - by Daniel - 22.11.2023, 08:42
RE: Trend clean - by domotiqa - 22.11.2023, 08:51
RE: Trend clean - by Daniel - 22.11.2023, 08:54
RE: Trend clean - by domotiqa - 22.11.2023, 08:59
RE: Trend clean - by admin - 22.11.2023, 09:01
RE: Trend clean - by domotiqa - 22.11.2023, 09:25
RE: Trend clean - by domotiqa - 15.12.2023, 07:44
RE: Trend clean - by admin - 15.12.2023, 10:47
RE: Trend clean - by jmir - 31.05.2024, 05:58
RE: Trend clean - by domotiqa - 19.12.2023, 08:23
RE: Trend clean - by domotiqa - 19.12.2023, 16:39
RE: Trend clean - by admin - 31.05.2024, 06:51
RE: Trend clean - by jmir - 31.05.2024, 07:06
RE: Trend clean - by admin - 31.05.2024, 07:15
RE: Trend clean - by jmir - 31.05.2024, 14:17
RE: Trend clean - by domotiqa - 18.09.2024, 17:16
RE: Trend clean - by admin - 19.09.2024, 10:43
RE: Trend clean - by domotiqa - 20.09.2024, 10:12

Forum Jump: