Skip to content
View in the app

A better way to browse. Learn more.

Power Forum - Renewable Energy Discussion

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

SunSynk Logger Integration into Home Assistant

Featured Replies

16 hours ago, Gary Waterworth said:

Think this is something to do with nodered modules.

image.png

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.

  • Replies 948
  • Views 131.6k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • randomfool
    randomfool

    I am making good progress on converting slip06x excellent dashboard to work with Gary's brilliant work on gathering the data from the latest Sunsynk inverters remotely. Will publish the dashboard

  • @Gary Waterworth   Did a quick YouTube video on how to install your software and to get the data into HASS, no cards or anything so very basic.  Please let me know what you guys think of my first

  • randomfool
    randomfool

    Ok here goes; caveats to begin with - I am no HA expert, in fact I only discovered HA a few weeks ago through Gary's post and his subsequent links to slip06x dashboard, so my ability to provide "suppo

Posted Images

  • Author

ok got mine working . Looks like changes on gzip and some header stuff as well

In this

image.png

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

6 hours ago, Gary Waterworth said:

ok got mine working . Looks like changes on gzip and some header stuff as well

In this

image.png

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

Wonderful, I have a functioning dashboard again 😊

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 👍.

  • 4 weeks later...

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.

  • 2 months later...
  • 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 well

In this

image.png

    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

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.9

11 Aug 14:01:45 - [info] Node.js version: v22.16.0

11 Aug 14:01:45 - [info] Linux 6.12.25-haos-raspi arm64 LE

11 Aug 14:01:47 - [info] Loading palette nodes

11 Aug 14:01:51 - [info] Node-RED Contrib Theme Collection version: v4.0.11

11 Aug 14:02:04 - [info] Dashboard version 3.6.5 started at /endpoint/ui

11 Aug 14:02:09 - [info] node-red-contrib-home-assistant-websocket v0.77.1 nodes initialized

11 Aug 14:02:11 - [info] Settings file : /etc/node-red/config.js

11 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=false

11 Aug 14:02:11 - [info] Flows file : /config/flows.json

11 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 flows

11 Aug 14:02:16 - [info] [server:Home Assistant] Connecting to http://supervisor/core

11 Aug 14:02:16 - [info] [server:Home Assistant] Connecting to http://supervisor/core

11 Aug 14:02:16 - [info] [server:Home Assistant] Connecting to http://supervisor/core

11 Aug 14:02:16 - [info] [server:Home Assistant] Connecting to http://supervisor/core

11 Aug 14:02:16 - [info] [server:Home Assistant] Connecting to http://supervisor/core

11 Aug 14:02:16 - [info] [server:Home Assistant] Connecting to http://supervisor/core

11 Aug 14:02:16 - [info] [server:Home Assistant] Connecting to http://supervisor/core

11 Aug 14:02:16 - [info] [server:Home Assistant] Connecting to http://supervisor/core

11 Aug 14:02:16 - [info] [server:Home Assistant] Connecting to http://supervisor/core

11 Aug 14:02:16 - [info] [server:Home Assistant] Connecting to http://supervisor/core

11 Aug 14:02:17 - [info] [server:Home Assistant] Connected to http://supervisor/core

11 Aug 14:02:17 - [info] [server:Home Assistant] Connected to http://supervisor/core

11 Aug 14:02:17 - [info] [server:Home Assistant] Connected to http://supervisor/core

11 Aug 14:02:17 - [info] [server:Home Assistant] Connected to http://supervisor/core

11 Aug 14:02:17 - [info] [server:Home Assistant] Connected to http://supervisor/core

11 Aug 14:02:17 - [info] [server:Home Assistant] Connected to http://supervisor/core

11 Aug 14:02:17 - [info] [server:Home Assistant] Connected to http://supervisor/core

11 Aug 14:02:17 - [info] [server:Home Assistant] Connected to http://supervisor/core

11 Aug 14:02:17 - [info] [server:Home Assistant] Connected to http://supervisor/core

11 Aug 14:02:17 - [info] [server:Home Assistant] Connected to http://supervisor/core

11 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, continuing

11 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, continuing

11 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, continuing

11 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, continuing

11 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, continuing

11 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, continuing

11 Aug 14:07:47 - [error] [function:Calc Last Update Time & General Status Check] Logger Not Online - Error With Data

image.png

image.png

Hi Gary

I 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.

@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.

  • 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 time

Sunsynk are continually changing stuff in their backend. Just need to figure out what they have done

Will do an update to the git repo when I figure it out

Edited by Gary Waterworth

Thanks cK

Just 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 👍

  • 3 weeks later...

Seems like it died this morning...

image.png

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/new

  • Payload 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.

23 minutes ago, valienté said:

Seems like it died this morning...

image.png

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/new

  • Payload 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...

image.png

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/new

  • Payload 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.

  • 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 happen

The orrigional spec actually had a version of this in their design document that was never implemented

Edited by Gary Waterworth

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.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.