OpenIPC / firmware

Alternative IP Camera firmware from an open community
https://openipc.org
MIT License
1.22k stars 240 forks source link

[Feature Suggestion] Any plan to add Homekit support? #205

Open jimsmt opened 2 years ago

jimsmt commented 2 years ago

Hi, first I want to say thanks for this great project again

Just want to know if there's any plan to add Apple Homekit support? I find there are many opensource projects to convert rtsp streams and publish to Homekit, for OpenIPC, this should be easier I guess? Since there's no need to convert rtsp streams using ffmpeg

ZigFisher commented 2 years ago

Hi In the near future we plan to add the MQTT protocol

jimsmt commented 1 year ago

Hi In the near future we plan to add the MQTT protocol

Thanks, I noticed the new MQTT client menu under Services menu. But there's no option to choose MQTT as method to send notification under the menu Motion guard. Seems I can only send MQTT message and snapshot by manually executing the script /usr/sbin/send2mqtt.sh

I tried to add a line motion_send2mqtt="true" to /etc/webui/motion.conf and reboot, can't make it working

jimsmt commented 1 year ago

I then looked into /usr/sbin/motiondetection.sh and added a line [ "true" = "$motion_send2mqtt" ] && send2mqtt.sh and rebooted, still no luck

Actually, the motion detection function doesn't seem to work at all. I added another line touch /tmp/motion_test at the beginning of /usr/sbin/motiondetection.sh, and wave my hand before the camera, nothing happened, no motion_test file was created in /tmp directory

jimsmt commented 1 year ago

Fixed myself and submitted a pull request to add the send2mqtt option

The file /etc/init.d/S92motion is missing in the final firmware, have to create one myself to start motiondetection.sh automatically on system startup

#!/bin/sh
#
# Start motion detection
#

config_file=/etc/webui/motion.conf
[ ! -f "$config_file" ] && echo "Config file not found." && exit 2
source $config_file

start(){
    if [ "true" = "$motion_enabled" ]; then
        echo "Starting motion detection..."
        /usr/sbin/motiondetection.sh
    else
        echo "Motion detection service is disabled in ${config_file}."
        exit 3
    fi
}

stop(){
    echo "Stopping motion detection..."
    kill -9 $(pidof motiondetection.sh)
}

case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    restart)
        stop
        sleep 1
        start
        ;;
    *)
        echo "Usage: $0 {start|stop|restart}"
        exit 1
        ;;
esac