PV SolaX inverter cloud sensors via API

When you have a Solax inverter with a wifi-dongle, the existing integrations do not apply. Via the Solax cloud and https://www.home-assistant.io/integrations/rest/ the inverter sensors can be imported. This is how I did it:

Solax Cloud
First create an account, log in and register your Solax inverter: https://www.solaxcloud.com/#/login

Inverter registration No.
https://www.solaxcloud.com/#/inverter
Note down the Inverter registration No. : SWXXXXXXX

API details
Obtain your API access details https://www.solaxcloud.com/#/api
and add the Inverter registration no:
https://www.nz.solaxcloud.com:9443/proxy/api/getRealtimeInfo.do?tokenId=202102060300yyyyyyy&sn=SWXXXXXXX

Test the link by copy/paste it into your browser, then you should see something like this:

{"exception":"Query success!","result":{"inverterSN":"XYYYYYYYYYY","sn":"SWXXXXXXX","acpower":67.0,"yieldtoday":0.0,"yieldtotal":2344.1,"feedinpower":0.0,"feedinenergy":0.0,"consumeenergy":0.0,"feedinpowerM2":0.0,"soc":0.0,"peps1":0.0,"peps2":0.0,"peps3":0.0,"inverterType":"4","inverterStatus":"102","uploadTime":"2021-02-07 10:10:31"},"success":true}

You can now enjoy a :coffee: to celebrate this milestone

The Solax API documentation you can be found here: https://www.eu.solaxcloud.com/phoebus/resource/files/userGuide/Solax_API_for_End-user_V1.0.pdf?token=34f9f8d7-7577-49bf-a4b6-a307be242dc0&lang=en_US

Build the sensors in HA

#########################################################
#                                                       #
#         SOLAX CLOUD.                                  #
#                                                       #
#########################################################
sensors:
  - platform: rest
    resource: https://www.nz.solaxcloud.com:9443/proxy/api/getRealtimeInfo.do?tokenId=202102060300yyyyyyy&sn=SWXXXXXXX
    value_template: '{{ ( value_json.result.yieldtotal | round(0) ) }}'
    name: "Solax total"
    unit_of_measurement: "KWh"

  - platform: rest
    resource: https://www.nz.solaxcloud.com:9443/proxy/api/getRealtimeInfo.do?tokenId=202102060300yyyyyyy&sn=SWXXXXXXX
    value_template: '{{ ( value_json.result.acpower | round(0) ) }}'
    name: "Solax now"
    unit_of_measurement: "W"

  - platform: rest
    resource: https://www.nz.solaxcloud.com:9443/proxy/api/getRealtimeInfo.do?tokenId=202102060300yyyyyyy&sn=SWXXXXXXX
    value_template: '{{ value_json.result.yieldtoday }}'
    name: "Solax today"
    unit_of_measurement: "KWh"
    
  - platform: rest
    resource: https://www.nz.solaxcloud.com:9443/proxy/api/getRealtimeInfo.do?tokenId=202102060300yyyyyyy&sn=SWXXXXXXX
    value_template: "{{ value_json.result.uploadTime }}"
    name: "Solax upload time"
    
  - platform: rest
    resource: https://www.nz.solaxcloud.com:9443/proxy/api/getRealtimeInfo.do?tokenId=202102060300yyyyyyy&sn=SWXXXXXXX
    value_template: >
          {% if value_json.result.inverterStatus == '100' %}Wait
          {% elif value_json.result.inverterStatus == '101' %}Check
          {% elif value_json.result.inverterStatus == '102' %}Normal
          {% elif value_json.result.inverterStatus == '103' %}Fault
          {% elif value_json.result.inverterStatus == '104' %}Permanent Fault
          {% elif value_json.result.inverterStatus == '105' %}Update
          {% elif value_json.result.inverterStatus == '106' %}EPS Check
          {% elif value_json.result.inverterStatus == '107' %}EPS
          {% elif value_json.result.inverterStatus == '108' %}Self-test
          {% elif value_json.result.inverterStatus == '109' %}Idle
          {% elif value_json.result.inverterStatus == '110' %}Standby
          {% elif value_json.result.inverterStatus == '111' %}Pv Wake Up Bat
          {% elif value_json.result.inverterStatus == '112' %}Gen Check
          {% elif value_json.result.inverterStatus == '113' %}Gen Run
          {% else %}I dont know{% endif %}
    name: "Solax status"

#########################################################
#                                                       #
#            END OF CONFIGURATION FILE                  #
#                                                       #
#########################################################

Restart HA and just add the new sensors:

Screen Shot 2021-02-07 at 10.20.39

That’s all

5 Likes

Thanks! That is working like a charm!

Shouldn’t the URL be without the “nz” for more generic use?

Mine doesn’t work with that URL but does work with both:

https://www.solaxcloud.com:9443/proxy/api/getRealtimeInfo.do?tokenId=202102060300yyyyyyy&sn=SWXXXXXXX

https://www.eu.solaxcloud.com:9443/proxy/api/getRealtimeInfo.do?tokenId=202102060300yyyyyyy&sn=SWXXXXXXX

So I think the general URL without the continent abbreviation is the most generic solution.

1 Like

Happy to hear that it’s working for you! Thanks for the URL update.

Hello,
Thanks for the work done
I managed to integrate my Solax with this configuration, but it shows at the start of the server startup and then stops giving readings, do you know why it might be?
This is the error that occurs in the Log.

Hi dantashelder,
the name resolution seams not resolved, had you tried with the ip address of the solaxclous.com that is 47.254.152.24 ?

Hello,
Thanks for the quick response.
I’ve used both.
eu.solaxcloud.com and solaxcloud.com, always with the same result.

Appears on restart and after a few seconds are unavailable.
I have now switched to IP and I get the next answer.

had you tried your link with an iexplorer? had you the same issue?

Yes,
so much so that in HA it starts at the beginning

image

IE response

‘{“exception”:“Query success!”,“result”:{“inverterSN”:“XMT”,“sn”:"",“acpower”:0.0,“yieldtoday”:1.9,“yieldtotal”:266.4,“feedinpower”:0.0,“feedinenergy”:0.0,“consumeenergy”:0.0,“feedinpowerM2”:0.0,“soc”:0.0,“peps1”:0.0,“peps2”:0.0,“peps3”:0.0,“inverterType”:“4”,“inverterStatus”:“102”,“uploadTime”:“2021-02-10 17:21:03”},“success”:true}’

This afternoon, my Solax went to unavailable for a couple of minutes, but turned back ‘on’ a bit later. This would suggest a Solaxcloud website/connection issue.

Hello,

I already thought about it, because as it starts it is the API that stops responding.
They recently changed the cloud and since then I often have no data in the cloud itself.

As nobody had complained in this post, I thought it was just me.

Did the service load again or just restart the HA server?

Thank you

I did nothing, the API service suddenly restarted without restarting HA.

I was able to understand what the problem is.
I had a problem with the HA DNS, I checked the settings, rebooted the HA and it’s already pumping.

Thank you for your help,

1 Like

I’m getting “502 Bad Gateway” when I test with

https://www.eu.solaxcloud.com:9443/proxy/api/getRealtimeInfo.do?tokenId=20210215XXXXXXX&sn=SWXXXXXXR

I’ve tried both the serial number and registration number, any ideas?

Yep, same here at this very moment. This would suggest a communication issue at Solax. Hopefully It will be repaired tomorrow.

me too. must be down at solax

The API is back online :grinning:

This solution works great! The polling interval appears to be around 5 minutes where the API allows 6 times per minute. Any suggestions how this interval can be increased?

1 Like

I don’t think we as users can change this interval :sleepy:

Thats a shame, but better than no data.

Thanks for the excellent howto :slight_smile: Works like a charm!

The only problem I experience is that the “yieldtoday” is being reset to 0 when my panels stop catching sunlight. Looks like it’s happening when the inverter status switches from “active” to “wait”.

1 Like