Ricardo1980 / dasher-hue

Use your Amazon Dash buttons directly with Philips Hue to control your lights.
MIT License
10 stars 0 forks source link

sudo npm run start [ERROR]... #1

Closed suffix101 closed 6 years ago

suffix101 commented 6 years ago

I've followed all instructions as described...

I experience the following error on Raspberry Pi 3 when I attempt sudo npm run start:

pi@mypi:~/dasher/dasher-hue $ sudo npm run start

dasher-hue@1.0.0 start /home/pi/dasher/dasher-hue sudo node app.js

module.js:339 throw err; ^

Error: Cannot find module './config/config.json' at Function.Module._resolveFilename (module.js:337:15) at Function.Module._load (module.js:287:25) at Module.require (module.js:366:17) at require (module.js:385:17) at Object. (/home/pi/dasher/dasher-hue/app.js:1:76) at Module._compile (module.js:435:26) at Object.Module._extensions..js (module.js:442:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:311:12) at Function.Module.runMain (module.js:467:10)

npm ERR! Linux 4.9.35-v7+ npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start" npm ERR! node v4.2.1 npm ERR! npm v2.14.7 npm ERR! code ELIFECYCLE npm ERR! dasher-hue@1.0.0 start: sudo node app.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the dasher-hue@1.0.0 start script 'sudo node app.js'. npm ERR! This is most likely a problem with the dasher-hue package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! sudo node app.js npm ERR! You can get their info via: npm ERR! npm owner ls dasher-hue npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /home/pi/dasher/dasher-hue/npm-debug.log

.... any thoughts??

Ricardo1980 commented 6 years ago

Rename config.sample.json to config.json Don't forget to edit it according to your needs.

suffix101 commented 6 years ago

Duh, my bad. Simple fix, thanks!

This code works like a champ. Love it! Any chance there is an option for "scene" in addition to "group" and "light"? Reason I ask is because I have a scene I'd like to control with the Amazon Dash button that utilizes the fade function of the Hue lights.

Ricardo1980 commented 6 years ago

It seems node-hue-api has support for scenes. https://github.com/peter-murray/node-hue-api

I see the method called activateScene, but I don't see deactivateScene https://github.com/peter-murray/node-hue-api#activating-or-recalling-a-scene

I opened an issue to know more. https://github.com/peter-murray/node-hue-api/issues/113

Once I clarify that, it would be very easy to add support for scenes.

Ricardo1980 commented 6 years ago

After a discussion here https://github.com/peter-murray/node-hue-api/issues/113 and some research, I see it's possible to activate a scene, but not deactivate it. I could add to the code the possibility to activate a specific scene, but if you press the button again, nothing would happen because a scene cannot be deactivated.