Samfox2/homebridge-domotiga

error when starting with new version

Closed this issue · 1 comments

Hi,

I've updated homebridge and the homebridge-domotiga to there latest version and created a new config.json.

` {
"bridge": {
"name": "HomebridgePI",
"username": "CC:23:3D:E3:CE:30",
"port": 51826,
"pin": "031-45-156"
},

"description": "DomotiGa HomeKit enabler",

"platforms": [
    {
        "platform": "DomotiGa",
        "name": "DomotiGa",
        "host": "172.16.31.46",
        "port": "9090",
        "devices": [
            {
                "name": "Lamp",
                "service": "Contact",
                "device": "29",
                "valueContact": "1",
          	    "valueBattery": "2",
                "lowbattery": "3000"
            }
        ]
    }
],

"accessories": [ ]

}`

but getting error like this, something to do with:
/usr/lib/node_modules/homebridge-domotiga/index.js:865 .on('get', this.getCurrentAirPressure.bind(this, accessory.context));

[4/28/2017, 10:58:03 AM] Registering platform 'homebridge-domotiga.DomotiGa'
[4/28/2017, 10:58:03 AM] ---
[4/28/2017, 10:58:03 AM] Loaded config.json with 0 accessories and 1 platforms.
[4/28/2017, 10:58:03 AM] ---
[4/28/2017, 10:58:03 AM] Loading 1 platforms...
[4/28/2017, 10:58:03 AM] [DomotiGa] Initializing DomotiGa platform...
[4/28/2017, 10:58:03 AM] [DomotiGa] DomotiGa Plugin Version 0.0.20
[4/28/2017, 10:58:03 AM] [DomotiGa] Plugin by Samfox2 https://github.com/samfox2
[4/28/2017, 10:58:03 AM] [DomotiGa] DomotiGa is a Open Source Home Automation Software for Linux
[4/28/2017, 10:58:03 AM] [DomotiGa] Please report any issues to https://github.com/samfox2/homebridge-domotiga/issues
[4/28/2017, 10:58:03 AM] Loading 0 accessories...
/usr/lib/node_modules/homebridge-domotiga/index.js:865
.on('get', this.getCurrentAirPressure.bind(this, accessory.context));
^

TypeError: Cannot read property 'on' of undefined
at DomotigaPlatform.setService (/usr/lib/node_modules/homebridge-domotiga/index.js:865:17)
at DomotigaPlatform.configureAccessory (/usr/lib/node_modules/homebridge-domotiga/index.js:163:10)
at Server._configCachedPlatformAccessories (/usr/lib/node_modules/homebridge/lib/server.js:342:24)
at Server.run (/usr/lib/node_modules/homebridge/lib/server.js:83:8)
at module.exports (/usr/lib/node_modules/homebridge/lib/cli.js:40:10)
at Object. (/usr/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)

tried other devices as well but alway com back with the error on line 865.

what to do?

Fixed (finally)