I’m developing some LUA code that does boosts and scheduling of TRVs (using my own wakeup code all from within LUA not using UI5 at all) and need somewhere to store some data that will survive reloads. So far I’ve tried several approaches and they all work - but I’m wondering if there is a best practise or recommendation that I should be following. I should state that the writes are not massively frequent at most once a minute or a lot less and seeing as the luup log files get written every few seconds I’m assuming my writes should not add too many flash cycles (but prepared to be told otherwise). Here’s what I’ve tried so far
1). Reading and writing to files in /etc/cmh-ludl/ the advantage is I can list them from the UI5 luup files page (as an aside you can also serve your own web pages from there which is kind of fun)
2). Reading and writing to files in /tmp/log/cmh/ - which is where the logs get stored, and if you use USB logging that directory is remapped to the USB drive so there’s no writes to Veras flash memory.
3). Saving and getting data from Variable Containers - that seems to work ok and I assume must use a supported method, but I don’t know if there’s a limit on how much you can store in a single variable in a VC (I treat each VC as having 10 variables I can use, I treat the name as just another variablel). There is always the risk of course that using the UI to edit one could completely mess it up.
The variables I store tend to be serialised LUA tables.
I’d be interested in any thoughts or recommendations