Zodiac Chlorinator HTTP request flow broken

I have an existing flow that stopped working about 4 days ago. It's using an unoffical method to retrieve data from a cloud based pool chlorinator app. My suspicion is that the manufacturer has changed something in the output format. I haven't changed anything in my installaton.

Node-Red gives an error "JSON parse error" in the debug. The string that is displayed has a lot of garbage symbols.

Parse error

I have retrieved the content of the HTTP POST request using an alternative manual method (non Node-Red). This displays all information successfully. So it seems to be just the JSON parsing that is hitting a new snag.

I've attached a picture of the output of the manual POST retrieval. Are there any characters that could cause the parsing error? And how might I fix this?

The IdToken highlighted is used in a subsequent flow for data retrieval.

Perhaps it is now coming as compressed data. I think you can specify a header to tell it to uncompress, but I am not certain how to do that.

If that is the case the it's possibly the Accept-Encoding header that needs to be set ... I think it should be set to identity for no compression (but I have tested that),

1 Like

Thanks! That was it. accept-encoding to identity fixed it.

For anyone else who ends up here, the complete working Function node preceeding the http request -

msg.method = 'POST';
msg.headers = {};
msg.headers['Host'] = 'prod.zodiac-io.com';
msg.headers['accept'] = 'application/json';
msg.headers['content-type'] = 'application/json';
msg.headers['accept-encoding'] = 'identity';
msg.headers['user-agent'] = 'okhttp/3.12.0';
msg.url = 'https://prod.zodiac-io.com/users/v1/login';
msg.payload = '{"api_key":"generic_key_here", "email":"you@your_email.com", "password":"Your_password"}';
return msg;

The previous version had accept-encoding as gzip. All the subsequent POST requests using the initial IDToken also need to have the accept-encoding changed to identity.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.