DrHauss / node-red-contrib_BRP069C4

Module for Node-Red to Control ACs via Daikin Cloud
MIT License
3 stars 1 forks source link

HTTPError: Response code 400 (Bad Request) #4

Closed MaartenProvo closed 2 years ago

MaartenProvo commented 2 years ago

I've been using this node sucessfully for a couple of months, but since a week or two it started giving this error: HTTPError: Response code 400 (Bad Request) I thought it had to do something with the firmware update, which I executed today. But that didn't solve it. I haven't changed anything else, it just stopped working. I tried re-entering my settings, setting it up from scratch but it keeps giving me this error.

fiendie commented 2 years ago

I'm experiencing the same issue. Started occurring out of the blue today after using it for a few weeks.

bartjanisse commented 2 years ago

Me too. Had it before. I deleted the tokenset.json and restarted Node red. After that it seems to rune fine again.

Somehow I think the token gets out of date.

Maybe there could be some mechanism to refresh the token every 3 weeks or so (just a thought)

fiendie commented 2 years ago

@bartjanisse: That did the trick, thanks ;)

MaartenProvo commented 2 years ago

Great, that did the trick.

DrHauss commented 2 years ago

I think the problem is that the tokenset.json is broken at some point. I had the same issue some time ago but had no logs to get into this topic deeper. I implemented a setting in the Daikin Cloud device to not save the "tokenset.json". This could be done by setting the "Save token" value to Disabled in your node.

DrHauss commented 2 years ago

@bartjanisse @MaartenProvo  @fiendie

Also check this pull request on the daikin-cloud-controller lib which is used here by this node.

Timeout and retry for GOT client

After adding the timeout and retry functionality it is now safer for me to update the token.

Since this functionality is not released into the latest version of Daikin-cloud-controller lib please use the version from GitHub. The actual released version which is automatically installed with this npm does not support the settings for retry and timeout and ignore whatever you set in the node config. When there is a timeout during update of tokenset.json this might broke your tokenset.json.