Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two richmotionsensors showing in home app #65

Open
DietShasta opened this issue Aug 30, 2020 · 16 comments
Open

Two richmotionsensors showing in home app #65

DietShasta opened this issue Aug 30, 2020 · 16 comments

Comments

@DietShasta
Copy link

I'm not sure if this plugin has been abandoned, but I've run into something that I don't think I've noticed before.

When I activate the richmotionsensor in the config file, in the home app displays the sensor as a separate sensor instead of an accessory within the camera settings (in Home app). Within the camera settings, I see a richmotionsensor labeled Motion ServiceHome/Living (Home/Living is my mqtt topic). Incidentally, when I don't activate the richmotionsensor in homebridge config, the Motion ServiceHome/Living motion sensor still displays as an accessory for the camera.

Also the two sensors activity seem to mirror each other.

Does anyone know how to get rid of the extra sensor?

Thank you!

@jlg89
Copy link

jlg89 commented Sep 22, 2020

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.

@DietShasta
Copy link
Author

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.

@DietShasta
Copy link
Author

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.

@jlg89
Copy link

jlg89 commented Sep 22, 2020

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."

@DietShasta
Copy link
Author

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.

@jlg89
Copy link

jlg89 commented Sep 22, 2020

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

@jlg89
Copy link

jlg89 commented Sep 23, 2020

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.

@jlg89
Copy link

jlg89 commented Sep 23, 2020

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
                    }
                }
            ]
        }

@DietShasta
Copy link
Author

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.

@jlg89
Copy link

jlg89 commented Sep 23, 2020

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.

@DietShasta
Copy link
Author

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.

@jlg89
Copy link

jlg89 commented Sep 23, 2020

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.

@DietShasta
Copy link
Author

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?

@jlg89
Copy link

jlg89 commented Sep 23, 2020

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?

@DietShasta
Copy link
Author

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.

@sahilchaddha
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants