ebaauw / homebridge-hue

Homebridge plugin for Philips Hue
Apache License 2.0
894 stars 91 forks source link

No devices showing up at all #1183

Closed dbartholomae closed 4 months ago

dbartholomae commented 4 months ago

Issue

I'm trying to get the plugin to work to connect my Hue Tap Dial Switch so that I can control the volume of my sound system via the dial. I've installed the plugin and it seems to connect correctly (I can see the dial in the dump file), but I can't see any (!) Hue devices being added to Homebridge. I've disabled nativeHomeKitSensors, and have no other ideas where to look. I also didn't find a way to enable additional logs.

I'm kinda clueless whether I just missed something in the docs (if I did, I'm happy to provide a PR to make it easier to see what needs to be done for initial setup).

Any clues what might be going on here?

Log Messages

[3/2/2024, 12:03:26 AM] [Hue] Initializing Hue platform...
[3/2/2024, 12:03:26 AM] [Hue] homebridge-hue v0.13.70, node v20.9.0, homebridge v1.7.0
[3/2/2024, 12:03:26 AM] [Hue] warning: recommended version: node v20.10.0 LTS
[3/2/2024, 12:03:26 AM] [Hue] searching bridges and gateways
[3/2/2024, 12:03:26 AM] Loading 2 accessories...
[3/2/2024, 12:03:32 AM] [Hue] meethue.com: request 1: GET /
[3/2/2024, 12:03:32 AM] [Hue] meethue.com: request 1: timeout after 5 seconds
[3/2/2024, 12:03:32 AM] [Hue] phoscon.de: request 1: GET /
[3/2/2024, 12:03:32 AM] [Hue] phoscon.de: request 1: timeout after 5 seconds
[3/2/2024, 12:03:32 AM] [Hue] no bridges or gateways found - retrying in 30s
[3/2/2024, 12:04:07 AM] [Hue] searching bridges and gateways
[3/2/2024, 12:04:12 AM] [Hue] Hue Bridge: Signify Netherlands B.V. BSB002 bridge v1962154010, api v1.62.0
[3/2/2024, 12:04:12 AM] [Hue] Hue Bridge: warning: not using recommended Hue bridge api version 1.61.0
[3/2/2024, 12:04:13 AM] [Hue] Hue Bridge: 1 accessories
[3/2/2024, 12:04:13 AM] [Hue] masked debug info dumped to /volume3/homebridge/homebridge-hue.json.gz
[3/2/2024, 12:04:13 AM] Initializing platform accessory 'Hue Bridge'...
[3/2/2024, 12:04:13 AM] [Hue] Hue Bridge: 2 services
Setup Payload:
X-HM://00249LQX04V3U
Enter this code with your HomeKit app on your iOS device to pair with Homebridge:

    ┌────────────┐     
    │ 481-57-828 │     
    └────────────┘     

[3/2/2024, 12:04:13 AM] Homebridge v1.7.0 (HAP v0.11.1) (Homebridge 5391) is running on port 51235.
Failed to create listener for avahi-daemon server state. The system will not be notified about restarts of avahi-daemon and will therefore stay undiscoverable in those instances. Error message: Error: No such interface found
[3/2/2024, 12:04:13 AM] [Hue] Hue Bridge: event stream connected to https://192.168.178.7/eventstream/clip/v2
WARNING couldn't map socket coming from remote address ::ffff:169.254.130.79:55552     at local address ::ffff:169.254.130.79 to a interface!
[3/2/2024, 12:04:25 AM] [Hue] heartbeat 6, drift 5090
[3/2/2024, 12:04:25 AM] [Hue] heartbeat 7, drift 4147
[3/2/2024, 12:04:25 AM] [Hue] heartbeat 8, drift 3148
[3/2/2024, 12:04:25 AM] [Hue] heartbeat 9, drift 2153
[3/2/2024, 12:04:25 AM] [Hue] heartbeat 10, drift 1154
WARNING couldn't map socket coming from remote address ::ffff:169.254.130.79:55596     at local address ::ffff:169.254.130.79 to a interface!
WARNING couldn't map socket coming from remote address ::ffff:169.254.130.79:55620     at local address ::ffff:169.254.130.79 to a interface!
WARNING couldn't map socket coming from remote address ::ffff:169.254.130.79:55654     at local address ::ffff:169.254.130.79 to a interface!
WARNING couldn't map socket coming from remote address ::ffff:169.254.130.79:55656     at local address ::ffff:169.254.130.79 to a interface!
WARNING couldn't map socket coming from remote address ::ffff:169.254.130.79:55658     at local address ::ffff:169.254.130.79 to a interface!
WARNING couldn't map socket coming from remote address ::ffff:169.254.130.79:55660     at local address ::ffff:169.254.130.79 to a interface!
WARNING couldn't map socket coming from remote address ::ffff:169.254.130.79:55662     at local address ::ffff:169.254.130.79 to a interface!
[3/2/2024, 12:04:42 AM] [Hue] heartbeat 23, drift 5632
[3/2/2024, 12:04:42 AM] [Hue] heartbeat 24, drift 4678
[3/2/2024, 12:04:42 AM] [Hue] heartbeat 25, drift 3680
[3/2/2024, 12:04:42 AM] [Hue] heartbeat 26, drift 2681

Debug Files

Config:

  "config": {
    "name": "Hue",
    "anyOn": true,
    "effects": true,
    "nativeHomeKitLights": true,
    "nativeHomeKitSensors": false,
    "resource": true,
    "platform": "Hue",
    "users": {
      "001788FFFE27EE51": "***************************************1"
    }
  },

Excerpt from Dump file:

{
          "state": {
            "rotaryevent": 2,
            "expectedrotation": 15,
            "expectedeventduration": 400,
            "lastupdated": "2024-03-01T22:44:10"
          },
          "swupdate": {
            "state": "noupdates",
            "lastinstall": "2023-06-07T03:39:22"
          },
          "config": {
            "on": true,
            "battery": 100,
            "reachable": true,
            "pending": []
          },
          "name": "Hue tap dial switch",
          "type": "ZLLRelativeRotary",
          "modelid": "RDM002",
          "manufacturername": "Signify Netherlands B.V.",
          "productname": "Hue tap dial switch",
          "diversityid": "e5b68d4b-6249-436d-88c5-7e02ffabda37",
          "swversion": "2.59.25",
          "uniqueid": "00:17:88:01:0d:7c:bc:e0-01-fc00-0014",
          "capabilities": {
            "certified": true,
            "primary": true,
            "inputs": [
              {
                "repeatintervals": [
                  400
                ],
                "events": [
                  {
                    "rotaryevent": 1,
                    "eventtype": "start"
                  },
                  {
                    "rotaryevent": 2,
                    "eventtype": "repeat"
                  }
                ]
              }
            ]
          }
        }
ebaauw commented 4 months ago

You need to set sensors in config.json.

dbartholomae commented 4 months ago

Thanks. Not sure how I missed this after reading through https://github.com/ebaauw/homebridge-hue/wiki/Configuration three times.

I now get the following errors messages in the logs:

[3/2/2024, 12:22:39 PM] [Hue] TypeError: The "listener" argument must be of type function. Received an instance of Object
    at checkListener (node:events:274:3)
    at ClientRequest.once (node:events:648:3)
    at new ClientRequest (node:_http_client:239:10)
    at Object.request (node:https:378:10)
    at Object.request (/volume3/homebridge/node_modules/homebridge-broadband/node_modules/http-proxy-agent/node_modules/agent-base/patch-core.js:25:22)
    at /volume3/homebridge/node_modules/homebridge-hue/node_modules/hb-lib-tools/lib/HttpClient.js:361:34
    at new Promise (<anonymous>)
    at HttpClient.request (/volume3/homebridge/node_modules/homebridge-hue/node_modules/hb-lib-tools/lib/HttpClient.js:338:12)
    at HttpClient.get (/volume3/homebridge/node_modules/homebridge-hue/node_modules/hb-lib-tools/lib/HttpClient.js:277:17)
    at HuePlatform.accessories (/volume3/homebridge/node_modules/homebridge-hue/lib/HuePlatform.js:298:40)
[3/2/2024, 12:22:44 PM] [Hue] goodbye
[3/2/2024, 12:22:52 PM] [Hue] Initializing Hue platform...
[3/2/2024, 12:22:52 PM] [Hue] homebridge-hue v0.13.70, node v20.9.0, homebridge v1.7.0
[3/2/2024, 12:22:52 PM] [Hue] warning: recommended version: node v20.10.0 LTS
[3/2/2024, 12:22:52 PM] [Hue] searching bridges and gateways
[3/2/2024, 12:22:52 PM] Loading 3 accessories...
[3/2/2024, 12:22:58 PM] [Hue] TypeError: Cannot read properties of undefined (reading 'name')
    at HueDiscovery.<anonymous> (/volume3/homebridge/node_modules/homebridge-hue/lib/HuePlatform.js:185:62)
    at HueDiscovery.emit (node:events:514:28)
    at HueDiscovery._nupnp (/volume3/homebridge/node_modules/homebridge-hue/lib/HueDiscovery.js:263:12)
(node:22118) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 3)
(Use `node --trace-warnings ...` to show where the warning was created)

My new config is

{
    "name": "Hue",
    "anyOn": false,
    "effects": false,
    "nativeHomeKitLights": true,
    "nativeHomeKitSensors": false,
    "sensors": true,
    "resource": true,
    "platform": "Hue",
    "users": {
        "...": "..."
    }
}
dbartholomae commented 4 months ago

For documenting the sensors property, my suggestion would be to do the following edit in the wiki on https://github.com/ebaauw/homebridge-hue/wiki/Getting-Started

## 2. Sensors

You need to set `sensors` to `true` in your configuration if you want to use sensors or switches with this plugin. You might also need to set `nativeHomeKitSensors` to `false`, see the [configuration reference](https://github.com/ebaauw/homebridge-hue/wiki/Configuration) for more details. For each Hue bridge sensor, homebridge-hue creates a HomeKit accessory with the appropriate services and characteristics.

I also realised that, since the doc is in the wiki, I can't actually open a PR for this. But hopefully this snippet is also helpful :)

dbartholomae commented 4 months ago

The error above came from an interaction with Homebridge broadband and doesn't seem to be related to this plugin. After uninstalling the other plugin, this one now works flawlessly :) I'll still need to figure out how to actually increase volume when the dial is turned, but I don't think that this is plugin-specific either.

ebaauw commented 4 months ago

The error above came from an interaction with Homebridge broadband and doesn't seem to be related to this plugin.

Indeed, the http-proxy-agent package used by that plugin (and by some others) breaks https, see several closed issues.

I'll still need to figure out how to actually increase volume when the dial is turned

Homebridge Hue exposes the dial as two stateless programmable switches (buttons), left turn vs right turn. You can simply associate a HomeKit scene with the button actions. Ideally, you’d need a HomeKit enabled speaker that supports setting relative volume, like Volume Change in Homebridge ZP. Unfortunately, there’s no standard HomeKit feature for this.

dbartholomae commented 4 months ago

Thanks! I'll close this issue now, but please feel free to reach out if I can help in addition to the proposed wording: https://github.com/ebaauw/homebridge-hue/issues/1183#issuecomment-1974769975