@thex said in New pimatic tradfri plugin / IKEA Smart Lights:
Thanks for the plug-in!
Just made a pull request to make the lights ready for pimatic-hap integration.
I also created a pull request for the needed pimatic-hap changes. works fine here.
In general I found that the Tradfri system is still less stable and slower than HUE although they are based on the same technology. I hope this will be improved with future updates.
Is this working already? When I try to switch a group (the only thing that shows up in the Home app), pimatic crashes. The bulbs don’t show up in Home app despite the HAP properties are set for them.
17:46:19.229 [pimatic] An uncaught exception occurred: TypeError: promise.then(...).catch(...).done is not a function
17:46:19.229 [pimatic]> at PowerSwitchAccessory.BaseAccessory.handleVoidPromise (/home/pi/pimatic-app/node_modules/pimatic-hap/accessories/base.coffee:46:10)
17:46:19.229 [pimatic]> at PowerSwitchAccessory.handleVoidPromise (/home/pi/pimatic-app/node_modules/pimatic-hap/accessories/base.coffee:1:1)
17:46:19.229 [pimatic]> at null.<anonymous> (/home/pi/pimatic-app/node_modules/pimatic-hap/accessories/switch.coffee:35:12)
17:46:19.229 [pimatic]> at emitMany (events.js:108:13)
17:46:19.229 [pimatic]> at null.emit (events.js:182:7)
17:46:19.229 [pimatic]> at null.Characteristic.setValue (/home/pi/pimatic-app/node_modules/pimatic-hap/node_modules/hap-nodejs/lib/Characteristic.js:155:10)
17:46:19.229 [pimatic]> at Bridge.<anonymous> (/home/pi/pimatic-app/node_modules/pimatic-hap/node_modules/hap-nodejs/lib/Accessory.js:740:22)
17:46:19.229 [pimatic]> at Array.forEach (native)
17:46:19.229 [pimatic]> at Bridge.Accessory._handleSetCharacteristics (/home/pi/pimatic-app/node_modules/pimatic-hap/node_modules/hap-nodejs/lib/Accessory.js:685:8)
17:46:19.229 [pimatic]> at emitMany (events.js:108:13)
17:46:19.229 [pimatic]> at HAPServer.emit (events.js:182:7)
17:46:19.229 [pimatic]> at HAPServer._handleCharacteristics (/home/pi/pimatic-app/node_modules/pimatic-hap/node_modules/hap-nodejs/lib/HAPServer.js:972:10)
17:46:19.229 [pimatic]> at HAPServer.<anonymous> (/home/pi/pimatic-app/node_modules/pimatic-hap/node_modules/hap-nodejs/lib/HAPServer.js:209:39)
17:46:19.229 [pimatic]> at emitNone (events.js:67:13)
17:46:19.229 [pimatic]> at IncomingMessage.emit (events.js:166:7)
17:46:19.229 [pimatic]> at endReadableNT (_stream_readable.js:913:12)
17:46:19.229 [pimatic]> at nextTickCallbackWith2Args (node.js:442:9)
17:46:19.229 [pimatic]> at process._tickCallback (node.js:356:17)
17:46:19.229 [pimatic]> This is most probably a bug in pimatic or in a module, please report it!
17:46:19.247 [pimatic] shutting pimatic down...
/home/pi/pimatic-app/node_modules/pimatic/startup.coffee:98
return framework.destroy().then(function() {
^
ReferenceError: framework is not defined
at process.uncaughtException (/home/pi/pimatic-app/node_modules/pimatic/startup.coffee:85:9)
at emitOne (events.js:77:13)
at process.emit (events.js:169:7)
at process._fatalException (node.js:224:26)
EDIT: following this pull request, by adding these two lines you can see the bulbs in the Homekit app, they work fine 
Also: It would be nice if it is be possible to flash the bulbs once, e.g. when a presence sensor is triggered.