Unifi Protect Motion timer

Posted on
Sat Dec 30, 2023 2:10 pm
durosity offline
User avatar
Posts: 4320
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Unifi Protect Motion timer

Would It be possible to add an extra device state for protect camera devices? I want to have a line where it'll tell me how many mins since last motion was detected which I can in turn use with masquerade/occupatium.

Computer says no.

Posted on
Sun Dec 31, 2023 2:56 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: Unifi Protect Motion timer

Will check next year.


Sent from my iPhone using Tapatalk

Posted on
Wed Jan 03, 2024 9:57 am
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: Unifi Protect Motion timer

there is event end date stamp. that is a value that des not change between events.

you want some thing like a seconds counter? what should the update frequency be ie how often should the number be increased: every second/ every minute?

hat is easy to program, but it will add a number of updates to the indigo dev states. eg 10 cameras, update 1/sec --> 10 updates per second.

I could add an option to set the update frequency. I am just think aloud.

Or you could add a script that runs every second and calculates the seconds since last change and put it into a variable. I can post that one tomorrow.


Karl

Posted on
Wed Jan 03, 2024 10:06 am
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Unifi Protect Motion timer

and there is a plugin that does just that: seconds since

1. define dev.state you want to track
Screenshot 2024-01-03 at 17.03.56.png
Screenshot 2024-01-03 at 17.03.56.png (35.28 KiB) Viewed 837 times

2. check variable value --> seconds since last xx


It will have the first time false. But after the first event the numbers should be correct

here the number after a minute and later:
Screenshot 2024-01-03 at 17.05.07.png
Screenshot 2024-01-03 at 17.05.07.png (19.71 KiB) Viewed 837 times

Screenshot 2024-01-03 at 17.44.44.png
Screenshot 2024-01-03 at 17.44.44.png (20.09 KiB) Viewed 825 times





Karl

Posted on
Wed Jan 03, 2024 12:23 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Unifi Protect Motion timer

and this after the first event :
Screenshot 2024-01-03 at 19.22.45.png
Screenshot 2024-01-03 at 19.22.45.png (21.52 KiB) Viewed 808 times
, then the seconds are correct
and make sure the test every secs setting in config is smaller that the update frequency for the fastest device you want to track

eg in config set test every to 3 sec when in menu /define device/state/ update value every = 5 secs should work

Posted on
Wed Jan 03, 2024 3:19 pm
durosity offline
User avatar
Posts: 4320
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Unifi Protect Motion timer

Oh super! I shall have a look at that soon! Thanks for the advice.


Sent from my iPhone using Tapatalk Pro

Computer says no.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 6 guests