petkit icon indicating copy to clipboard operation
petkit copied to clipboard

Timestamp on last used?

Open DieterKoblenz opened this issue 2 years ago • 2 comments

Hi, wonderful project! Many thanks for making this available.

I'm trying to track my cat litterbox use, however I can't get my head around the last used sensor.

When I use: {{ as_timestamp(state_attr('sensor.t3_100006800_last_record', 'timestamp')) }}

It returns none.

Is there an easy way to get the last real usage?

DieterKoblenz avatar Mar 13 '22 20:03 DieterKoblenz

{{ as_datetime(state_attr('sensor.t3_100006800_last_record', 'timestamp')) }}

al-one avatar Mar 14 '22 10:03 al-one

... I could've tried it myself. Okay, thank you.

However, now I'm getting the following value: 2022-03-13 16:07:22 -> which is consistent with the timestamp on the sensor: 1647187642

However, the last time it was used is around 1pm today. It shows in the history of the sensor, but apparantly the timestamp isn't updated. Or I am using it incorrect?

DieterKoblenz avatar Mar 14 '22 15:03 DieterKoblenz