Closed nordblick2 closed 7 years ago
Hi,
Plugin-2.0 branch is still in development but basic functions should work now...
I know its a dev-branch. ;) Just saw a lot of changes in Plugin-2.0 and decided to use that branch for additional stuff. Maybe i should switch back .... i'll think about....
However for the moment:. I just cloned the dev-branch again and it crashed exactly on that point i mentioned (now: line 781 in the freshly cloned index.js). Seems that primaryservice.getCharacteristic(EveAirPressure) didn't return anything. And for some reason no accessory is found. I would expect at least the one....
[1/19/2017, 11:33:23 PM] [Domotiga] Initializing DomotiGa platform... [1/19/2017, 11:33:23 PM] Loading 0 accessories... /usr/local/lib/node_modules/homebridge-domotiga/index.js:781 .on('get', this.getCurrentAirPressure.bind(this, accessory.context));
The config (the platform part) looks this way (the endpoint, file fields are the part i am working on and should hopefully not the reason).
{
"platform": "DomotiGa",
"name": "Domotiga",
"endpoint":"https://server:1234/api.foo",
"devices": [
{
"name": "Gartensensor",
"service": "TemperatureSensor",
"manufacturer": "me, myself and i",
"model": "SensorNode v5",
"device": "garten",
"file":"/tmp/data/garten.json",
"valueTemperature": "garten.t",
"valueHumidity": "garten.h",
"valueAirPressure": "garten.p",
"valueBattery": "garten.vcc",
"lowbattery": "3000"
}
]
}
I will have a look at it. If you like to add stuff this branch is ok because I will commit it into master soon. Dynamic accessories of plugin 2 are a big improvement. Until now tempsensor/airqualitysensor and switches are tested and working. The rest will follow. Feel free to post any issues here :-)
Fixed (finally)
Hey Samfox2, using last committed code from Plugin-2.0 branch i run into some problems on startup (see listing below). I did a first review already, but wasn't able to locate the underlying problem.
Please note, that my line numbers differs. I'm preparing some general features (as you requested in your README.md) for getting/setting values via command execution and file interface that are - hopefully - not the underlying problem. ;)
However here is the trace: [1/19/2017, 9:17:54 PM] [Domotiga] Setting up: TemperatureSensor /usr/local/lib/node_modules/homebridge-domotiga/index.js:804 .on('get', this.getCurrentAirPressure.bind(this, accessory.context)); ^
TypeError: Cannot read property 'on' of undefined at DomotigaPlatform.setService (/usr/local/lib/node_modules/homebridge-domotiga/index.js:804:13) at DomotigaPlatform.configureAccessory (/usr/local/lib/node_modules/homebridge-domotiga/index.js:160:10) at Server._configCachedPlatformAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:342:24) at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:83:8) at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:40:10) at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)