SolaX inverter Wifi Reverse Proxy setup

Hello,
I’m trying the Reverse Proxy Setup on a machine with Home Assistant Operating System and I’m stuck in the reverse proxy setup.
So far I managed to connect my wlan to the solax using the ui. I can get the curl command to work and I get a nice json result.
Since I cannot get the shell commands to work I tried it with the NGINX Add on but there I’m lost.

  • ifconfig does not show the wlan device at all, although i can curl the inverter
  • i added the solax.conf to /share/nginx_proxy directory
    The integration shows a connection failed (Verbindung fehlgeschlagen) error if I try it with the rpi IP

Does anyone of you have an idea? Is it possible with Home Assistant Operation System at all?

Do you see any mqtt messages from the pocket wifi ?
on the rpi type:

mosquitto_sub -t "#" 

look for any messages from the pocket wifi

Make sure you have the pocket wifi’s network/router set to the IP address of the rpi

Thank you for the suggestion. I tried this but the pi did not recognise the command:
mosquitto_sub
Note that the pi is running NGINX to connect the pocket wifi IP (5.8.8.8) with my local network on IP 192.168.68.121. My HA is running on a VM on a Synology NAS.
I do get a json response using the command:
curl -d 'optType=ReadRealTimeData&pwd=MYPOCKETPWD' -X POST HTTP://PI-IP

I also tried the command
mosquitto_sub
on the HASSIO terminal but again it was not recognised

mqtt is how the pocket wifi communicates with the solax servers and uploads your solar data, my way of doing it is to interrupt the mqtt messages, basically redirecting the messages to my pi…
You need to installed mosquitto to receive mqtt messages then:

apt-get install mosquitto mosquitto-clients

OK, I’ll try this when I’m back from work.
Thanks Davo

Where did you find information/documentation on what data point maps to what? Or, where can I find the API documentation for Solax inverters? I failed to find one!

[EDIT]
I have a bit of time to contribute to a fix upstream.

Right, I installed mosquitto and ran
mosquitto_sub -t "#"
My pi just hangs. No response at all. I had to Ctrl-C to get back to the prompt.
Any further ideas? My ‘curl’ command referred to in #42 above is still my most successful approach

Sent this reply to wrong person (Newbie :frowning: ) Sorry

Right, I installed mosquitto and ran
mosquitto_sub -t "#"
My pi just hangs. No response at all. I had to Ctrl-C to get back to the prompt.
Any further ideas? My ‘curl’ command referred to in #42 above is still my most successful approach

Thank you. Your approach is the only way I have succeeded in getting data from X1 to HA. One thing though, my json data points are different to yours? For instance, you add together [6]+[7]+[8] to get live power. I have this in a single data point from the string json[2]?

I don’t have any official API or ducumentation. I identified the values by comparing the inverter values on the display (net, and input values) to the readings of the wifi dongle. They are for each string the current, power, frequency, pv-voltage, and the daily energy as well as lifetime production.

5007 for example ist the frequency 50,07 Hz or 3976 would be the Voltage of one string beeing 397,6 Volt

Yes, this is because I have an X3 with 3 Phases, so I have to add up the power of each phase. The X1 is a single phase inverter, so only one power-value. Thats fine

That all makes sense. I am the same, identifying values from the inverter display. Thank you for your posts on this.

Hello, I have just ordered a SolaX Inverter & Battery Bundle and also ordered the wifi dongle to go along side. I wasnt aware of the problem with not being able to connect the Solax integration directly to the HA integration. I read this article where someone has put a custom firmware back on the dongle to allow that local API. Has anyone tried this?
Firmware modified for Solax Pocket WIFI V2 - ChriSoft

1 Like

I found the problem and a workaround:
the problem is actually that my inverter is not yet supported because it is a Solax X3-Hybrid-G4
The workaround is to skip the solax integration and manually add a rest call to the configuration. A working rest call can be found at Support for X3 Hybrid G4 · Issue #80 · squishykid/solax · GitHub last entry by WikiHA

1 Like

Works great! Thank you very much!

Has anyone had any sucess with the reverse proxy using Firmware 3.001.02, and connecting to HA?

I have the RP set up, and can connect to the Solax X1 Hybrid G4 via a web browser, and see the admin pages.
However, I can’t seem to get HA to connect.

The RP is seeing requests from HA

192.168.0.11 - - [02/Dec/2022:17:22:24 +0000] "GET /api/realTimeData.htm HTTP/1.1" 502 173 "-" "Python/3.10 aiohttp/3.8.1"
192.168.0.11 - - [02/Dec/2022:17:22:28 +0000] "POST /?optType=ReadRealTimeData&pwd=XXXX& HTTP/1.1" 502 173 "-" "Python/3.10 aiohttp/3.8.1"
192.168.0.11 - - [02/Dec/2022:17:22:31 +0000] "POST /?optType=ReadRealTimeData&pwd=XXXX& HTTP/1.1" 502 173 "-" "Python/3.10 aiohttp/3.8.1"
192.168.0.11 - - [02/Dec/2022:17:22:34 +0000] "POST /?optType=ReadRealTimeData&pwd=XXXX& HTTP/1.1" 502 173 "-" "Python/3.10 aiohttp/3.8.1"
192.168.0.11 - - [02/Dec/2022:17:22:37 +0000] "POST /?optType=ReadRealTimeData&pwd=XXXX& HTTP/1.1" 502 173 "-" "Python/3.10 aiohttp/3.8.1"
192.168.0.11 - - [02/Dec/2022:17:22:40 +0000] "POST /?optType=ReadRealTimeData&pwd=XXXX& HTTP/1.1" 502 173 "-" "Python/3.10 aiohttp/3.8.1"
192.168.0.11 - - [02/Dec/2022:17:22:43 +0000] "POST /?optType=ReadRealTimeData&pwd=XXXX& HTTP/1.1" 502 173 "-" "Python/3.10 aiohttp/3.8.1"
192.168.0.11 - - [02/Dec/2022:17:22:46 +0000] "POST / HTTP/1.1" 502 173 "-" "Python/3.10 aiohttp/3.8.1"
192.168.0.11 - - [02/Dec/2022:17:23:50 +0000] "POST /?optType=ReadRealTimeData&pwd=XXXX& HTTP/1.1" 504 183 "-" "Python/3.10 aiohttp/3.8.1"
192.168.0.11 - - [02/Dec/2022:17:23:51 +0000] "POST / HTTP/1.1" 200 335 "-" "Python/3.10 aiohttp/3.8.1"
192.168.0.11 - - [02/Dec/2022:17:23:56 +0000] "POST / HTTP/1.1" 499 0 "-" "Python/3.10 aiohttp/3.8.1"
192.168.0.11 - - [02/Dec/2022:17:24:06 +0000] "POST / HTTP/1.1" 499 0 "-" "Python/3.10 aiohttp/3.8.1"
192.168.0.11 - - [02/Dec/2022:17:24:26 +0000] "POST / HTTP/1.1" 499 0 "-" "Python/3.10 aiohttp/3.8.1"


But the config screen returns with “unknown error”.

I gave up for now and went down the REST API road as an interim solution.
(Docmented as a fully worked example).

I’ve tried various curl commands to 5.8.8.8, but can get anything back. Happy to try stuff if anyone has suggestions. The REST API is only updated every 5 minutes, so not great.

I just tried, and now I can connect the solax integration directly to the wifi dongle, no need for nginx proxy. tried both firmware versions provided in link by Chrisoft.

So using the custom firmware from bellow link (for me it worked with 618.00122.00_Pocket_WIFI_V2.034.06_20200921_UNLOCKED.usb)
HA connects directly to the wifi dongle. I get updates about each 30s in official integration.

Modified Firmware for Solax Pocket WIFI V2 - ChriSoft

LE: I switched to REST sensors to local API in HA that update at 1s for more accurate results.

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)