Hi. I’ve managed to connect to the Wifi dongle directly, without any extra work, config or firmware changes, although I suspect it might not work for everyone: Solax X1 Hybrid G4 (local & cloud API)
No, it does not work for me. When I execute the curl command the response I am getting is “curl: (52) Empty reply from server”.
* Trying 192.168.178.109:80...
* Connected to 192.168.178.109 (192.168.178.109) port 80 (#0)
> POST / HTTP/1.1
> Host: 192.168.178.109
> User-Agent: curl/7.83.1
> Accept: */*
> Content-Length: 39
> Content-Type: application/x-www-form-urlencoded
>
* Empty reply from server
* Closing connection 0
curl: (52) Empty reply from server
My Solax Pocket WiFi stick is a V2 version with firmware version 2.033.20. The inverter is a Solax X1 Mini (X1-2.0-S-D).
@witterholt try the firmware I mentioned 2 posts above, should unlock the api from local network instead of only pocket wifi own ssid.
@dr3am.r, I hesitate to do that because there are users that report that they cannot connect to the dongle anymore after installing this custom firmware.
For now I am using the reverse proxy method described here with a Raspberry Pi 4b that was collecting dust. This works perfectly for now.
@witterholt seems that I dodged a bullet then even though I had same firmware version as the Custom one which is 2.034.06. I did not have a v3 one. For me the proxy variant somehow never worked … working with nginx is not new for me thus, don’t think there were configuration issues (it’s mostly copy-paste anyway), after accessing the dongle ui through the rpi IP:port, I would get the basic authentication pop-up, but after providing credentials (which I know work as I connected to the dongle directly with them), I get some empty response (no page returned). So for me not using another component (rpi) in between, works perfectly.
First off @Doublet thanks for a great write up. Recently had an X1 G4 installed on firmware 3.003.02 and followed your instructions to get proxy set up. Which worked great.
However, adding solax integration didnt work, cant do in yaml anymore and when I added integration it just hangs trying to configure inverter, wont install.
I managed to get some sensors set up looking at what @reinhard.ruemer did… Then I thought the mapping for the data must be in the Solax Power integration code, so looked at that and noticed the set-up is same (i.e. the api call is to ‘optType=ReadRealTimeData&pwd=SX…’)… Andf thought… thats odd, why would it work from curl not the integration if its the same call??..
Anyhow did a little debugging and turns out there is some issue in the discovery loop of the integration (its actually in the solax lib it uses) so I crated a custom_integration from the Solax Power one, just taking out the discovery loop and telling it to add X1 G4 only… and it WORKS!!!
So got Solax Power integration set up… my wifi dongle IS connected to wifi (internet) AND it still exposes its own access point which is what I connected to for this revers proxy set up… It gives me the data AND sends to solax cloud… Which got me thinking could I connect the now working integration to the inverters IP directly and skip the revers proxy… answer YES!!!
Am I just lucky that my wifi dongle on V3 firmware just works?? or is it it appeared to not work for others due to the Solax Power bug on firmware v3?
nice job. would you mind sharing the custom integration you made? is it on github?
I also connected my dongle to the solaxpower website, and I am also still getting the reads locally - so both works.
Not uploaded it yet, can do… but don’t you have the X3?
I’ve literally got it only configuring the X1 G4 instead of doing inverter discovery… Not got round to fully debugging the real issue yet. Will take a look
Ok I took a look at the lib and ran it locally to check for errors… its NOT erroring… it just takes forever… it runs through every inverter one at a time and uses aiohttp with no timeout set, which defaults to 5 mins. I’ve made it 5 seconds and allowed all the inverters back. So theoretically should work for any supported inverter again now…
Wanna give it a go?
Uploaded to git
If it works I’ll look into a PR
i’ll try to have a look at it over the weekend to see if it also works with my X3
So, i tried your custom_component on the weekend but it didn’t work with my X3. I noticed a different error message, though:
Using the original HA-Component, I get a “Unexpected Error” but with your custom component it also takes a while and tries to connect but then throws a “Connection Failed” in the HA-Frontend. I am certain the IP and Password were correct since I double checked it and also tried via command line. Maybe the X3 is indeed differnt.
I’m no sure where I found the code below online, but it has been working fine for me for the last few weeks to get the data from my Solax Pocket WiFi, without having to setup any reverse proxy or another intermediate device. It goes in my sensors.yaml file.
- platform: rest
name: solaxx1data
resource: http://192.168.1.77/?optType=ReadRealTimeData # Local IP of Solax Pocket Wifi
method: POST
headers:
X-Forwarded-For: 5.8.8.8
scan_interval: 5
timeout: 4
value_template: 'OK'
json_attributes:
- type
- SN
- ver
- Data
- Information
and then you can use something similar to the below to get the data.
- platform: template
sensors:
solaxx1_energytoday:
friendly_name: SolaxX1 ENERGYTODAY
unit_of_measurement: "kWh"
value_template: >
{% if is_state('sensor.solaxx1data', 'unavailable') %}
{{ states('sensor.solaxx1_energytoday') }}
{% else %}
{{ state_attr("sensor.solaxx1data", "Data")[8] }}
{% endif %}
icon_template: mdi:home-lightning-bolt-outline
device_class: "energy"
attribute_templates:
state_class: total_increasing
time_stamp: >
{{ now() }}
Correct! I am in the process of converting this system to this shortcut
I stopped using the inverse proxy setup, there is a more simple solution: Solax X1 Boost Air Mini : local data
Does a 2nd Raspberry PI need to be setup?
Why can not the HA PI be connected to its Ethernet and have a WIFI connection to the Pocket Wifi on the Solax.
Then just put the IP address of 11.11.11.1 to connect to Pocket Wifi on the solax and get the data.
Try to parse the password (which is the serial number of your inverter) within the curl command: curl -d “optType=ReadRealTimeData&pwd=S*********” -X POST http://192.168...
This works on my inverter, also with firmware 3.001.02.
What changes for Pocket Wlan with Firmware 3.001.02
My Pocket Wlan Stick I bought in 2023 has Firmware 3.001.02 and that means a few configuration changes:
- Instead of IP 5.8.8.8 the AP will be accessible via http://192.168.10.10 (at least in my case). This need to be adopted for file /etc/nginx/sites-available/solax.conf
- When reaching the sticks landing page, login credentials are
admin
for username andS*********
for Password (actually the Serial number you find on the stick and which is represented in the AP-ESSID, too.
With these little changes the access works as outlined in this superior tutorial above by @Doublet . Thanks @Doublet for writing this up.
greetings
i have been watching this thread because inhave just bought a Pi4. i have installed HAOS. learning is a big curve. please help…
i have a solax inverter. it doesnt have any dongles or wifi cards or cables other than…
there is a tp-link wifi AP connected to the solax LAN port and the tp-link wifi is connected to my wlan with my router as the gateway
i have never seen an SSID being brodcast from the inverter
how do i connect to the web GUI of the inverter and set it all up to work with HAOS
i am 56 and a beginner, learnt a lot to get here so hopefully you will be gentle and helpful
Hey mate, was this done using Hass OS on the raspberry pi?
I used a separate Raspberry pi.