GithubHelp home page GithubHelp logo

Comments (13)

philipsaad avatar philipsaad commented on June 1, 2024

Can you paste your config?

from homebridge-unifi-protect.

hansvangent avatar hansvangent commented on June 1, 2024

Sure thing:

 {
    "server": {
        "port": 1234,
        "origin": "*",
        "autostart": 0,
        "home_setup_id": "X-HM://00XXXXXXXXXXX",
        "polling_seconds": 5
    },
    "client": {
        "default_route": "status",
        "inactive_logoff": 30,
        "theme": "hoobs-dark",
        "locale": "en",
        "temp_units": "celsius",
        "country_code": "BE",
        "postal_code": "1000"
    },
    "bridge": {
        "name": "HOOBS",
        "port": 51826,
        "pin": "000-00-000",
        "username": “XX:XX:XX:XX:XX:XX”
    },
    "description": "",
    "ports": {},
    "accessories": [],
    "platforms": [
        {
            "platform": "Camera-UniFi-Protect",
            "plugin_map": {
                "plugin_name": "homebridge-unifi-protect2"
            },
            "name": "UniFi Protect",
            "controllers": [
                {
                    "platform": "Camera-UniFi-Protect",
                    "name": "G4 Pro",
                    "controllers": [
                        {
                            "url": "https://192.168.1.10:7443",
                            "username": "homebridge",
                            "password": "PASSWORD"
                        }
                    ]
                }
            ],
            "videoProcessor": "ffmpeg",
            "debugProtect": false,
            "videoConfig": {
                "sourcePrefix": "-re -rtsp_transport tcp",
                "additionalCommandline": "-preset slow -profile:v high -level 4.2 -x264-params intra-refresh=1:bframes=0",
                "mapaudio": "0:0",
                "mapvideo": "0:1",
                "maxStreams": 4,
                "maxWidth": 1920,
                "maxHeight": 1080,
                "maxFPS": 20,
                "packetSize": 564,
                "audio": false
            }
        }
    ]
}

from homebridge-unifi-protect.

philipsaad avatar philipsaad commented on June 1, 2024

First, are you sure ffmpeg is available in your PATH? When you run ffmpeg from a terminal or ssh, does it work?

Secondly, I would delete the entire videoConfig section, it is totally optional to get a basic working stream and is only needed to fine tune things.

Try both of those things and let us know if it is still happening.

from homebridge-unifi-protect.

hansvangent avatar hansvangent commented on June 1, 2024

So only keep it like this? ffmpeg is in my path, I can execute it from any user on the system

 {
    "server": {
        "port": 1234,
        "origin": "*",
        "autostart": 0,
        "home_setup_id": "X-HM://00XXXXXXXXXXX",
        "polling_seconds": 5
    },
    "client": {
        "default_route": "status",
        "inactive_logoff": 30,
        "theme": "hoobs-dark",
        "locale": "en",
        "temp_units": "celsius",
        "country_code": "BE",
        "postal_code": "1000"
    },
    "bridge": {
        "name": "HOOBS",
        "port": 51826,
        "pin": "000-00-000",
        "username": "XX:XX:XX:XX:XX:XX"
    },
    "description": "",
    "ports": {},
    "accessories": [],
    "platforms": [
        {
            "platform": "Camera-UniFi-Protect",
            "plugin_map": {
                "plugin_name": "homebridge-unifi-protect2"
            },
            "name": "UniFi Protect",
            "controllers": [
                {
                    "platform": "Camera-UniFi-Protect",
                    "name": "G4 Pro attic above kitchen",
                    "controllers": [
                        {
                            "url": "https://192.168.1.10:7443",
                            "username": "homebridge",
                            "password": "PASSWORD"
                        }
                    ]
                }
            ]
        }
    ]
}

from homebridge-unifi-protect.

philipsaad avatar philipsaad commented on June 1, 2024

Yep, as long as that is valid json, it should work fine.

from homebridge-unifi-protect.

hansvangent avatar hansvangent commented on June 1, 2024

yeah the json is valid but homebridge still won't start :-/

from homebridge-unifi-protect.

hansvangent avatar hansvangent commented on June 1, 2024

Why did you close it? As the json is valid but Homebridge won't start...this is literally the only plugin I have in my Homebridge, would be eager to have it fixed :-)

from homebridge-unifi-protect.

hjdhjd avatar hjdhjd commented on June 1, 2024

@jcvangent I closed it because it's 2+ weeks old and either is abandoned or resolved. 😄

If you're still having this issue...let's try a few things:

  1. Are you on a clean install?
  2. What is your UniFi Protect setup? Are you using a Cloud Key Gen2+, UDM-Pro, or UNVR4?
  3. Post the relevant portion (not the entire file please) of your config.json that shows the configuration settings for this plugin.

Thanks!

from homebridge-unifi-protect.

hansvangent avatar hansvangent commented on June 1, 2024

I'm having a Cloud Key Gen2 (with HDD) that is running my Unifi Protect setup and a Raspberry Pi 3 model B+ running HOOBS (https://hoobs.org/).

It is a completely clean install, nothing else. I installed the plugin into my HOOBS (Homebridge setup) and it is the only plugin installed. Without the plugin, Homebridge starts, when I enable the plugin Homebridge won't start.

The entire config was posted already earlier, but I guess the only relevant part would be this part?

    "plugins": [
        "homebridge-unifi-protect2"
    ],
    "accessories": [],
    "platforms": [
        {
            "platform": "Camera-UniFi-Protect",
            "plugin_map": {
                "plugin_name": "homebridge-unifi-protect2"
            },
            "name": "UniFi Protect",
            "controllers": [
                {
                    "platform": "Camera-UniFi-Protect",
                    "name": "G4 Pro attic above kitchen",
                    "controllers": [
                        {
                            "url": "https://192.168.1.10:7443",
                            "username": "homebridge",
                            "password": "PASSWORD"
                        }
                    ]
                }
            ]
        }
    ],

Oh and the logfile of Homebridge with the error is in my first post, but let me put it here for convenience as well:

15/06/2020, 21:01:46 Loaded plugin "homebridge-unifi-protect2".
15/06/2020, 21:01:46 TypeError: Cannot read property 'replace' of undefined
    at getUnifiAuthConfig (/home/hoobs/.hoobs/node_modules/homebridge-unifi-protect2/index.js:34:56)
    at /home/hoobs/.hoobs/node_modules/homebridge-unifi-protect2/index.js:159:14
    at Array.map (<anonymous>)
    at unifiPlatform.didFinishLaunching (/home/hoobs/.hoobs/node_modules/homebridge-unifi-protect2/index.js:158:32)
    at API.emit (events.js:210:5)
    at Server.run (/usr/local/lib/node_modules/@hoobs/hoobs/bridge/server.js:104:18)
    at module.exports (/usr/local/lib/node_modules/@hoobs/hoobs/bridge/cli.js:84:12)
    at Object.<anonymous> (/usr/local/lib/node_modules/@hoobs/hoobs/bin/hoobs:95:81)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
    at internal/main/run_main_module.js:17:11
15/06/2020, 21:01:46 Bridge is running on port 51826.
15/06/2020, 21:01:46 Got SIGTERM, shutting down Bridge...

from homebridge-unifi-protect.

hansvangent avatar hansvangent commented on June 1, 2024

It seems to be related to this part of the code, or at least the first error:

function getUnifiAuthConfig(controllerConfig, log, debugProtect) {
  // Cleanup some common URL issues - eliminate multiple slashes and trailing slashes.
  controllerConfig.url = 'https://' + controllerConfig.url
                                                      .replace(/^https\:\/\//, '') // Remove the leading "https://" for now.
                                                      .replace(/\/+/g, '/') // Replace consecutive slashes with a single slash.
                                                      .replace(/\/+$/, ''); // Remove trailing slashes.

from homebridge-unifi-protect.

hjdhjd avatar hjdhjd commented on June 1, 2024

@jcvangent It's not an issue in the code. The issue is in your config.json. If you read through the README carefully, you should find additional examples of what this should look like.

Here's a corrected version:

    "platforms": [
        {
            "platform": "Camera-UniFi-Protect",
            "name": "UniFi Protect",

            "controllers": [
                {
                  "url": "https://192.168.1.10:7443",
                  "username": "homebridge",
                  "password": "PASSWORD"
                }
             ]
        }
    ],

from homebridge-unifi-protect.

hansvangent avatar hansvangent commented on June 1, 2024

Okay weird, sorry for this now it starts indeed, I thought I took the example correctly and edited where needed.

Thanks a lot and now it can indeed be properly closed :-)

from homebridge-unifi-protect.

github-actions avatar github-actions commented on June 1, 2024

This issue is locked to prevent necroposting on closed issues. Please create a new issue for related support requests, bug reports, or feature suggestions.

from homebridge-unifi-protect.

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.