SAJ solar inverter (R5 family) - thoughts


I now have a SAJ Solar inverter of the R5 family (based on pictures…) running in my home since a few days ago. I’ve plugged HA into it in 2 ways that are both limited and somewhat complementary. I thought I’d share what I found can be done and can’t be done (and ask what I’m missing!) for that model, after searching earlier posts and toying with the integrations.

So far as I’ve found, there are 2 ways to connect HA with the solar inverter (or to be specific, with something that gives statistics about the solar inverter…):
1- get limited data locally over WiFi with the standard component
2- get more data from the SAJ remote server with a custom component, in 5-minute intervals

Approach 1 - standard component

With this bit of configuration…

  - platform: saj
    name: solar
    type: wifi
    username: [email protected]
    password: doesntmatter

…I can get some basic data. Something to note is that the access type wifi requires username and password for HA to accept it, but the device doesn’t seem to make any use for it. Opening the URL I see some values, without having to specify authentication in the browser.
Now that data seems to be quite limited. Checking the code for the Python library behind the standard saj platform (pysaj I think it’s called) , there’s nothing provisioned to read for example the current consumption of the house; nor does any value in the raw CSV output from the URL seem to be related with that metric.
So basically, with this approach, I get more or less live power production from the panel via sensor.saj_solar_current_power but not much more (there are of course a few more metrics such as daily accumulated yield and panel temperature). In particular I don’t see the electricity I use or import; only what I produce.

Approach 2 - custom component

Through this custom component, I can connect to the SAJ remote portal. The configuration looks like:

  - platform: saj_esolar
    username: [email protected]
    password: RealPassword
    plant_id: 0
    sensors: saj_sec

This time the credentials matter, and we’re getting data back from the SAJ portal.
Upside: more data is available: electricity used, imported, produced, exported; and the corresponding daily and total aggregated amounts of energy.

Downside: it refreshes only every 5 minutes. The custom component is configured to fetch every 5 minutes, but no point in modifying that: this is how frequently the server pulls data from the installation itself. Pulling more frequently in HA only allows getting the update slightly faster, but there will still be a 5-minute gap between data points. This can be confirmed easily, too: the SAJ app it self has 5-minute intervals between updates. And it’s not an average (at least I think), but rather a snapshot of the situation when the data was pulled by SAJ. This means, if you turn on your coffee machine for a quick coffee and draw 1500W for 3 minutes, there might not be any kind of peak in the data you get from there.

Another downside: the data collection by SAJ is very crude. In the evening when night falls, the last update the local version will give me is usually for a production of 39W, then it stops refreshing as the device goes offline. But the data on SAJ side show that the device is still online and producing 39W steadily for 1 hour after dark. This “ghosting” even causes the daily production aggregate to keep increasing! Only after 1 hour does it decide that the production is now 0, and the device is offline. Another example of crude management: even though I’m still not exporting, I have about 1 instance daily of some electricity reported as exported (with as much as 900W power). And my dishwashed apparently can draw nearly 3000W from the wall plug. Feels like much :thinking:

For illustration, here’s a screenshot of the current version of my PV dashboard – lots to be done still – using both sources.

Does it get better?

With all that in mind I wonder if I’m missing a way to get the complete data (dataset from approach 2) locally. How does SAJ get so much data from the outside? Surely there must be a way to capture this data from within the LAN, too ?! I’m considering a future plan of reconnecting the SAJ box to a raspberry Pi wifi router to capture packets and see what’s happening. I might however not see more than encrypted data…
One thing I’ve noted is that there was not 1, but 2 new IP addresses in my network (which my DHCP server assigned with consecutive numbers, confirming they appeared at about the same time). One of them (the “latest” one) is the one I was able to pull data from with approach 1. The other has a MAC address from some WiFi adapter manufacturer, and has absolutely no port between 0 and 9999 open, from a quick scan. I’m wondering if that’s the device that’s in charge of creating a tunnel for SAJ. In any case I’m not sure how to get more data out of either.

I hope this captures the current situation for future users and/or invites people who have more ideas about getting more local data to comment!


I also have a R5 (which is rebranded as greenheiss, seems SAJ sells them as whitelabel).

I also tried both the scenarios you describe and ended up with the saj_esolar integration you are using.

I think I can explain a bit more how your setup probably works (assuming it is the same as mine).
The R5 inverter can only provide information on the solar production (since that’s what inverters do). The information and consumption comes from an additional appliance (that second IP you see in your network) which is the SAJ SEC Module kit. This kit is a two way electric meter (probably a CHINT) and the actual SAJ module, which read the information from both the meter and the inverter and sends it to SAJ portal.
This pdf explains it in more detail

Unfortunately the SAJ SEC module does not provide any API or any easy way to easily pull information on real time, so you are stuck with polling it through their site. It uses MQTT to send messages to SAJ, but they are unencrypted, so you might be able to hack your way around that.

On a different note, for me that integration ends up putting some readings in the wrong entity (see my bug on what is totalloadpower · Issue #41 · djansen1987/SAJeSolar · GitHub). Does this happen for you as well? I assumed it was because some people there were using the H1 (which supports battery) instead of the R5 but maybe it’s a different reason.


answering a couple more things

it refreshes only every 5 minutes.

The module does support changing this configuration, but honestly I have been a little afraid of touching it. The instructions are not particularly good

This means, if you turn on your coffee machine for a quick coffee and draw 1500W for 3 minutes, there might not be any kind of peak in the data you get from there.

not entirely. you might not see the peak in the load, but the used energy used will be correctly reported. If you are ever without internet, you’ll see that all the unreported energy will appear as soon as it can report back to SAJ.

And my dishwashed apparently can draw nearly 3000W from the wall plug. Feels like much :thinking:

3000w does seem a bit too high. Mine reports 2200W but I mostly use “eco” modes, and it is not constant. It draws most of its power very early and in the end of the cycle.

If you needed real time readings, I suspect you would need to read the data directly from the CHINT meter (through modbus). For me that seems too much work, the SAJ portal so far has been enough for my needs.

Hola Santiago,

That explanation is super useful, thank you!

I think I want to try! I was thinking earlier of resetting the connectivity, via the app, to an ad hoc WiFi network handled by a Raspberry Pi, to eavesdrop on the traffic. Knowing it’s unencrypted gives me hope, as I was thinking it would probably be in vain with just HTTPS packets to be seen.
I’m now wondering though, because I found out that besides the extra new IP (with all the ports closed - would make sense if it only ever pushes messages to SAJ servers), there’s a new WiFi network as well called DTI-Inverter. But based on what you said, if it’s called inverter it probably isn’t linked to the SEC. Also what confuses me even more is that the wifi module is plugged onto the inverter (and the inverter to the SEC, I think, by cable - one that looks like RJ45 but isn’t). This is why I thought that the inverter was doing the sending.

I got confused by the labels too; it doesn’t help that I’m a complete idiot when it comes to electricity. What I see on my side by comparing with the app is that totalLoadPower is the consumption of the house, totalGridPower seems to be the export, totalPvgenPower confusingly is the import, and nowPower is the PV power. I’ve also noticed today, after setting the HA polling to every minute in order to have less delay with the actual times of measurement and avoid situations where I would get the measurements every 10 minutes instead of every 5 because the polling by HA was about the same time as the polling from SAJ, that even though there’s only one “last upload timestamp” , the nowPower metric isn’t always updated at the same time as the other ones, even if they all are spaced 5 minutes apart at a minimum. Lots of strange things.

Interesting. I was wondering if those would be reliable or be based on the 5-minute aggregation as well because calculated on SAJ side. I believe I’ve seen on some occasions that when the panels shut down because of nightfall, the SAJ app keeps seeing a “ghost” production of 30-40W for an hour, and during that time the daily total production keeps growing even though it’s completely dark by then. I will pay attention to this, because it would seem to contradict your statement (and I hope that you’re right!)

Actually I rounded up very liberally, I think, and included the “rest of the house”. I think 2200W may be realistic for just the dishwasher peak.

Thanks again for your insights!

I wasn’t crazy: by 18:00 clearly the real production must have been 0 but the aggregate for the day keeps growing until finally the ghost productions stops:

So I’m not so sure about the reliability of the aggregates…

where is that sensor getting the info from? it does not seem like the regular esolar integration

The top one is from the esolar integration (the one that connects to the remote SAJ server). It’s the todayElectricity entity, which for me at least is exactly identical to pvElec , that is, it’s the daily accumulated solar production curve.
The bottom one is from the other integration (the one that HA bundles in by default, which gets local data with a finer time resolution).

In other news, I’ve bought a cheap WiFi antenna with promiscuous mode support and tried to listen a bit on the Wifi traffic to and from the 2 devices. I’m not very good at that but it does look like both ship data out to SAJ servers, but both on a 5-minute interval – at least by default. I still don’t know if there’s more frequent communication between the inverter and SEC locally, but if there is it’s likely to happen on the RS-485 cable that joins them, and spying on that is out of my league I’m afraid. I’m probably stuck on that front until someone with better skills attempts the same!