Closed haen7 closed 3 years ago
Please post the entire config.json here and omit sensitive information.
After I upgraded Homebridge Config UI X
to v4.24.0 (latest version) I got this error:
ERROR LOADING PLUGIN homebridge-hc-sr501:
Error: Cannot find module 'hap-nodejs'
Require stack:
- /usr/local/lib/node_modules/homebridge-hc-sr501/dist/index.js
- /usr/local/lib/node_modules/homebridge/lib/plugin.js
- /usr/local/lib/node_modules/homebridge/lib/pluginManager.js
- /usr/local/lib/node_modules/homebridge/lib/api.js
- /usr/local/lib/node_modules/homebridge/lib/server.js
- /usr/local/lib/node_modules/homebridge/lib/cli.js
- /usr/local/lib/node_modules/homebridge/bin/homebridge
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:962:15)
at Function.Module._load (internal/modules/cjs/loader.js:838:27)
at Module.require (internal/modules/cjs/loader.js:1022:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/usr/local/lib/node_modules/homebridge-hc-sr501/dist/index.js:3:22)
at Module._compile (internal/modules/cjs/loader.js:1118:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1138:10)
at Module.load (internal/modules/cjs/loader.js:982:32)
at Function.Module._load (internal/modules/cjs/loader.js:875:14)
at Module.require (internal/modules/cjs/loader.js:1022:19)
so I installed hap-nodejs
and now here is the new error:
Error: Cannot add a Characteristic with the same UUID as another Characteristic in this Service: 00000023-0000-1000-8000-0026BB765291
at AccessoryInformation.Service._this.addCharacteristic (/usr/local/lib/node_modules/hap-nodejs/src/lib/Service.ts:194:15)
at new AccessoryInformation (/usr/local/lib/node_modules/hap-nodejs/src/lib/gen/HomeKit.ts:4140:10)
at new HomebridgeSR501Sensor (/usr/local/lib/node_modules/homebridge-hc-sr501/dist/index.js:19:35)
at /usr/local/lib/node_modules/homebridge/src/server.ts:357:50
at Array.forEach (<anonymous>)
at Server._loadAccessories (/usr/local/lib/node_modules/homebridge/src/server.ts:330:29)
at Server.start (/usr/local/lib/node_modules/homebridge/src/server.ts:156:12)
at cli (/usr/local/lib/node_modules/homebridge/src/cli.ts:80:10)
at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (internal/modules/cjs/loader.js:1118:30)
My config:
{
"bridge": {
"name": "Homebridge",
"username": "XX:XX:XX:XX:XX:XX",
"port": 51826,
"pin": "xxx-xx-xxx"
},
"description": "Homebridge",
"accessories": [
{
"accessory": "Relay",
"name": "Relay-1",
"pin": 11,
"invert": true,
"default_state": false
},
{
"accessory": "Relay",
"name": "Relay-2",
"invert": true,
"default_state": false,
"pin": 13
},
{
"accessory": "Relay",
"name": "Relay-3",
"invert": true,
"default_state": false,
"pin": 15
},
{
"accessory": "Relay",
"name": "Relay-4",
"invert": true,
"default_state": false,
"pin": 31
},
{
"accessory": "Dht",
"name": "dht22",
"name_temperature": "Temperature",
"name_humidity": "Humidity",
"service": "dht22"
},
{
"accessory": "HC-SR501",
"name": "Motion Sensor",
"pinId": 24
}
],
"platforms": [
{
"name": "Config",
"port": 8080,
"auth": "form",
"theme": "auto",
"tempUnits": "c",
"lang": "auto",
"sudo": true,
"ssl": {
"pfx": "/var/lib/homebridge/ssl/homebridge.pfx",
"passphrase": ""
},
"platform": "config"
}
]
}
Alright, the hap-nodejs bug should be fixed with version 1.0.6. Thank you for reporting this bug! Could please have a look at that new version?
Version 1.0.6 fixed The hap-nodejs error but I still get Cannot add a Characteristic
error.
Alright. Seems like they changed the way services work. This new version seems to work for me, can you give it a try?
Great, It works perfectly with hc-sr505 PIR sensor.
Thanks!
Glad I could help :)
Hi, I installed the plugin using this command:
sudo npm install -g --unsafe-perm homebridge-hc-sr501
but Homebridge can not find the plugin. here is the log from Homebridge: