I have an android phone with IP webcam installed. The app reports the motion sensor status (1…1000) and the binary motion sensor (on/off) status. Now, when it detects motion, I want HA to send a photo to hangouts. So I added required automation and it all seems working except it seems taking a photo too late, in most cases the object (a cat) is gone.
I wonder what is the best practice to solve the problem, in particular:
what sensor (binary or motion) to use for a trigger?
is there a way to minimize latency? The non binary sensor seems updating with a delay, I am not ever sure if it is HA polling it or the IP webcam sends an event when detects motion, is there a way to know this for sure?
More research shows that it looks like the camera detects everything just fine but cannot do a snapshot until it finishes recording event itself so the snapshot action has to wait until the motion stops. Is there any ready solution? I could write a script to download the last mkv and extract frames from it I suppose…
How about you don’t use the binary sensor and instead trigger the automation when the motion value exceedes a certain threshold. That’s how it worked for me. Also I disabled all recording on the Android IP cam and instead controlled it through HA
Do you record videos, or just snapshots? If you do videos, how do you tell it to record until motion stops? Doing it on the phone seems better but has caveats :-/
Turns out I can still record videos on the phone and take snapshots on HA - I simply capture a few seconds from the feed (which does not ever stop) by a script (ffmpeg -i http://aikmoto:8080/videofeed -t 00:00:03 -y -c copy /tmp/motog_video.mkv) and extract frames/upload the video to my cloud.
And then suddenly the app stopped reporting motion to HA as it used to just a day ago. Its web interface shows sensors change just fine but the events do not reach HA.
What does the less/more sensitivity setting control in the app? The absolute value of the motion sensor raw value or whether or not it will send the event? What did you choose there and what threshold in HA?
Ah, also, what is the latency? It seems to take about 5sec for the motion sensor event to travel to HA and start video recording, too much.
update: the latency is fixed by using image_url: http://aikmoto:8080/shot.jpg in hangouts.
update2 no it was not fixed, turns out (everybody knew, I am sure) that it is HA who polls the camera, the camera does not send anything anywhere until it is asked for sensor readings OR tasker+mqttpublish are configured on the phone. and the latter seems to be the correct answer to the latency issue.
could you share your code? im trying to migrate from motion eye to HA platform solution as motion eye is a cpu resource eater. today i record 5min videos and upload to my cloud. i wish i could perform this without motion eye.
Hi @aik - I have got the motion sensor status (the one with values) working, but could not see the on/off binary motion sensor. Could you help share the relevant section in your configuration.yaml?
hey, I am noticing more responsiveness just from using less exposure (and also in the case of night vision too) maybe this can affect your issue some?
You seem pretty savvy so Im curious, did you manage to use the accelerometer function at all? I dunno what to put in the config to get it to show up.
Also, can’t find the endpoint for the “audio_only” switch. Tried /settings/audio_only?set=on but to no avail