Menu

← Back to all posts

Tech

Polling Solis locally without losing the cloud

I wanted faster solar readings in Home Assistant so I could turn on the boiler when there's enough spare solar. Our Solis inverter reports to SolisCloud every five minutes. If a cloud is passing overhead I want to turn the boiler off ASAP in order to not import energy from the grid.

Neyts ZupanNeyts Zupan
Polling Solis locally without losing the cloud

I used the HA Solarman to connect our HomeAssistant to the S2-WL-ST “Wifi Stick” plugged into the Solis inverter via a MODBUS TCP connection on port 502. HomeAssistant started reporting the inverted data with a 30 second resolution, yay!

However, I noticed that the Solis iOS app no longer showed nice graphs and daily/monthly statistics. After some digging around I realised the problem is that the local HA polling completely overwhelms the Wifi Stick and it stops reporting to Solis Cloud.

Multiple rounds of “Figure this out Claude!” returned no viable ways forward, apart from some too-advanced-for-my-taste hardware hacking.

So I started adjusting the local polling frequency. After hours of testing, bumping it up all the way to 10 minutes seemed to have fixed the Cloud upload. But … that’s even worse than relying on Cloud’s 5-minute frequency!

Surely there must be a better way! “Claude fix it or go to jail” didn’t bear any fruits. Then it dawned on me: could we predict when the stick is uploading to the cloud and pause local polling around that time?

Turns out this works brilliantly! Claude made a local checkout of ha-solarman and patched it to monitor the solis-sensor integration that reads data from Solis Cloud. That integration has a timestamp of the last data update in Solis Cloud. So the patch uses this to predict when the upload is gonna happen next, and pause local polling a few seconds before and after.

entity = "sensor.solis_inverter_<serial>_solis_timestamp_measurements_received"
state = self.hass.states.get(entity)
last_upload = float(state.state)
phase = (_time.time() - last_upload) % 300
hold = phase < 55 or phase >= 295

The HA can now poll the Wifi Stick for inverter data every 30 seconds between a 60-second pause that happens every 5 minutes. And the Solis Cloud app keeps on working. Best of both World!

I also tried 15 second local polling but that overwhelmed the Wifi Stick and it started dropping uploads. I also configured ha-solarman to only poll for metrics data on the 30-second rate, but poll for settings and configs on a longer 5-minute rate, as those really don’t change very often. Not more cloud lag, pun intended.

Maybe human intelligence is not completely replaceable just yet?

Neyts Zupan

Neyts Zupan

Neyts is the Digital Overlord of Niteo, poking his nose into any and all technical things.