Hi all.
I’m thinking about how proceed to integrate my Dlink 5020L camera with HA and notifications to motion detection.
I’m running on raspberry, so implementing an IMAP mail server to receive mail from camera and use the IMAP sensor on HA is too much…
I’m looking at inotify linux command, so i can monitor a folder in wich the camera saves images when detect motion, inotify should receive the modification and send a command to HA to notify the status change.
But I’ve some difficulty to understand how HA works.
If i create sensor in configuration, should I be able to change its state by API call (curl script when inotify detects changes) and then trigger an action to send a message on telegram (or to turn on alarm…)?
I don’t understand how sensors communicate to HA their status change.
Many thanks for explaination.
I am working on exactly the same thing right now, I was using motion but it was eating 99% cpu while monitoring one IP camera.
I too have the inotify working, right now it fires a python script to buzz a peizo buzzer on the GPIO,
I “think” using the GPIO sensor I can monitor a pin for up/down and use that fire whatever notification from HA I choose.
The other way I was thinking was using swatch and using the inotify to log, then executing some script that is an easy sensor for HA
I’ve solved with pure-ftpd and upload-script. The script is a bash that publish a message to MQTT queue with state = on and the file path into a json and after 60secs executes another script that send another MQTT message with state = off. The script can be runned once per time (file lock).
in HA i’ve setup a binary_sensor (like a PIR).
The PIR fake sensor works well.
Motion Detection can be enabled or disabled by a command switch that sends a wget to my D-link camera to enable or disable the functionality.
I looked into that and pureftp was not avail for the distro I am using,
so I have managed to get swatch watching the ftp logs on the server and executing a rest call to a sensor.
Seems to be working, not fantastic yet. I need to work out the regex for the logs to only capture the upload events
Thanks for the reply!