AlexGustafsson / homebridge-wol

A Wake on Lan plugin for Homebridge
MIT License
301 stars 30 forks source link

Accessory registers (at least in the log) => does not show up in app #40

Closed kjb085 closed 6 years ago

kjb085 commented 6 years ago

Issue

I'm a little stumped here. I see the accessory get registered in the logs, but then I go in to the Home app (and a couple other HomeKit apps for posterity's sake) and I don't see any devices other than my Yeelight strip. Tried running sudo homebridge and still no dice.

My main concern is that I was kind of lazy when setting up what I have thus far and instead of installing the npm modules globally with a user with root access, I just ran sudo npm install -g [package]. I would assume that even if that was the issue that running sudo homebridge would likely fix the issue I'm seeing, but that's clearly not the case.

Environment

Configuration

My configuration looks like this:

{
    "bridge": {
        "name": "Homebridge",
        "username": "XX:XX:XX:XX:XX:XX",
        "port": 51826,
        "pin": "031-45-154"
    },

    // "description": "",

    "accessories": [
        {
                "accessory": "NetworkDevice",
                "name": "Magic Mirror",
                "mac": "XX:XX:XX:XX:XX:XX",
                "ip": "XXX.XXX.X.XXX",
                "wakeCommand": "sshpass -p '[password]' ssh -oStrictHostKeyChecking=no pi@[ip-address] xscreensaver-command -deactivate",
                "shutdownCommand": "sshpass -p '[password]' ssh -oStrictHostKeyChecking=no pi@[ip-address] xscreensaver-command -activate"
        }
    ],

    "platforms": [
        {
                "platform": "yeelight",
                "name": "Yeelight",
                "transitions": {
                        "power": 400,
                        "brightness": 400
                },
                "multicast": {
                        "interface": "0.0.0.0"
                }
        },
    ]
}

Log

I see this in the logs when I run homebridge:

[2018-5-20 21:17:25] Loaded plugin: homebridge-wol
[2018-5-20 21:17:25] Registering accessory 'homebridge-wol.NetworkDevice'
AlexGustafsson commented 6 years ago

It seems like you’ve covered just about all debugging steps. Your configuration seems to be correct. If installing packages with sudo npm install -g was an issue, homebridge would throw an error saying that there’s no package for NetworkDevice.

Could you run the debug step for homebridge and post the full log? I think it’s mentioned in the readme - along the lines of DEBUG=* sudo homebridge wol. Make sure to remove any personal information such as MACs.

kjb085 commented 6 years ago

So that alone did the trick for me. The issue was that I didn't have a config.json file in the /root/.homebridge/ directory and then on top of that the linter was complaining about my commented out lines. Strangely enough, homebridge only complains about parsing json with commented out lines for the root user, not sure why. Anyway, took care of both of those problems and now I see it in the Home app. Thanks!

AlexGustafsson commented 6 years ago

Good thing you solved it! Thank you for providing your solution. It helps when others face similar issues.