Movement Sensors timers are resetting when system restarts

Hi,

I have moment and door magnet sensors (Xiaomi) running on HA within a Synology DSM system.

Problem is, whenever my DSM restarts (obviously along HA on docker), in my Lovelace card (where I have, “movement two hours ago”, the “two hours ago” starts representing whenever the system was restarted.

I was on holidays and I got obviously scared because I didn’t know that at the time.

Is there a way to overcome this issue?

Nothing built-in.

It would be a pain if you have many sensors but you could create automations to store the date/time of the last movement to an input_datetime for each sensor. That would survive restarts.

Any idea how to easily do that?

No idea on how to store date/time of the last movements, and then retrieve that after restart.

Create an input_datetime to store the data.

then create an automation that is triggered by the desired sensor. Use the “input_datetime.set_datetime” service to set the date & time to now().

it will aleways have the latest date/time data of the last sensor update and survive restarts.

As for Timers @123 Restore active/paused timers after a restart works excellently :+1:t4:

The title of the thread is a bit misleading.

The OP isn’t talking about true timers. They are asking about the “last_changed”/“last_updated” attributes of certain sensors which get reset to the last restart time of HA by default.

I c now. At a glance it looks like the OP is looking for a solution for timers which are getting reseted after every DSM reboot.

1 Like