May 10, 20251 yr 16 hours ago, Gary Waterworth said:Think this is something to do with nodered modules.Exactly what I get Gary. I was just about to post that for info. Does that look like it's being encrypted or something. Definitely encoded looking.
May 12, 20251 yr Author Nothing yet Is the sunksynk.net site working again ? That was broken last time I checked
May 12, 20251 yr 20 minutes ago, Gary Waterworth said:Nothing yetIs the sunksynk.net site working again ?That was broken last time I checkedYes up and running for me.
May 12, 20251 yr Author Ok , looks like the return data is being gzipped .Need to try see why the nodered web function is not ungzipping it
May 12, 20251 yr Author ok got mine working . Looks like changes on gzip and some header stuff as well In this Change the variable headers_with_bearer to ( I changed encoding - removed gzip , referrer and origin ) var headers_with_bearer = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0", "Accept": "application/json", "Accept-Language": "en-US, en; q=0.5", "Accept-Encoding": "deflate", "Content-Type": "application/json;charset=UTF-8", "Authorization": "Bearer " + global.get("SS.Bearer"), "Origin": "https://api.sunsynk.net", "Connection": "keep-alive", "Referer": "https://api.sunsynk.net/", "Sec-Fetch-Dest": "empty", "Sec-Fetch-Mode": "cors", "Sec-Fetch-Site": "same-site", "TE": "trailers" }I may need to make changes on the setting one , but will try work that out later Will update the git repo when I get some time
May 12, 20251 yr 6 hours ago, Gary Waterworth said:ok got mine working . Looks like changes on gzip and some header stuff as wellIn thisChange the variable headers_with_bearer to ( I changed encoding - removed gzip , referrer and origin ) var headers_with_bearer = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0", "Accept": "application/json", "Accept-Language": "en-US, en; q=0.5", "Accept-Encoding": "deflate", "Content-Type": "application/json;charset=UTF-8", "Authorization": "Bearer " + global.get("SS.Bearer"), "Origin": "https://api.sunsynk.net", "Connection": "keep-alive", "Referer": "https://api.sunsynk.net/", "Sec-Fetch-Dest": "empty", "Sec-Fetch-Mode": "cors", "Sec-Fetch-Site": "same-site", "TE": "trailers" }I may need to make changes on the setting one , but will try work that out laterWill update the git repo when I get some timeWonderful, I have a functioning dashboard again 😊
May 13, 20251 yr You're a genius, Gary. Working again. Thank you so much. I really appreciate it, I have most of my automations based on this.
May 13, 20251 yr Author I have unfortunately moved house and will be removing the home assistant on Saturday so my support will have to stop then
May 13, 20251 yr Understandable.Hopefully neither sunsynk or home assistant will change anything major and break it, again. What are our chances of that 👀😅.Luckily I've migrated to a RS485 setup to pull 99% of data locally and the only thing I still use is the notifications this pulls about outages etc so a nice to have but not mission critical at least.It was a pleasure to work with you on some of the troubleshooting on this 👍.
June 8, 20251 yr Thanks Gary, success again after changing those three lines. Many thanks, and hope you manage to continue this project which has added so much value to our home automations.
August 11, 2025Aug 11 Author On 2025/05/12 at 11:21 AM, Gary Waterworth said:ok got mine working . Looks like changes on gzip and some header stuff as wellIn this var headers_with_bearer = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0", "Accept": "application/json", "Accept-Language": "en-US, en; q=0.5", "Accept-Encoding": "deflate", "Content-Type": "application/json;charset=UTF-8", "Authorization": "Bearer " + global.get("SS.Bearer"), "Origin": "https://sunsynk.net", "Host":"https://api.sunsynk.net", "Connection": "keep-alive", "Referer": "https://sunsynk.net/", "Sec-Fetch-Dest": "empty", "Sec-Fetch-Mode": "cors", "Sec-Fetch-Site": "same-site", "TE": "trailers" }Just did a quick login and check. They may have stuffed arround with the headers again . Change to to above
August 11, 2025Aug 11 Just now, Gary Waterworth said:What errors are you getting ?Hey Gary,Welcome to Node-RED===================11 Aug 14:01:45 - [info] Node-RED version: v4.0.911 Aug 14:01:45 - [info] Node.js version: v22.16.011 Aug 14:01:45 - [info] Linux 6.12.25-haos-raspi arm64 LE11 Aug 14:01:47 - [info] Loading palette nodes11 Aug 14:01:51 - [info] Node-RED Contrib Theme Collection version: v4.0.1111 Aug 14:02:04 - [info] Dashboard version 3.6.5 started at /endpoint/ui11 Aug 14:02:09 - [info] node-red-contrib-home-assistant-websocket v0.77.1 nodes initialized11 Aug 14:02:11 - [info] Settings file : /etc/node-red/config.js11 Aug 14:02:11 - [info] Context store : 'default' [module=memory]11 Aug 14:02:11 - [info] User directory : /config/11 Aug 14:02:11 - [warn] Projects disabled : editorTheme.projects.enabled=false11 Aug 14:02:11 - [info] Flows file : /config/flows.json11 Aug 14:02:11 - [info] Server now running at http://127.0.0.1:46836/11 Aug 14:02:11 - [info] Starting flows[14:02:11] INFO: Starting NGinx...11 Aug 14:02:12 - [info] Started flows11 Aug 14:02:16 - [info] [server:Home Assistant] Connecting to http://supervisor/core11 Aug 14:02:16 - [info] [server:Home Assistant] Connecting to http://supervisor/core11 Aug 14:02:16 - [info] [server:Home Assistant] Connecting to http://supervisor/core11 Aug 14:02:16 - [info] [server:Home Assistant] Connecting to http://supervisor/core11 Aug 14:02:16 - [info] [server:Home Assistant] Connecting to http://supervisor/core11 Aug 14:02:16 - [info] [server:Home Assistant] Connecting to http://supervisor/core11 Aug 14:02:16 - [info] [server:Home Assistant] Connecting to http://supervisor/core11 Aug 14:02:16 - [info] [server:Home Assistant] Connecting to http://supervisor/core11 Aug 14:02:16 - [info] [server:Home Assistant] Connecting to http://supervisor/core11 Aug 14:02:16 - [info] [server:Home Assistant] Connecting to http://supervisor/core11 Aug 14:02:17 - [info] [server:Home Assistant] Connected to http://supervisor/core11 Aug 14:02:17 - [info] [server:Home Assistant] Connected to http://supervisor/core11 Aug 14:02:17 - [info] [server:Home Assistant] Connected to http://supervisor/core11 Aug 14:02:17 - [info] [server:Home Assistant] Connected to http://supervisor/core11 Aug 14:02:17 - [info] [server:Home Assistant] Connected to http://supervisor/core11 Aug 14:02:17 - [info] [server:Home Assistant] Connected to http://supervisor/core11 Aug 14:02:17 - [info] [server:Home Assistant] Connected to http://supervisor/core11 Aug 14:02:17 - [info] [server:Home Assistant] Connected to http://supervisor/core11 Aug 14:02:17 - [info] [server:Home Assistant] Connected to http://supervisor/core11 Aug 14:02:17 - [info] [server:Home Assistant] Connected to http://supervisor/core11 Aug 14:02:26 - [error] [function:Export Errors] TypeError: Cannot read properties of undefined (reading 'includes')11 Aug 14:02:48 - [error] [function:Export Data Export To Entity] Logger In Warning Mode, continuing11 Aug 14:02:48 - [error] [function:Calc Last Update Time & General Status Check] Stats Last Update - Error With Data 11 Aug 14:02:48 - [error] [function:Calc Last Update Time & General Status Check] Logger Not Online - Error With Data 11 Aug 14:03:47 - [error] [function:Export Data Export To Entity] Logger In Warning Mode, continuing11 Aug 14:03:47 - [error] [function:Calc Last Update Time & General Status Check] Logger Not Online - Error With Data 11 Aug 14:04:48 - [error] [function:Export Data Export To Entity] Logger In Warning Mode, continuing11 Aug 14:04:48 - [error] [function:Calc Last Update Time & General Status Check] Logger Not Online - Error With Data 11 Aug 14:05:47 - [error] [function:Export Data Export To Entity] Logger In Warning Mode, continuing11 Aug 14:05:47 - [error] [function:Calc Last Update Time & General Status Check] Logger Not Online - Error With Data 11 Aug 14:06:47 - [error] [function:Export Data Export To Entity] Logger In Warning Mode, continuing11 Aug 14:06:47 - [error] [function:Calc Last Update Time & General Status Check] Logger Not Online - Error With Data 11 Aug 14:07:47 - [error] [function:Export Data Export To Entity] Logger In Warning Mode, continuing11 Aug 14:07:47 - [error] [function:Calc Last Update Time & General Status Check] Logger Not Online - Error With Data
August 11, 2025Aug 11 Just now, Gary Waterworth said:Just did a quick login and check. They may have stuffed arround with the headers again . Change to to aboveYou champ! All good again.
August 11, 2025Aug 11 Author 20 minutes ago, Ronnie1102 said:You champ! All good again.They are arseholes
August 13, 2025Aug 13 Hi GaryI Updated global Vars as suggested, which got everything working, but now I get these errors and the battery constantly shows at 99%. Any ideas would be most appreciated please.
August 13, 2025Aug 13 @Motty09 I saw something similar when I amended that section and just reverted back to what my code was and everything seems to be working fine for me but then again I did not notice any errors before editing it either and things seemed to be working just fine.This is mine at the present moment: var headers_with_bearer = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0", "Accept": "application/json", "Accept-Language": "en-US, en; q=0.5", "Accept-Encoding": "deflate", "Content-Type": "application/json;charset=UTF-8", "Authorization": "Bearer " + global.get("SS.Bearer"), "Origin": "https://api.sunsynk.net", "Connection": "keep-alive", "Referer": "https://api.sunsynk.net/", "Sec-Fetch-Dest": "empty", "Sec-Fetch-Mode": "cors", "Sec-Fetch-Site": "same-site", "TE": "trailers" }What version of HA are you on? I'm still on 2025.7.4 and haven't gone to 2025.8 yet, usually hold off until .1 or .2. Not sure if that might be related to why I'm not seeing any errors yet on the old code 🤷♂️. Perhaps worth a shot to just try and revert that section and check if works or not.
August 13, 2025Aug 13 Author I will reload my HA and point it to my old acct and see what it says. Just need a few days to find the timeSunsynk are continually changing stuff in their backend. Just need to figure out what they have doneWill do an update to the git repo when I figure it out Edited August 13, 2025Aug 13 by Gary Waterworth
August 13, 2025Aug 13 Thanks cKJust reverted mine back as well and it looks like its working fine. I was a bit apprehensive about doing that in case it broke something else 🤦♂️. FYI I am on 2025.8 and it seems to be working fine.Thanks again 👍
September 2, 2025Sep 2 Seems like it died this morning...Doing some investigations, manually logging into https://api.sunsynk.net/ there are 2 changes that I am seeing:URL changed from https://api.sunsynk.net/oauth/token to https://api.sunsynk.net/oauth/token/newPayload password seems to be some kind of hash:{"username":"[email protected]","password":"v4o9WZhlL5UI8dyq7Qt46+tubAYsPssTiBgw8wS8UR2K99fRI8srmaGP1INp5uoZj+xSIZbB96apbeEqVuta45yNmvGj8gSdPiN72Dej0cDv37lo4xHS3IV5KBVo8KOYMFXsNG50JL5nBOUlXsnPE+a2F9jMAUZBgKHo0wL4TQ1lmmG/pGPNlBBPK/frfGRmfnzcfUSY2+/UEHOYj2OF9nI2/qgohTN/nHB6FSyNowO2WhCnSmg1UVksWU0OueVxcE0oiRZfm52gCbiAK1TM8iA9MxPhBsk617kaGJF0dNV7pvxrKTn4ybeCrZSxLfW6FFUcwVO8l3InfvmdRXKoPcCuqSI8uYX3QQPRaVwcA+j3a9g28/Fq0kf/d7ZWKlauzKwJCZxhOgoqOckJ5KjuI46364bef2UG+7/DfrPajjttgfHCv4wRBlnas02dgqXWvY1ISydcivh35Dyjp7Y8ioW5W2KECmKJ/pcXvnD7NAF5Hyx8TJK9S8yqyOfx+SwgwukZcUse/YU6es7D0koAAjqymbwbFky/FKBg3owzV0xLgXZs+4Awq9u8pl2szGIiQQV5VYjBBDVMxM/tIW8quRfzskj9IUM/WOMSpCSN8XUFJ9EVkxybprVYDNjEA2RtVJ8dehc=","grant_type":"password","client_id":"csp-web","source":"sunsynk"}This hash password changes every time, so using this static value does not work - I suspect we will have to manually calculate the hashed password the same way they do it on the site.
September 2, 2025Sep 2 23 minutes ago, valienté said:Seems like it died this morning...Doing some investigations, manually logging into https://api.sunsynk.net/ there are 2 changes that I am seeing:URL changed from https://api.sunsynk.net/oauth/token to https://api.sunsynk.net/oauth/token/newPayload password seems to be some kind of hash:{"username":"[email protected]","password":"v4o9WZhlL5UI8dyq7Qt46+tubAYsPssTiBgw8wS8UR2K99fRI8srmaGP1INp5uoZj+xSIZbB96apbeEqVuta45yNmvGj8gSdPiN72Dej0cDv37lo4xHS3IV5KBVo8KOYMFXsNG50JL5nBOUlXsnPE+a2F9jMAUZBgKHo0wL4TQ1lmmG/pGPNlBBPK/frfGRmfnzcfUSY2+/UEHOYj2OF9nI2/qgohTN/nHB6FSyNowO2WhCnSmg1UVksWU0OueVxcE0oiRZfm52gCbiAK1TM8iA9MxPhBsk617kaGJF0dNV7pvxrKTn4ybeCrZSxLfW6FFUcwVO8l3InfvmdRXKoPcCuqSI8uYX3QQPRaVwcA+j3a9g28/Fq0kf/d7ZWKlauzKwJCZxhOgoqOckJ5KjuI46364bef2UG+7/DfrPajjttgfHCv4wRBlnas02dgqXWvY1ISydcivh35Dyjp7Y8ioW5W2KECmKJ/pcXvnD7NAF5Hyx8TJK9S8yqyOfx+SwgwukZcUse/YU6es7D0koAAjqymbwbFky/FKBg3owzV0xLgXZs+4Awq9u8pl2szGIiQQV5VYjBBDVMxM/tIW8quRfzskj9IUM/WOMSpCSN8XUFJ9EVkxybprVYDNjEA2RtVJ8dehc=","grant_type":"password","client_id":"csp-web","source":"sunsynk"}This hash password changes every time, so using this static value does not work - I suspect we will have to manually calculate the hashed password the same way they do it on the site.24 minutes ago, valienté said:Seems like it died this morning...Doing some investigations, manually logging into https://api.sunsynk.net/ there are 2 changes that I am seeing:URL changed from https://api.sunsynk.net/oauth/token to https://api.sunsynk.net/oauth/token/newPayload password seems to be some kind of hash:{"username":"[email protected]","password":"v4o9WZhlL5UI8dyq7Qt46+tubAYsPssTiBgw8wS8UR2K99fRI8srmaGP1INp5uoZj+xSIZbB96apbeEqVuta45yNmvGj8gSdPiN72Dej0cDv37lo4xHS3IV5KBVo8KOYMFXsNG50JL5nBOUlXsnPE+a2F9jMAUZBgKHo0wL4TQ1lmmG/pGPNlBBPK/frfGRmfnzcfUSY2+/UEHOYj2OF9nI2/qgohTN/nHB6FSyNowO2WhCnSmg1UVksWU0OueVxcE0oiRZfm52gCbiAK1TM8iA9MxPhBsk617kaGJF0dNV7pvxrKTn4ybeCrZSxLfW6FFUcwVO8l3InfvmdRXKoPcCuqSI8uYX3QQPRaVwcA+j3a9g28/Fq0kf/d7ZWKlauzKwJCZxhOgoqOckJ5KjuI46364bef2UG+7/DfrPajjttgfHCv4wRBlnas02dgqXWvY1ISydcivh35Dyjp7Y8ioW5W2KECmKJ/pcXvnD7NAF5Hyx8TJK9S8yqyOfx+SwgwukZcUse/YU6es7D0koAAjqymbwbFky/FKBg3owzV0xLgXZs+4Awq9u8pl2szGIiQQV5VYjBBDVMxM/tIW8quRfzskj9IUM/WOMSpCSN8XUFJ9EVkxybprVYDNjEA2RtVJ8dehc=","grant_type":"password","client_id":"csp-web","source":"sunsynk"}This hash password changes every time, so using this static value does not work - I suspect we will have to manually calculate the hashed password the same way they do it on the site.Thank goodness I'm not the only one. I have exactly the same issue this morning.
September 2, 2025Sep 2 Author If they are prehashing the password instead of sending it in the clear then this addon is going to be dead in the water unless the method and salt they are using can be figured out.I wondered a while back when this was going to happenThe orrigional spec actually had a version of this in their design document that was never implemented Edited September 2, 2025Sep 2 by Gary Waterworth
September 2, 2025Sep 2 The new login is using a public key endpoint to encrypt the password before sending.I have a php integration, this worked for me, hopefully this helps:$password = "yourPassword"; // Sunsynk account password// 1. Generate nonce & sign$nonce = (string) round(microtime(true) * 1000);$source = "sunsynk";$sign = md5($nonce . $source);// 2. Fetch publicKey$pubKeyUrl = "https://api.sunsynk.net/anonymous/publicKey?nonce=$nonce&source=$source&sign=$sign";$ch = curl_init($pubKeyUrl);curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ["Accept: application/json"]]);$pubKeyResponse = curl_exec($ch);curl_close($ch);$data = json_decode($pubKeyResponse, true);$publicKeyBase64 = $data['data'];// 3. Build PEM-formatted key$publicKeyPem = "-----BEGIN PUBLIC KEY-----\n" . chunk_split($publicKeyBase64, 64, "\n") . "-----END PUBLIC KEY-----\n";// 4. Encrypt password with RSA$encrypted = null;openssl_public_encrypt($password, $encrypted, $publicKeyPem, OPENSSL_PKCS1_PADDING));$encryptedPassword = base64_encode($encrypted);Then call the new oauth endpoint with the encrypted password
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.