Solax hybrid inverter

The best place to play with this is on the developers tools, templates page in the left panel of Home Assistant.
That’s how i got mine working. Unfortunately they have to be written differently so the sensor data can be called to template but nothing a bit of reading can’t find…Sorry it’s been a while since i set it up and cannot remember how to template.

Remember you can’t use realtime and history at the same time they must be separated by a set amount of time which i have not experimented with.

All working and in hassio now. Will post full details on how and what. I eventually figured out the template with the dev templates page

Many thanks to roy13 for the assistance and helping point me in the right direction.

Thank you to all the folks above for assistance in getting my SolaX Inverter info into hass.io especially roy13

So, here is my “How to” guide on setting up a SolaX Inverter with hass.io using emoncms

Step 1 – SolaX inverter setup
Ensure inverter is either wired or WiFi to your network
!!! Make sure you use a static or DHCP reservation for the IP of your inverter !!!
Login to http://INVERTERIP

Confirm datastream from inverter by checking you can access the following URL’s and get a response similar to these. Copy them to your favourite text editor
http://INVERTERIP/api/historyData.htm
datastream - [7.6,7.4,129.8,0.0,129.8,0.1,0.1,33.3,0.0,33.3]
http://INVERTERIP/api/realTimeData.htm
datastream - {“method”:“uploadsn”,“version”:“INVERTERVERSIONNUMBER”,“type”:“AL_SE”,“SN”:“INVERTERSERIALNUMBER”,“Data”:[1.4,1.5,313.7,129.9,2.8,244.2,660,33,4.3,126.5,-5167,439,194,48.58,-0.21,-11,11,4,0.0,33.3,0.00,0.00,50.03,0.0,0.0,0,0.00,0,0,0,0.00,0,9,0,0,0.00,0,9],“Status”:“2”}

Step 2 – emoncms setup part 1
You will need to setup and configure an emoncms account to manipulate the datastream from the Solax inverter to a sensor that hass.io can read
Create an Account at emoncms.org
!!! Take a note of your Read API Key and your Read & Write API Key !!!

Step 3 – hass.io setup part 1
Add to your configuration.yaml
emoncms_history:
api_key: Your Read&Write emoncms API Key
url: https://emoncms.org
inputnode: 11
whitelist:
- sensor.solax_live
- sensor.solax_history

rest_command:
solax_history:
url: ‘https://emoncms.org/input/post.json?node=1&csv={{ states.sensor.solax_history.state }}&apikey=Your Read&Write emoncms API Key’
method: ‘post’
solax_live:
url: ‘https://emoncms.org/input/post.json?node=2&csv={{ states.sensor.solax_live.state }}&apikey=Your Read&Write emoncms API Key’
method: ‘post’

!!! Change your node ID for each entry above to any number/name you wish as long as you do not have one already in use at emoncms

Step 4 – automations
Add the following to your automations.yaml

  • action:
    • data:
      entity_id:
      • rest_command.solax_history
        service: rest_command.solax_history
        alias: Solax History to emoncms
        condition: []
        id: ‘1521733256076’
        trigger:
    • minutes: ‘/30’
      seconds: 00
      platform: time
  • action:
    • data:
      entity_id:
      • rest_command.solax_live
        service: rest_command.solax_live
        alias: Solax Live to emoncms
        condition: []
        id: ‘1521733112076’
        trigger:
    • minutes: ‘/1’
      seconds: 00
      platform: time

Step 5 - Save all files & Reboot home assistant/hass.io

Step 6 – emoncms part 2
Wait at least 5 mins after reboot for the datastream to be uploaded and the two nodes and keys to be created in the inputs section of emoncms
Node 1 Should be the Historical data (uploaded every 5 mins)
Node 2 should be the Live data (uploaded every 1 min)

Currently I have the following datastream parameters mapped out (awaiting feedback from SolaX on exact datastream parameters)
Historical datastream
1: Solar Today
3: Solar Month or Year ?? (System to new to know yet)
5: Solar Month or Year ?? (System to new to know yet)

Live datastream
1: PV1 Current
2: PV2 Current
3: PV1 Voltage
4: PV2 Voltage
5: Grid Current
6: Grid Voltage
7: Grid Power
8: Inner Temp
9: Solar Today
10: Solar Total
11: Feed In Power
12: PV1 Power
13: PV2 Power
14: Battery Voltage
15: Battery Current
16: Battery Power
17: Battery Temp
18: Battery Capacity
19: ???
20: Solar Total 2

42: Energy to Grid
43: Energy from Grid

51: Grid Frequency

54: EPS Voltage
55: EPS Current
56: EPS VA
57: EPS Frequency

63: ???
68: ???
69: Status

Step 7 - hass.io part 2
Create Solax datastream read sensors under your sensor: section in configuration.yaml and add the following

  • platform: rest
    name: Solax Live
    resource: http://INVERTERIP/api/realTimeData.htm
    value_template: ‘{{ value[102:1000] | replace(“Status:”,"") | replace("]","") | replace("}","") }}’
    scan_interval: 60

  • platform: rest
    name: Solax History
    resource: http://192.168.2.15/api/historyData.htm
    value_template: ‘{{ value | replace("[","{") | replace("]", “};”) }}’
    scan_interval: 60

!!! You may need to run your value_template via the “Developver tools” Template section – took me some time, but the above works for me !!!

Step 8 - emoncms part 2
Create emoncms feeds based on the inputs that should now have been created
Take note of the feed ID’s

!!! I found it easier to edit the input description before creating the feeds as this will become you sensor name i.e sensor.emoncms_pv1_current !!!

Step 9 - hass.io part 3 - Create emoncms sensors in hassio
I have setup specific sensors from the datastream i want and are a usefull examples
I have also done some additional renaming based on the feedid passed from emoncms as i did not like having sonsor.emoncmsx_xxx_xxxxxx

Add the following into your sensor: section
!!! Replace the include_only_feed_id: sections with the feedid’s for the sensor you want from emoncms
!!! Replace the sensor_name: with each ID you want and add a freindlyname !!!
!!! I have split into different sections for the unit of measure otherwise all will come in as “A” !!!

  • platform: emoncms
    api_key: Your Read emoncms API Key
    url: https://emoncms.org
    scan_interval: 30
    id: 2
    unit_of_measurement: “”
    include_only_feed_id:

    • 222533
      sensor_names:
      222533: “Inverter Status”
  • platform: emoncms
    api_key: Your Read emoncms API Key
    url: https://emoncms.org
    scan_interval: 30
    id: 2
    unit_of_measurement: “W”
    include_only_feed_id:

    • 222533
    • 222528
    • 222524
    • 222529
    • 222530
      sensor_names:
      222533: “Battery Power”
      222528: “Grid Usage”
      222524: “Grid Power”
      222529: “PV1 Power”
      222530: “PV2 Power”
  • platform: emoncms
    api_key: Your Read emoncms API Key
    url: https://emoncms.org
    id: 2
    scan_interval: 30
    unit_of_measurement: “A”
    include_only_feed_id:

    • 222519
    • 222520
    • 222522
    • 222532
      sensor_names:
      222519: “PV1 Current”
      222520: “PV2 Current”
      222522: “Grid Current”
      222532: “Battery Current”
  • platform: emoncms
    api_key: Your Read emoncms API Key
    url: https://emoncms.org
    id: 2
    scan_interval: 30
    unit_of_measurement: “%”
    include_only_feed_id:

    • 222539
      sensor_names:
      222539: “Battery Capacity”
  • platform: emoncms
    api_key: Your Read emoncms API Key
    url: https://emoncms.org
    id: 2
    scan_interval: 60
    unit_of_measurement: “V”
    include_only_feed_id:

    • 222523
    • 222538
    • 222521
    • 222531
      sensor_names:
      222523: “Grid Voltage”
      222538: “PV1 Voltage”
      222521: “PV2 Voltage”
      222531: “Battery Voltage”
  • platform: emoncms
    api_key: Your Read emoncms API Key
    url: https://emoncms.org
    id: 2
    scan_interval: 60
    unit_of_measurement: “°C”
    include_only_feed_id:

    • 222525
    • 222534
      sensore_names:
      222525: “Inner Temp”
      222534: “Battery Temp”
  • platform: emoncms
    api_key: Your Read emoncms API Key
    url: https://emoncms.org
    id: 2
    scan_interval: 30
    unit_of_measurement: “kWh”
    include_only_feed_id:

    • 222526
    • 222527
    • 222535
      sensor_names:
      222526: “Total Energy Today”
      222527: “Total Energy”
  • platform: emoncms
    api_key: Your Read emoncms API Key
    url: https://emoncms.org
    id: 2
    scan_interval: 30
    unit_of_measurement: “Hz”
    include_only_feed_id:

    • 222536
      sensor_names:
      222536: “Grid Frequency”

Step 10 - Save & Reboot

You should now have the individual sensor added to the top of your home page, If using then I suggest putting into a group as its a lot cleaner looking

45

Here is the yaml formated code: Solax hassio yaml.yaml (3.6 KB)

matthewjporter this is a really interesting work i’ will try on my inverter to see.

My question is. The flow of the process is : Take data from Solax inverter --> send to emoncms --> get data from emoncms ->> and finally convert these data for hassio.

Why we can not do simply this flow: Take data from Solax inverter–>> convert the data for Hassio.

is emoncms really needed ?

**

Hi Andreas68,
i can reach my inverter via ip/api/realTimeData.htm,
but when using your html page (with styles.css), it says “no connection”.
i’ve opened your html page (changed only my inverter’s ip), with firefox and chrome (on a mac),
but it still give me the “no connection” error, and can’t get data out.
Thank you

The reason is the high web security of the Browsers. My html page uses a data access with javascript (not directly if you type the URL into the Browser). This cross Access is a security risk. So you Need to decrease the security Level of your browser. For Chrome you have to start Chrome with “–disable-web-security” Parameter.

ok thanks, i have trouble anyway also opening chrome and disabling web security.
could you explain how to manipulate the data obtained from http://ipinverter/api/realTimeData.htm ?
i was thinking, that i could do a simple “curl http://ipinverter/api/realTimeData.htm” and with some greps and logic operator, i could extract those value and put them into right field (battery percentage/ current/ voltage etc etc).
Thank you!

Hi marcosun

Sorry for the delay in responding, I have been overseas on work

As far as I know it has to do with the stream that comes from the inverters and hassio does not have a component to convert it whereas emoncms not only can understands it, but also has the component for hassio that presents senors and the data

It would be great if someone out there could write the “Solax” component for hassio as I would like to keep my data in house especially now they have decided to move to a paid model per feed, although not to expensive would still like to be local or if we could install emoncms into hassio and run locally, but I have not found a way to do this unless I go for a separate PI or run full homeassistant

No it’s not. I used node-red. I’ll tidy up the code and post it in the next few days. Thanks to all above for the info provided so far!

Update! Code put under this post:

You need to install node-red and have an MQTT broker. There may be a better way of doing it but I’m really not that great with code.

2 Likes

I have a Solutronic solplus 100 inverter which is also connected through ethernet to the router. Would I be capable of using the same approach for that or how should implement it in my system.
It has a static IP address and there is an app integration to the phone presenting the data from the inverter.

Hi @Rasser,

you may be able to. You need to find the url for the JSON object. If you look at the code on the other post (referenced above), it has a URL. if you type that in a browser and get a JSON string back, you can use this code. If there is no JSOn string, you’ll need to find a Url that works on your inverter to pull the data from.

I don’t know how people find those kinds of API’s unless it’s trial and error…

Hi , someone of you maybe know how many data, Solax Hybrid send to the Solax Portal each time . I suppose every 5 minutes. thanks

Min is every 5 min

Hi, thanks, but i mean, how many data it sends? in byte or kbyte

Having just installed a new Solax X1 Boost inverter, I tried all the different methods to access the json data url.

It seems that Solax has changed this and to access it now you need to be connected to the inverter wifi and use the following url:

http://5.8.8.8:80/?optType=ReadRealTimeData

This will give a json response like this:

{“type”:“X1-Boost-Air-Mini”,“SN”:“XXXXXXXXXX”,“ver”:“2.32.6”,“Data”:[0.0,0.0,60.8,124.8,0.0,247.8,0,32,2.6,25.1,0,0,10,0.00,0.00,0,0,0,0.0,0.0,0.00,0.00,0,0,0,0.0,0.0,0.
00,0.00,0,0,0,0.0,0.0,0,0,0,0,0,0,0,0.00,0.00,0,0,0,0,0,0,0,49.98,0,0,0,0,0,0,0,0,0,0.00,0,8,0,0,0.00,0,8,2],“Information”:[3.000,4,“X1-Boost-Air-Mini”,“XXXXXXXXXXXXXX”,
1,3.24,1.09,1.10,0.00]}

I have removed the serial number for the wifi adapter and inverter.

Data appears to be in same format as here: https://github.com/GitHobi/solax/wiki/direct-data-retrieval

1 Like

Hi All

There is now a solax component in homeassistant, I am currently testing it out.

Looks to only support one inverter, although more can be included but it does not distinguise between the different inverters

I have posted an issue regarding one of the sensor reading being wrongly identified but its a very good start

As its included as a component, noy yaml sensor entries etc, just 3 lines on the config and a few in a template

1 Like

Hello!

Since a week I got my Hybrid inverter running. I´m using the pocket Wifi from Solax and I can´t get it to work with HomeAssistant. It seems the inverter is only accessible thru its on Wifi. What am I doing wrong? I don’t get any data except with the local login from the cloudapp. Help!

BR

/Reik

so you have attached it to your wifi - right
you can connect to the web interface and see firmware, modle etc - right
you can log into the solax online portal and getting al your inverter stats - right

Can you goto http://INVERTERIP/api/historyData.htm & http://INVERTERIP/api/realTimeData.htm

I can login to 5.8.8.8. if connected to the inverters WiFi. But I get nothing on the http://5.8.8.8:80/?optType=ReadRealTimeData or with the IP from my own network. The firmware of my Pocket WiFi is 2.33.7 and I believe the api is changed or removed.

@4x4falcon is it possible to connect the inverter to your home wifi and still access the API?