I found this thread and worked my way through it, and found the solution at the end to look the most elegant and up-to-date. However. although I hate to admit defeat, I CANNOT get it to work.
MotionEye seems to work fine and the web hook is HA generates no errors, but the moment I [Update] the template it says it is cleared then immediately says it loses connection. I don’t have a link problem because the video is coming through fine both to MotionEye and HA.
Can anyone give me a clue as to what I have configured wrongly, please?
Hi Jonathan,
I´m no longer using Motioneye because of the issue with storing on Dropbox and thus I cannot move the recordings away from HA and make them available in the cloud.
I however still have the config and I had an input boolean defined that was updated by the webhook, not by an event as you have it above:
based on the state changes of the input boolean, I could have other automations like sending notifications, etc. Not sure if it is the same what you are trying to do, but maybe this helps.
I have two cameras on my MotioneyeOS setup.
Both camera are set on “triggered on motion” for still image and video recording. And I can see the files are created when motion is detected.
In HA, I configured the template to trigger a binary_sensor on motion, for each camera.
It’s working good for the first camera. I can see the state change of the binary_sensor when motion is detected.
I copy/paste the same code for the 2nd camera, with just changing the id.
Issue, no motion is detected on HA.
When I change a parameter on the camera and press “apply”, it seems that a webhook is sent on HA at the exact time/date. So it looks like the webhook is correctly setup.
But why no motion is reported ? Is it from the motion detection parameter on MotioneyeOS, or in code writting in HA ?
Here is my code :