markbergsma / pimatic-hue-zll

Pimatic integration with Philips Hue (ZLL)
GNU General Public License v2.0
7 stars 4 forks source link

After clean install Unhandled rejection Type Error #24

Closed quintz closed 4 years ago

quintz commented 4 years ago

Hi Guys,

I just did a clean reinstall of my pimatic and now I get this error after I entered my hue user login credentials into the plugin config:

Unhandled rejection TypeError: hueapi.HueApi is not a function at Object.initHueApi (/home/pi/pimatic-app/node_modules/pimatic-hue-zll/hue.coffee:77:21) at HueZLLPlugin.initApi (/home/pi/pimatic-app/node_modules/pimatic-hue-zll/hue-zll.coffee:155:25) at /home/pi/pimatic-app/node_modules/pimatic-hue-zll/hue-zll.coffee:3:1 at tryCatcher (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/util.js:16:23) at Promise._settlePromiseFromHandler (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:517:31) at Promise._settlePromise (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:574:18) at Promise._settlePromiseCtx (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:611:10) at _drainQueueStep (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/async.js:142:12) at _drainQueue (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/async.js:131:9) at Async._drainQueues (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/async.js:147:5) at Immediate.Async.drainQueues [as _onImmediate] (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/async.js:17:14) at runCallback (timers.js:705:18) at tryOnImmediate (timers.js:676:5) at processImmediate (timers.js:658:5)

Any ideas?

djmvt commented 4 years ago

There's an issue with this plugin that hasn't been fixed yet. You can fix it by editing some stuff. This is a direct copy from the pimatic forum that is working:

The instructions in the case you can update

go to commandline mode type ‘sudo service pimatic stop’ goto the pimatic-zll-hue directory (mostly /home/pi/pimatic-app/node_modules/pimatic-hue-zll’) edit package.json and change the following line: "node-hue-api": ">=2.2.0", to

"node-hue-api": "2.4.4",

save and exit the editor type ‘rm -rf node_modules’ type 'npm install type 'sudo service pimatic start’ Now you have reinstalled the node modules of the plugin with the older version of node-hue-api.

Thanks to user @bertreb

djmvt commented 4 years ago

@markbergsma can you fix this issue?

quintz commented 4 years ago

All fixed, thanks so much @djmvt :-)

markbergsma commented 4 years ago

@markbergsma can you fix this issue?

I'm afraid not... I haven't had a working Pimatic installation in the past two years or so. As Pimatic development has slowed down a lot in the past few years to the point of being hardly maintained, I don't really want to invest my (scarce!) free time on it anymore either. I've started using Home Assistant for my HA needs.

However, I may be able to merge pull requests if someone else is willing to fix some issues, and I'm open to someone else maintaining pimatic-hue-zll as well.

bertreb commented 4 years ago

Hi Mark, I made already the PR for keeping your plugin working under node 8/10 https://github.com/markbergsma/pimatic-hue-zll/pull/23 It's simply fix the version number of node-hue-api to "2.4.4"

Frankverharen commented 3 years ago

I tried to run this fix but the plugin still does not work. In which directory do I have to run the command: rm -rf node_modules and npm install

bertreb commented 3 years ago

You run the commands in the directory /home/pi/pimatic-app/node_modules/pimatic-hue-zll Don't forget to change the file package.json (its in the same directory)

Frankverharen commented 3 years ago

You run the commands in the directory /home/pi/pimatic-app/node_modules/pimatic-hue-zll Don't forget to change the file package.json (its in the same directory)

Thanks, now it works