Solax X1 Boost Air Mini : local data

okay thanks, I’ll try to get this working with my system I have a X1 Hybrid 4.6kw

1 Like

When I connect to 5.8.8.8 and enter admin / sn … the browser jumps to Connection Refused instead of the IP setup screen… anyone seen this?

I have a X1hybridG3, the code is adapted for this inverter, I don’t know if it’s 100% correct but most of it is.

#########################################################
#                                                       #
#         SOLAX.                                        #
#                                                       #
#########################################################
sensor:

#solaxlocalbegin    
  - platform: rest
    authentication: digest
    scan_interval: 5
    resource: http://192.168.2.50/ 
    payload: "optType=ReadRealTimeData&pwd=XXXXXX"
    method: POST
    headers: 
      X-Forwarded-For: 5.8.8.8
    name: "solax_rest_local"
    json_attributes:
        - type
        - SN
        - ver
        - Data
        - Information
    value_template: 'OK'  # dummy value, not used; avoids the "State max length is 255 characters" error
#solaxlocalend

template:
    - sensor:
#solaxlocalbegin
        - name: solax_local
          state: > 
                {% if not state_attr('sensor.solax_rest_local', 'sn') == "XXXXXXX"  %}{{ now().strftime("%H:%M:%S") }}
                {% else %}{{ (states('sensor.solax_local')) }}{% endif %}
          attributes: 
            sn: >-
                {% if not state_attr('sensor.solax_rest_local', 'sn') == "XXXXXXX" %}{{ (state_attr('sensor.solax_rest_local', 'sn')) }}
                {% else %}{{ (state_attr('sensor.solax_local', 'sn')) }}{% endif %}
            ver: >-
                {% if not state_attr('sensor.solax_rest_local', 'sn') == "XXXXXXX" %}{{ (state_attr('sensor.solax_rest_local', 'ver')) }}
                {% else %}{{ (state_attr('sensor.solax_local', 'ver')) }}{% endif %}
            type: >-
                {% if not state_attr('sensor.solax_rest_local', 'sn') == "XXXXXXX" %}{{ (state_attr('sensor.solax_rest_local', 'type')) }}
                {% else %}{{ (state_attr('sensor.solax_local', 'type')) }}{% endif %}
            Data: >-
                {% if not state_attr('sensor.solax_rest_local', 'sn') == "XXXXXXX" %}{{ (state_attr('sensor.solax_rest_local', 'Data')) }}
                {% else %}{{ (state_attr('sensor.solax_local', 'Data')) }}{% endif %}
            Information: >-
                {% if not state_attr('sensor.solax_rest_local', 'sn') == "XXXXXXX" %}{{ (state_attr('sensor.solax_rest_local', 'Information')) }}
                {% else %}{{ (state_attr('sensor.solax_local', 'Information')) }}{% endif %}
                
        - name: "Solax Inverter Temperature"
          state: "{{ state_attr('sensor.solax_local', 'Data')[52] / 10 | int(default=0) }}"
          unit_of_measurement: "°C"
          device_class: "temperature"
        
        - name: "Solax Energy today"
          unit_of_measurement: "kWh"
          state: "{{ state_attr('sensor.solax_rest_local', 'Data')[13] / 10 }}"
          device_class: energy
          state_class: measurement
          icon: mdi:solar-panel
          
        - name: "Solax Energy Total"
          unit_of_measurement: "kWh"
          state: "{{ state_attr('sensor.solax_rest_local', 'Data')[11] / 10 }}"
          device_class: energy
          state_class: total_increasing
          icon: mdi:chart-line
          
        - name: "Solax DC Voltage 1"
          state: "{{ state_attr('sensor.solax_rest_local', 'Data')[3] /10 | float  }}"
          unit_of_measurement: "V"
          device_class: "voltage"
          
        - name: "Solax DC Voltage 2"
          state: "{{ state_attr('sensor.solax_rest_local', 'Data')[4] /10 | float  }}"
          unit_of_measurement: "V"
          device_class: "voltage"
          
        - name: "Solax DC Current 1"
          state: "{{ state_attr('sensor.solax_rest_local', 'Data')[5] / 10 }}"
          unit_of_measurement: "A"
          device_class: "current"
        
        - name: "Solax DC Current 2"
          state: "{{ state_attr('sensor.solax_rest_local', 'Data')[6] / 10 }}"
          unit_of_measurement: "A"
          device_class: "current"
          
        - name: "Solax DC Power 1"
          state: "{{ state_attr('sensor.solax_rest_local', 'Data')[7] }}"
          unit_of_measurement: "W"
          device_class: "power"  
          icon: mdi:power-socket-de
          
        - name: "Solax DC Power 2"
          state: "{{ state_attr('sensor.solax_rest_local', 'Data')[8] }}"
          unit_of_measurement: "W"
          device_class: "power"  
          icon: mdi:power-socket-de
          
        - name: "Solax AC Output Voltage"
          state: "{{ state_attr('sensor.solax_rest_local', 'Data')[0] / 10 }}"
          unit_of_measurement: "V"
          device_class: "voltage"
          
        - name: "Solax AC Current"
          state: "{{ state_attr('sensor.solax_rest_local', 'Data')[1] / 10 }}"
          unit_of_measurement: "A"
          device_class: "current"
          
        - name: "Solax AC Power"
          state: "{{ state_attr('sensor.solax_rest_local', 'Data')[2] }}"
          unit_of_measurement: "W"
          device_class: "power"  
          icon: mdi:power-socket-de
          
        - name: "Solax AC Frequency"
          state: "{{ state_attr('sensor.solax_rest_local', 'Data')[9] / 100  | float }}"
          unit_of_measurement: "Hz"
          device_class: "frequency"
          icon: mdi:music-clef-treble
    
        - name: "Solax Inverter Operation Mode"
          state: >
           {%   if state_attr('sensor.solax_local', 'Data')[10] ==  0 %}Waiting
           {% elif state_attr('sensor.solax_local', 'Data')[10] ==  1 %}Checking
           {% elif state_attr('sensor.solax_local', 'Data')[10] ==  2 %}Normal
           {% elif state_attr('sensor.solax_local', 'Data')[10] ==  3 %}Off
           {% elif state_attr('sensor.solax_local', 'Data')[10] ==  4 %}Permanent Fault
           {% elif state_attr('sensor.solax_local', 'Data')[10] ==  5 %}Updating
           {% elif state_attr('sensor.solax_local', 'Data')[10] ==  6 %}EPS Check
           {% elif state_attr('sensor.solax_local', 'Data')[10] ==  7 %}EPS Mode
           {% elif state_attr('sensor.solax_local', 'Data')[10] ==  8 %}Self Test
           {% elif state_attr('sensor.solax_local', 'Data')[10] ==  9 %}Idle
           {% elif state_attr('sensor.solax_local', 'Data')[10] == 10 %}Standby
           {% else %}I dont know{% endif %}
      
        - name: "Solax Inverter Nominal Power"
          state: "{{ state_attr('sensor.solax_rest_local', 'Information')[0] | float | round(0) }}"
          unit_of_measurement: "kW"

        - name: "Solax Module SN"
          state: "{{ state_attr('sensor.solax_rest_local', 'sn') }}"

        - name: "Solax module fw version"
          state: "{{ state_attr('sensor.solax_rest_local', 'ver') }}"
        
#        - name: "Solax type"
#          state: "{{ state_attr('sensor.solax_rest_local', 'type') ==  3 %}X1Hybrid-G3 }}"
        
        - name: "Solax Inverter SN"
          state: "{{ state_attr('sensor.solax_rest_local', 'Information')[2] }}"
            
        - name: "Solax Inverter Information"
          state: "{{ state_attr('sensor.solax_rest_local', 'Information') }}"    
            
        - name: "Solax Inverter Data"
          state: "{{ state_attr('sensor.solax_rest_local', 'Data') }}" 
#solaxlocalend
1 Like

Hi, this has been working mostly fine for me so far. Thanks you!

I have a Solax X1-1.1-S-D(L).

I had to make a few adjustments, some because of the different model, but mostly improvements. Or, I think they are improvements, anyway.

  • The SN under json_attributes needs to be lowercase, so sn for my model anyway.
  • The not in the template statements looks like it should not be there.
  • Only sensor solax_local should be using sensor.solax_rest_local it looks like.
    • I assume the solax_local it meant to have live values when solax_rest_local is available and stale values when it is unavailable.
      • or the very least the sensors with device_class: energy?
  • index 52 definetily is not the temperature for my device, index 7 55 seems more likely

The last couple of days HA kept registering the first Solax Energy Total value of each day as part of that days production, which is incorrect. I hope the above changes resolves that issue going forward.

#########################################################
#                                                       #
#         SOLAX.                                        #
#                                                       #
#########################################################
sensor:

#solaxlocalbegin    
  - platform: rest
    authentication: digest
    scan_interval: 5
    resource: http://192.168.1.174/
    payload: "optType=ReadRealTimeData&pwd=XXXXXX"
    method: POST
    headers: 
      X-Forwarded-For: 5.8.8.8
    name: "solax_rest_local"
    json_attributes:
        - type
        - sn
        - ver
        - Data
        - Information
    value_template: 'OK'  # dummy value, not used; avoids the "State max length is 255 characters" error
#solaxlocalend

template:
    - sensor:
#solaxlocalbegin
        - name: solax_local
          state: > 
                {% if state_attr('sensor.solax_rest_local', 'sn') == "XXXXXX"  %}{{ now().strftime("%H:%M:%S") }}
                {% else %}{{ (states('sensor.solax_local')) }}{% endif %}
          attributes: 
            sn: >-
                {% if state_attr('sensor.solax_rest_local', 'sn') == "XXXXXX" %}{{ (state_attr('sensor.solax_rest_local', 'sn')) }}
                {% else %}{{ (state_attr('sensor.solax_local', 'sn')) }}{% endif %}
            ver: >-
                {% if state_attr('sensor.solax_rest_local', 'sn') == "XXXXXX" %}{{ (state_attr('sensor.solax_rest_local', 'ver')) }}
                {% else %}{{ (state_attr('sensor.solax_local', 'ver')) }}{% endif %}
            type: >-
                {% if state_attr('sensor.solax_rest_local', 'sn') == "XXXXXX" %}{{ (state_attr('sensor.solax_rest_local', 'type')) }}
                {% else %}{{ (state_attr('sensor.solax_local', 'type')) }}{% endif %}
            Data: >-
                {% if state_attr('sensor.solax_rest_local', 'sn') == "XXXXXX" %}{{ (state_attr('sensor.solax_rest_local', 'Data')) }}
                {% else %}{{ (state_attr('sensor.solax_local', 'Data')) }}{% endif %}
            Information: >-
                {% if state_attr('sensor.solax_rest_local', 'sn') == "XXXXXX" %}{{ (state_attr('sensor.solax_rest_local', 'Information')) }}
                {% else %}{{ (state_attr('sensor.solax_local', 'Information')) }}{% endif %}
                
        - name: "Solax Inverter Temperature"
          state: "{{ state_attr('sensor.solax_local', 'Data')[55] | int(default=0) }}"
          unit_of_measurement: "°C"
          device_class: "temperature"
        
        - name: "Solax Energy today"
          unit_of_measurement: "kWh"
          state: "{{ state_attr('sensor.solax_local', 'Data')[13] / 10 }}"
          device_class: energy
          state_class: measurement
          icon: mdi:solar-panel
          
        - name: "Solax Energy Total"
          unit_of_measurement: "kWh"
          state: "{{ state_attr('sensor.solax_local', 'Data')[11] / 10 }}"
          device_class: energy
          state_class: total_increasing
          icon: mdi:chart-line
          
        - name: "Solax DC Voltage 1"
          state: "{{ state_attr('sensor.solax_local', 'Data')[3] /10 | float  }}"
          unit_of_measurement: "V"
          device_class: "voltage"
          
        - name: "Solax DC Voltage 2"
          state: "{{ state_attr('sensor.solax_local', 'Data')[4] /10 | float  }}"
          unit_of_measurement: "V"
          device_class: "voltage"
          
        - name: "Solax DC Current 1"
          state: "{{ state_attr('sensor.solax_local', 'Data')[5] / 10 }}"
          unit_of_measurement: "A"
          device_class: "current"
        
        - name: "Solax DC Current 2"
          state: "{{ state_attr('sensor.solax_local', 'Data')[6] / 10 }}"
          unit_of_measurement: "A"
          device_class: "current"
          
        - name: "Solax DC Power 1"
          state: "{{ state_attr('sensor.solax_local', 'Data')[7] }}"
          unit_of_measurement: "W"
          device_class: "power"  
          icon: mdi:power-socket-de
          
        - name: "Solax DC Power 2"
          state: "{{ state_attr('sensor.solax_local', 'Data')[8] }}"
          unit_of_measurement: "W"
          device_class: "power"  
          icon: mdi:power-socket-de
          
        - name: "Solax AC Output Voltage"
          state: "{{ state_attr('sensor.solax_local', 'Data')[0] / 10 }}"
          unit_of_measurement: "V"
          device_class: "voltage"
          
        - name: "Solax AC Current"
          state: "{{ state_attr('sensor.solax_local', 'Data')[1] / 10 }}"
          unit_of_measurement: "A"
          device_class: "current"
          
        - name: "Solax AC Power"
          state: "{{ state_attr('sensor.solax_local', 'Data')[2] }}"
          unit_of_measurement: "W"
          device_class: "power"  
          icon: mdi:power-socket-de
          
        - name: "Solax AC Frequency"
          state: "{{ state_attr('sensor.solax_local', 'Data')[9] / 100  | float }}"
          unit_of_measurement: "Hz"
          device_class: "frequency"
          icon: mdi:music-clef-treble
    
        - name: "Solax Inverter Operation Mode"
          state: >
           {%   if state_attr('sensor.solax_local', 'Data')[10] ==  0 %}Waiting
           {% elif state_attr('sensor.solax_local', 'Data')[10] ==  1 %}Checking
           {% elif state_attr('sensor.solax_local', 'Data')[10] ==  2 %}Normal
           {% elif state_attr('sensor.solax_local', 'Data')[10] ==  3 %}Off
           {% elif state_attr('sensor.solax_local', 'Data')[10] ==  4 %}Permanent Fault
           {% elif state_attr('sensor.solax_local', 'Data')[10] ==  5 %}Updating
           {% elif state_attr('sensor.solax_local', 'Data')[10] ==  6 %}EPS Check
           {% elif state_attr('sensor.solax_local', 'Data')[10] ==  7 %}EPS Mode
           {% elif state_attr('sensor.solax_local', 'Data')[10] ==  8 %}Self Test
           {% elif state_attr('sensor.solax_local', 'Data')[10] ==  9 %}Idle
           {% elif state_attr('sensor.solax_local', 'Data')[10] == 10 %}Standby
           {% else %}I dont know{% endif %}
      
        - name: "Solax Inverter Nominal Power"
          state: "{{ state_attr('sensor.solax_local', 'Information')[0] | float | round(0) }}"
          unit_of_measurement: "kW"

        - name: "Solax Module SN"
          state: "{{ state_attr('sensor.solax_local', 'sn') }}"

        - name: "Solax module fw version"
          state: "{{ state_attr('sensor.solax_local', 'ver') }}"
        
        - name: "Solax Inverter SN"
          state: "{{ state_attr('sensor.solax_local', 'Information')[2] }}"
            
        - name: "Solax Inverter Information"
          state: "{{ state_attr('sensor.solax_local', 'Information') }}"
#solaxlocalend
2 Likes

Should this also work with a cabled connection instead of wifi?

I have a X1 also, but so far no luck getting data. I look up the status of the entities I get the current time under sensor.solax_local. (and ‘null’ for all the attributes)

No I believe this only works for WiFi connection, for cable connection use the Modbus solution.
There are many suggestions: Universal Solar Inverter over Modbus RS485 to MQTT (Formally SolaX No Pocket WiFi)

1 Like

I have an X1 Boost, working well with this integration. I also have the CT clamp, so am using the line below:

### Grid power (positive for feed-in, negative for consumption) ###
        - name: "Grid Power"
          state:  >
            {% if state_attr('sensor.solax_rest_local', 'Data')[48] > 32767 %}{{ 65536 - (state_attr('sensor.solax_rest_local', 'Data')[48]) }}
            {% else %}
              {{ state_attr('sensor.solax_rest_local', 'Data')[48] *-1 }}
            {% endif %}
          unit_of_measurement: "W"
          state_class: measurement
          device_class: "power"
          icon: mdi:transmission-tower

Which works fine during the day, but at night, when the Solax inverter goes into partial sleep (waiting), then the results of this are randomly incorect, usually being about 200W too low. I can still curl and get the results back, but the numbers are off. Anyone have any idea whats going on please?

This worked great for my solax x1-5.0-t-d(l), Direct access using @Doublet guide and then used @Darsstar tweaks. #legends thank you :ok_hand:t2:

1 Like

greetings

i am.a beginner, 56, and installed HAOS and getti g to grips with it.
have a quesrion regarding this setup please…

i currently get two revenue streams.from my solar installation. one for grid balancing and one for export electricity. both rely on the SOLAX X1 nverter connected via a tp-link Wifi AP connected to LAN port of the inverter. the inverter communicates it work to Social Energy who track export and battery grid balancing

if i disable internet access (no idea hwoto) will the inverter not be able to communicate its work? does integrating solax into HA not jepordise my revenues?

It is not a requirement to block the internet acces of the Solax. It is a privacy option.

Ah I see. Do you know how I might access the Solax X1. As I say, it has a TP-link AP connected via LAN. In the TP-link web GUI I see it has given a DHCP address to 192.168.1.17 (that’s the only device listed so it must be the Solax?). If I ping that address I get responses but if i try to log into that address using a browser on a laptop connected to the TP-link AP wirlelessly, I get nothing.
The Solax integration isn’t that helpful with the documentation and I’ve no idea if or how the code can be read to work it out.

That is correct. Just use this ip address as explained above. Make sure this address does not change, if you can give it a fixed ip-address in the router.

sorry,but need help here, big time…we all started somewhere!

so what Ip address are you referriing to? if the address is not on 192.168.0.0/24 then my router wont see it. there are no clients listed on router connection table other than known clients to me …EXCEPT something advertising itself as druNNNNNN where N os some fixed number. but i cannot connect over 80 8080 or 443 to that device using a browser. …just times out.

by the way, i am. ot using the solax wifi dongle, but a tp-link AP … that’s how it was installed by solar energy UK…and i can see all export and import on their app.

please help with some insightful instructions

First you need to take a deep dive in your home wifi network, try to understand it. Locate the router, find the DHCP section and look for the IP addresses.

??? I do know my network and I am saying that I have tried to connect to the IP at port 80 but nothing. The issue is not that I do not know my network or devices connected and interfaces, but that there is no response on port 80 or 443 or 8080 on the IP that I perceive is the inverter. So something else needs to be tried and I do not know what - that is what I was asking for, the help to move forward with this.

Good, it is normal that you do not get a response via port 80 443 or 8080.

To read the data you use the instructions and get the data in HA, or do a manual check via the terminal:

curl -d “optType=ReadRealTimeData&pwd=XXXXXX” -X POST http://192.168.1.192

change ip address of course

1 Like

perfect. THANKYOU. I shall try tomorrow and feedback.

Nope, that failed. Just hung, no output, until Ctrl-C

curl -d “optType=ReadRealTimeData&pwd=XXXXXX” -X POST http://192.168.0.123

This is strange.
Because when I connect to my router on its WiFi SSID, client 192.168.0.134 is the device named “dru10001300” which is the inverter??
But
When I connect to the TP-Link’s WiFi SSID and go to its Web GUi, there are no connected clients listed. The TP-link is a TL-MR3020 running in Repeater/Bridge and is connected to the inverter via an eth cable.
Very confusing. What am i doing wrong - any ideas please/

Just checking: did you replace the XXXX with the Serial number ? :wink:
Are you still struggling to find the Solax ip-address? From your first post it looks as if it was 192.168.1.17 ?
Is your HA is on another sub domain 192.168.0.xxx ? Suggest to put both in the same domain.

thanks for striving with me ha
ive no idea what the serial number is is the inverter the dru_XXXXX thats what is on the routers client list , and it disappeared when u turned off the tplink connected to its lan port

?