Join our FREE personalized newsletter for news, trends, and insights that matter to everyone in America

Newsletter
New

Creating A "last Motion" Helper/template Entity For A Motion Sensor?

Card image cap

I feel like this should be a simple one but I’m struggling with it and would love advice!

I have a motion sensor that contains a “binary sensor” entity that indicates motion status. I would like to create a second entity that contains the time and date of last motion detected (i.e., the last time that the binary sensor changed state to “Detected”). I’m assuming this will require creating a “helper” of type “template” and then entering the appropriate formula for the template’s state but I can’t seem to figure out what that is.

FWIW, I found this 2yr old thread from someone who seems to have had a similar problem, and it looks like there is YAML code for a solution, but I’m not actually sure where to paste in this YAML code (and do I also need to create a helper to represent the “variable” that is being updated every time there is a state change, etc.) I’d rather just create a helper using the GUI if there’s a straightforward way to do that…

Thanks in advance!

3 posts - 3 participants

Read full topic