Coder Social home page Coder Social logo

Comments (16)

jlg89 avatar jlg89 commented on May 24, 2024 2

I'm realizing that the combination of homebridge-camera-ffmpeg and homebridge-dafang-mqtt-republish accomplishes pretty much everything that this plugin does, but without this kind of oddness and other errors (like FFmpeg crashing). This may be why this plugin hasn't seen any love lately. I'm including the relevant sections of my config.json, which has a Wyzecam V2 and a Wyzecam Pan, as an example. Each camera will have HomeKit switches for grabbing a snapshot, recording video, and rebooting, and the Pan will also have motor control switches. This gives reliable video that obeys the "videoConfig" parameters, working audio, reliable alerts, etc.

        {
            "platform": "Camera-ffmpeg",
            "plugin_map": {
                "plugin_name": "homebridge-camera-ffmpeg"
            },
            "name": "Camera FFmpeg",
            "cameras": [
                {
                    "name": "GateCam",
                    "manufacturer": "Wyze",
                    "model": "Wyzecam V2",
                    "folder": "/home/hoobs/cameras/gatecam",
                    "motion": true,
                    "motionTimeout": 0,
                    "videoConfig": {
                        "source": "-i rtsp://192.168.77.13:8554/unicast",
                        "stillImageSource": "-i rtsp://192.168.77.13:8554/unicast -vframes 1 -r 1",
                        "maxStreams": 2,
                        "maxWidth": 768,
                        "maxHeight": 432,
                        "maxFPS": 10,
                        "vcodec": "copy",
                        "audio": true,
                        "debug": false
                    }
                },
                {
                    "name": "StudyCam",
                    "manufacturer": "Wyze",
                    "model": "Wyzecam Pan",
                    "folder": "/home/hoobs/cameras/studycam",
                    "motion": true,
                    "motionTimeout": 0,
                    "videoConfig": {
                        "source": "-i rtsp://192.168.77.12:8554/unicast",
                        "stillImageSource": "-i rtsp://192.168.77.12:8554/unicast -vframes 1 -r 1",
                        "maxStreams": 2,
                        "maxWidth": 768,
                        "maxHeight": 432,
                        "maxFPS": 10,
                        "vcodec": "copy",
                        "audio": false,
                        "debug": false
                    }
                }
            ],
            "mqtt": "127.0.0.1",
            "portmqtt": 1883,
            "usermqtt": "mqtt-user",
            "passmqtt": "mqtt-password",
            "topic": "yonder-alerts",
            "porthttp": 8089,
            "interfaceName": "eth0"
        },
        {
            "platform": "dafangMqtt",
            "plugin_map": {
                "plugin_name": "homebridge-dafang-mqtt-republish"
            },
            "name": "Dafang MQTT",
            "server": "127.0.0.1",
            "port": 1883,
            "homebridge_topic": "yonder-alerts",
            "cameras": [
                {
                    "name": "GateCam",
                    "dafang_topic": "yonder-alerts/gatecam",
                    "cooldown": 10,
                    "accessories": {
                        "recording": true,
                        "snapshot": true,
                        "reboot": true
                    }
                },
                {
                    "name": "StudyCam",
                    "dafang_topic": "yonder-alerts/studycam",
                    "cooldown": 10,
                    "accessories": {
                        "recording": true,
                        "snapshot": true,
                        "reboot": true,
                        "motorsVertical": true,
                        "motorsHorizontal": true
                    }
                }
            ]
        }

from homebridge-dafang.

jlg89 avatar jlg89 commented on May 24, 2024

This is an educated guess, so someone please correct me if I'm wrong. The "normal" motion sensor is associated with the camera itself, and is listed as an accessory of the camera (as you noted). The rich motion sensor triggers off of the normal motion sensor & adds the rich message content. So it's more of an "add-on" rather than a replacement sensor. It's not the "cleanest" setup, but it works.

from homebridge-dafang.

DietShasta avatar DietShasta commented on May 24, 2024

That definitely makes sense, except what I've noticed is that you don't even need to activate richmotionsensor in the config.json file to get rich notifications. The normal motion sensor works without it. I've excluded richmotionsensor from my config file. The part that slightly annoys me is that the normal motion sensor is given an odd name by default in the home app, "Motion ServiceHome/Living" for instance. You can easily rename it in the Home app, but still.

from homebridge-dafang.

DietShasta avatar DietShasta commented on May 24, 2024

I forgot to mention that I've excluded BOTH motionsensor and richmotionsensor from my config file and the oddly named motion sensor still shows as an accessory for the camera. That's the motion sensor I use for getting the rich notifications.

from homebridge-dafang.

jlg89 avatar jlg89 commented on May 24, 2024

If you exclude all motion sensor accessories from the plugin config, the motion sensor still shows up, but in its settings in the Home app, there's only a "Status" option, rather than "Status and Notifications." In this setup, the sensor can be used to trigger automations, but you can't "Enable notifications on this device."

from homebridge-dafang.

DietShasta avatar DietShasta commented on May 24, 2024

Yes, when I view the camera's phantom motion sensor setting, it only shows status. But, in the camera's settings, there is a notification settings, and in there if I turn on "Notifications on This iPhone", I will get rich notifications when the camera's phantom motion sensor detects motion, at least I think it's using the phantom motion sensor.

So normally rich notifications would be set up in the motion sensor and not in the camera even though it also works from the camera? Very confusing.

from homebridge-dafang.

jlg89 avatar jlg89 commented on May 24, 2024

I agree, this is a confusing issue. I guess I'd rather have too many than not enough, but still...

from homebridge-dafang.

jlg89 avatar jlg89 commented on May 24, 2024

The camera's motion sensor doesn't seem to have a "debounce" setting on the camera itself, so the plugin motion sensor "threshold" setting gives you additional control over multiple rapid motion events. That's one advantage to using the plugin for motion notifications vs. the camera.

from homebridge-dafang.

DietShasta avatar DietShasta commented on May 24, 2024

I just now reactivated richMotionSensor and started testing it with a threshold of 60000ms. This motion sensor is only available outside of the camera. I then turned on the notification straight from this sensor.

  1. The threshold works as expected. It notifies the second it senses motion and does not send a notification if it senses anything for the next 60000ms.
  2. There is no rich notification! It's just a standard text notification (with no picture).
  3. Setting the notification from the accessory motion sensor (the one with the odd name) within the camera does still send rich notifications (with picture), but there is no threshold, so it sends notifications with every motion.

Lastly, I added both normal motionSensor and richMotionSensor to the configuration. It looks the same as when I set the configuration without the normal motionSensor. I couldn't find it anywhere in the home app.

I'm curious how you were able to get the thresholds to work with your rich motion sensor and still receive rich notifications.

from homebridge-dafang.

jlg89 avatar jlg89 commented on May 24, 2024

My understanding is that this plugin does pretty much everything via MQTT, so on the camera I enable "Motion - MQTT Message" and "Motion - MQTT Video" although I only ever seem to get a snapshot of what the camera sees when it detects motion. What I really want is a rich notification that includes a video snippet of the motion, but I haven't figured out how to make that happen yet, whether with homebridge-dafang or homebridge-camera-ffmpeg + homebridge-dafang-mqtt-republish.

from homebridge-dafang.

DietShasta avatar DietShasta commented on May 24, 2024

I'm using homebridge-camera-ffmpeg currently for a d-link ip camera, but briefly tested homebridge-dafang-mqtt-republish to replace homebridge-dafang, but went back to homebridge-dafang for one reason as far I can remember.

I couldn't get homebridge-dafang-mqtt-republish or even dafang hacks to record video to my desktop computer directly in a decent format. homebridge-dafang-mqtt-republish only communicates dafang's mqtt and doesn't do any type recompressing of video or whatever like homebridge-dafang does. It's interesting because I looked into trying to get dafang hacks to do it, but in one of the config files, it mentioned the best it could do is save 1 fps into a video file and they were also unnecessarily large in file size. How is homebridge-dafang able to do it?

I should probably revisit homebridge-dafang-mqtt-republish and homebridge camera ffmpeg for my dafang wyze cameras because eventually I'd like to to do two way audio and that will probably never be completed in homebridge-dafang.

from homebridge-dafang.

jlg89 avatar jlg89 commented on May 24, 2024

I haven't been able to get video recording to work properly in any configuration, but I haven't even been able to get reliable video & audio from homebridge-dafang. I have other cameras too, some non-dafang, so I have to run homebridge-camera-ffmpeg anyway, and it is definitely better at handling basic video & audio than homebridge-dafang. Plus the homebridge-dafang-mqtt-republish dev is super responsive, so I think that's where I'll throw my efforts, such as they are.

from homebridge-dafang.

DietShasta avatar DietShasta commented on May 24, 2024

I was able to configure both plugins to stream video well, but I think it's mainly because I configured the video to be super small directly in dafangs. 1280 x 720, 15fps, and 299kbps bitrate.

One thing regarding the video recordings, there is a bit of a delay before an image displays in the recording. It's black for a few seconds, but other than that, it works.

Were you able to get two way audio to work?

from homebridge-dafang.

jlg89 avatar jlg89 commented on May 24, 2024

Never been able to get two-way audio, but I get reliable one-way audio with homebridge-camera-ffmpeg.

I can use the MQTT switch to store video recordings on the camera, in h264 format, and they're reasonably good quality although slightly slo-mo. Have you figured a way to access video recordings from the Home app?

from homebridge-dafang.

DietShasta avatar DietShasta commented on May 24, 2024

I could not access video recordings from Home app. In fact I'm not even sure how to get back to the snapshots that are taken from rich notifications after I've closed them.

With my homebridge-dafangs, I have video recordings and captured images saved to a folder on my Mac that happens to be on icloud. So when I want to look at the videos from my iphone, I go into the files app and view them. I have a problem with recordings saved to the camera's sd card. First it's on the camera, so if a burglar steals the camera, the recordings are gone too. Also, at least for me, it's a pain even getting to the files. FTP freezes up and going to the web ui is also somewhat frustrating.

from homebridge-dafang.

sahilchaddha avatar sahilchaddha commented on May 24, 2024

I agree that ffmpeg implementation of homebridge-dafang is quite buggy. Honestly i want to remove the video streaming feature from this plugin and advice to use homebridge-camera-ffmpeg since its quite stable. I am already planning a small roadmap for this plugin to fix all the issues with some new features hopefully.

from homebridge-dafang.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.