Solax X3-Hybrid G4 Wifi Firmware Solax module fw version 3.003.02 Home Assistant Integration

We have our new X3 Inverter with Pocket Wifi V3 and Firmware 3.006.04 including this integration up and running now.

But I’m not sure, if I found all parameters (or if some may have changed). Can someone point me out the key entities shown by the solax app?

Specially I‘m looking for the power entities showing the current values in Watt:

  • Photovoltaic power
  • Battery in/out power
  • Inverter power
  • Grid in/out power
  • Home usage power

@nazar-pc made a nice overview with all the solax data fields.

My wifi stick stopped working after a day. It’s not in my wifi nor providing it’s own wifi anymore. Putting the stick off and on the inverter (with some time in between) does not help. Is this may a known problem? Any ideas?

@Doublet: Thanks a lot for the overview!

Mine stopped working today as well. Wifi is still the same, no interferences there.
Solax Cloud still got values, but even my local pings didn’t get a response.
So i added firewall rules to block in and outgoing internet traffic for the device and suddenly all was stable again.
Might have been a coincidence, but i will now leave the solax cloud blocked as i don’t need it anyhow.

I have never experienced problems with the wifi stick and I have also blocked the inverter ip going on the internet. Perhaps not a coincidence?

Guys,

Can someone post a full working configuration here? I have various error messages, from HASS cant get this working. My pocket wifi responding valid data only to curl request, but asking login while trying in the browser. Is this normal?

X3-Hybrid-G4 , pocket wifi v3 fw: 3.001.02 HASS: Home Assistant 2023.3.4 Supervisor 2023.03.1 Operating System 9.5 Frontend 20230309.0 - latest

Curl data output:

“Data”:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,61078,65535,0,0,0,0,0,0,0,0, 0,1,0,4458,256,14614,3605,5891,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,698,0,11,0,0,0,0,0,0,0,0,0,725,0,10,0,0,0,2940,0,3915,0,160,0,1246,0,0,0,0,0,0,0,0,0, 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,257,257,257,257,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],

Yes its normal that it requests the password, did you read the manual in the first post?

add this to configuration.yaml don’t forget to adapt the IP of your solax module amd the password (just read the QR code on the stick)

resource: http://###.###.###.####/                       # IP of solax module
payload: "optType=ReadRealTimeData&pwd=xxxxxxxxxxx"  # replace xxxxxxxxxx with password in whole file

Thanks, yes, I did everything as described:

configuration.yaml https://pastebin.com/5qjgHkMf
templates.yaml https://pastebin.com/aaW5biDy

HASS log is full of with these errors and sensors are not responding:

ERROR (MainThread) [homeassistant.config] Invalid config for [template]: [name] is an invalid option for [template]. Check: template->name. (See /config/templates.yaml, line 315). 
WARNING (MainThread) [homeassistant.components.rest.sensor] REST result could not be parsed as JSON

If I fix the above mentioned errors, than this will came up:

ERROR (MainThread) [homeassistant.helpers.event] Error while processing template: Template("{{ state_attr('sensor.solax', 'Data')[0] | int(default=2300) / 10}}")
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 458, in async_render
    render_result = _render_with_context(self.template, compiled, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2007, in _render_with_context
    return template.render(**kwargs)
  File "/usr/local/lib/python3.10/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/usr/local/lib/python3.10/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "<template>", line 1, in top-level template code
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1788, in forgiving_int_filter
    result = jinja2.filters.do_int(value, default=default, base=base)
  File "/usr/local/lib/python3.10/site-packages/jinja2/filters.py", line 957, in do_int
    return int(value)
jinja2.exceptions.UndefinedError: None has no element 0

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 576, in async_render_to_info
    render_info._result = self.async_render(variables, strict=strict, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 460, in async_render
    raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: UndefinedError: None has no element 0
ERROR (MainThread) [homeassistant.helpers.template_entity] TemplateError('UndefinedError: None has no element 0') while processing template 'Template("{{ state_attr('sensor.solax', 'Data')[0] | int(default=2300) / 10}}")' for attribute '_attr_native_value' in entity 'sensor.solax_l1_voltage'

Can you see Data in the sensor.solax?
Cause this error says your array 0 has no data (jinja2.exceptions.UndefinedError: None has no element 0)

No there is no data, non of the sensors are getting any data.

image

So this tells me that your problem already starts here
This pulls the data and stores it in the sensor solax_rest_data, if thats empty its not pulling anything

Solax REST command online sensor

rest:

  • authentication: digest
    scan_interval: 10
    resource: http://###.###.###.####/ # IP of solax module
    payload: “optType=ReadRealTimeData&pwd=xxxxxxxxxxx” # replace xxxxxxxxxx with password in whole file
    method: POST
    headers:
    Content-Type: “application/x-www-form-urlencoded”
    sensor:
    • name: “solax_rest_data”
      json_attributes:
      • sn
      • ver
      • type
      • Data
      • Information
        value_template: ‘OK’ # dummy value, not used; avoids the “State max length is 255 characters” error

Sorry, pasted wrong entity: The solax_rest showig this:

image

Are there Attributes in there as well or just the ok?

Just OK. Nothing else

Can you post the solax part from configuration?

Sure:

### Solax REST command online sensor ###
rest:
  - authentication: digest
    scan_interval: 10
    resource: http://192.168.1.147/
    payload: "optType=ReadRealTimeData&pwd=MYPASS"
    method: POST
    headers: 
      Content-Type: "application/x-www-form-urlencoded"
    sensor:
      - name: "solax_rest_data"
        json_attributes:
        - sn
        - ver
        - type
        - Data
        - Information
        value_template: 'OK'  # dummy value, not used; avoids the "State max length is 255 characters" error

What curl message do you post to get the data back and whats the full content of your data?
I assume that Wifi 3 is completely different than Wifi2

I have 2 Solax Inverters, 1 works, 1 doesn’t. (SN removed)

X1-Boost/Air/Mini - curl -d “optType=ReadRealTimeData&pwd=xxxxxxxxxx” -X POST http://192.168.1.90

  • Works like a charm

X1-Hybrid-G3 - curl -d “optType=ReadRealTimeData&pwd=xxxxxxxxxx” -X POST http://192.168.1.91
curl: (52) Empty reply from server

  • Wifi Dongle firmware is 2.035.01
    Is the only option using a AP as a client, NAT it and talk directly to the inverter?
  • Is that possible.

Any suggestions would be very much appreciated.

Some questions:
Both Solax Wifi adapaters respond correct when you test with postman or curl?
Did you make 2 integrations into Home Assistant for the 2 adapters, or did you combine them into 1?
If you combined them into 1, how did you do that?
In my opinion the savest way is to do 2 integrations. So you have the code double in Home Assistant and of course the variables need to be seperated.
So you would have “solax_rest_data” as array for the first one and “solax_rest_data_1” for the 2nd and all that needsd to be applied the whole way down in the integration.

Sorry for being unclear, I have only just started using HA and seeing what i can do with it.

I am going to put both inverters into Home Assistant but i was testing the connection first so i jumped into ubuntu and execute the curl command to see if i could get data from the wifi dongles before i integrated.
Solax Inverter 1 which is a X1-Boost/Air/Mini the curl command worked perfectly and i could pull data.
Solax Inverter 2 which is a X1-Hybrid-G3 the curl command returned curl: (52) Empty reply from server (so nothing)
The Hybrid-G3 inverter’s wifi dongle firmware is 2.035.01, as soon as I can get the API to respond from the Hybrid I was going to then integrate them into Home Assistant and look at if i can aggregate the data, although my other thought is to have ubuntu read and dump the data into a local database and then present a single API to Home Assistant with everything and also do some KPI’s as well, not sure until I get that far.
I was just hoping for some help on getting the Hybrid-G3 to be accessable.