Hubitat keeps deleting data against my will

Hi, I realized a few weeks ago that Hubitat set the maximum age of device data to 31 days, without any apparent ability to change that value. So I figured I'd make a Rule to write changed data to a .csv file on the hub, and access that as needed. Now I come to find out that Hubitat is arbitrarily deleting or truncating my .csv file, even though there is no delete action in my rule. I happened to find a log entry that shows the Rule Machine at one point tried to delete it and encountered an error. I want Rule Machine to NOT randomly delete my file whenever it feels like it. This seems like something that needs to be fixed. Here is my Rule and log entry I found from earlier today; I have not changed this rule in several weeks:

To do the Append I believe RM reads the file into memory, adds the new data to the memory copy, deletes the old file and then writes a new file with the same name from the data in memory.

Not quite. It does read the file into memory, then writes the file back with the appended string. Not a new file, and no deletion.

There is a way, but you should use extreme caution when changing things like this. This number was set a certain way to manage hub free memory, and how many read/writes you make to the memory card. You could introduce unintended consequences by changing things, I am not endorsing doing this, but the info is out there on the forum.

That said, the linked thread below should have the settings you want. In particular, I think you are wanting max Event Age Days?
Possible slow down problem with 2.3.0.124? - #108 by tony.fleisher

2 Likes

Yes that is exactly what I needed, thanks! I set the global max age of 365 and then set low event count limits on all but the sensors I need long history for.

Well, you just did what I warned you not to, good luck!

4 Likes

you could feed into nodered and keep the data as long as you'd like, and avoid a possible hub slowdown

1 Like

Or anything else. InfluxDB, with visualization using Grafana, is a popular choice:

2 Likes

These are all very helpful, thank you. For now I will wait and see what effect this has on the hub, if any. I have only a small number of sensors from which I am wanting long-term data. It is difficult for me to imagine how the age of the data matters any more than its quantity or capture rate.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.