ch-world / pimatic-hue

Plugin to control Philipps hue bulbs
GNU General Public License v2.0
4 stars 0 forks source link

Error when dimming in rule #2

Closed sweebee closed 8 years ago

sweebee commented 8 years ago

When i have this:

if woonkamer is turned on then dim hue lamp to 40%

But when i execute this rule i get this:

error: rule woonkamer-on error executing an action: Object 0 has no method 'then'
14:20:24.929 [pimatic] debug: TypeError: Object 0 has no method 'then'

and

14:20:26.333 [pimatic] error: A uncaught exception occured: TypeError: Cannot read property 'state' of null
14:20:26.333 [pimatic] error:>    at process (/home/pi/pimatic-app/node_modules/pimatic-hue/node_modules/hue-module/lib/hue.js:111:37)
14:20:26.333 [pimatic] error:>    at ClientRequest.<anonymous> (/home/pi/pimatic-app/node_modules/pimatic-hue/node_modules/hue-module/lib/http.js:92:6)
14:20:26.333 [pimatic] error:>    at ClientRequest.EventEmitter.emit (events.js:95:17)
14:20:26.333 [pimatic] error:>    at Socket.socketOnEnd [as onend] (http.js:1568:9)
14:20:26.333 [pimatic] error:>    at Socket.g (events.js:180:16)
14:20:26.333 [pimatic] error:>    at Socket.EventEmitter.emit (events.js:117:20)
14:20:26.333 [pimatic] error:>    at _stream_readable.js:920:16
14:20:26.333 [pimatic] error:>    at process._tickCallback (node.js:415:13)
14:20:26.333 [pimatic] error:> This is most probably a bug in pimatic or in a module, please report it!
14:20:26.338 [pimatic] warn: Keeping pimatic alive, but could be in an undefined state, please restart pimatic as soon as possible!
14:20:26.367 [pimatic] error: A uncaught exception occured: TypeError: Cannot read property 'state' of null
14:20:26.367 [pimatic] error:>    at process (/home/pi/pimatic-app/node_modules/pimatic-hue/node_modules/hue-module/lib/hue.js:111:37)
14:20:26.367 [pimatic] error:>    at ClientRequest.<anonymous> (/home/pi/pimatic-app/node_modules/pimatic-hue/node_modules/hue-module/lib/http.js:92:6)
14:20:26.367 [pimatic] error:>    at ClientRequest.EventEmitter.emit (events.js:95:17)
14:20:26.367 [pimatic] error:>    at Socket.socketCloseListener (http.js:1522:9)
14:20:26.367 [pimatic] error:>    at Socket.EventEmitter.emit (events.js:117:20)
14:20:26.367 [pimatic] error:>    at TCP.close (net.js:466:12)
14:20:26.367 [pimatic] error:> This is most probably a bug in pimatic or in a module, please report it!
14:20:26.372 [pimatic] warn: Keeping pimatic alive, but could be in an undefined state, please restart pimatic as soon as possible!
ch-world commented 8 years ago

Thanks for testing this. changeDimlevelTo was not returning a Promise as expected by pimatic. This should be fixed in 0.0.4.

sweebee commented 8 years ago

Thanks.

"Object 0 has no..." is fixed now. But sometimes i get

error [pimatic]: A uncaught exception occured: TypeError: Cannot read property 'state' of null
    at process (/home/pi/pimatic-app/node_modules/pimatic-hue/node_modules/hue-module/lib/hue.js:111:37)
    at ClientRequest.<anonymous> (/home/pi/pimatic-app/node_modules/pimatic-hue/node_modules/hue-module/lib/http.js:92:6)
    at ClientRequest.EventEmitter.emit (events.js:95:17)
    at Socket.socketCloseListener (http.js:1522:9)
    at Socket.EventEmitter.emit (events.js:117:20)
    at TCP.close (net.js:466:12)
 This is most probably a bug in pimatic or in a module, please report it!
ch-world commented 8 years ago

That sounds like a network error. I created a new issue #3 for this.