Hue Node stopped working

few days ago I realized that my hue workflow does not work anymore.

Error: HTTP status 400
    at /usr/local/lib/node_modules/n8n/node_modules/client-oauth2/src/client-oauth2.js:283:25
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/src/NodeExecuteFunctions.js:81:30
    at async Object.philipsHueApiRequest (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/PhilipsHue/GenericFunctions.js:25:16)
    at async Object.getUser (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/PhilipsHue/GenericFunctions.js:37:27)
    at async Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/PhilipsHue/PhilipsHue.node.js:106:34)
    at async /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/src/WorkflowExecute.js:370:47

.
I have tested it again with a simple node like this.

Bildschirmfoto 2020-11-06 um 09.38.31

OAuth seems to be connected …

@josema Will have a look at it. Maybe the token expired but it should have refreshed it automatically. Thanks for letting us know.

@josema found the issue.

When we do the OAuth2 flow, the API responds with an access token and a refresh token. The access token has an expiration. When it expires, we detect it and use the refresh token to refresh it and get a new one. Sadly, Phillip Hue API also has an expiration for the refresh token of about 2.5 hours. This means that if the API does not get a request in 2.5 hours, the refresh token expires; thus, it cannot refresh the access token.

This is the first time I see something like this. I will work on it and will let you know when it is fixed.

In the meantime, you can use the crown node to make, let’s say, a get operation every hour. This will prevent the refresh token from getting expired.

1 Like