Time based persistence

Dear all, when it comes to home automation and control also privacy issues can be important. On the one hand I want to log all status and on the other hand I don’t want to collect data that is not relevant due to privacy issues. For example I have several movement detectors in the house which check movements on every floor to throw an alarm when someone is moving and nobody is at home. That works perfectly. To avoid controlling the people in the house when at home I’d like to switch that off when someone is at home. But I can not control that part of the persistence on an ON/OFF base. Do you see any other options than deleting all this data physically from the database? Thanks for your suggestions

Who has access to that database?

The other way is to create proxy items for all you motion items and rules that update the proxies only when away. And persist only the proxies.

Why is this data stored to the database in the first place? Do you actually need to save it at all?

Vincent’s question is also valid. Are you using some third party hosted database? If not the database is running on your machines, are not exposed to anything or anyone outside your LAN and you have the full power to control who has access to the database. I don’t necessarily see the privacy issue.

On-the-other-hand, I definitely do see the merits in not saving data that you don’t need to store and not saving the data you do store for any longer than is necessary. Imagine how much less impact data breaches would have if more companies followed this.

But if you are self hosting your database on your own hardware, reducing the amount of data stored is not a privacy mitigation, it is a mitigation against the impact should your network become compromised.

To elaborate on Vincent’s suggestion:

rule "Persist motion only when everyone is away"
when
    Item RealMotionSensor changes
then
    if(Present.state == ON) PersistMotionSensor.postUpdate(RealMotionSensor.state)
end

Make sure that PersistMotionSensor is in your .persist file and RealMotionSensor is not.