PV Data from Solarman WiFi logger - with API

I think the answer is Yes, and No…

Thank you for the link - I had not seen that one, and it is very informative. Another way of getting data by proxy between the logger and the cloud. Good solution (keep both, no extra hardware) if you can get it to work.

My direct experience is with an old (probably V2) LAN connection data logger. This has an older interface with connectable server ‘B’, as well as an internal (and settable) Modbus port. Both of which I have been able to use (push out data, connect Modbus over TCP). Incidentally, my stick pushes out a data block of 250 bytes, which does not compare with any of the more recent data block lengths at all. Since Solarman (Solis) updated their cloud offering a few months ago, my stick has connection issues and locks up after a few minutes, only coming back around every three hours. Clearly an issue with it not managing the (V5) heartbeat and keep alive messages.

I also have a newer version (V4?) stick which does not want to connect to the inverter, but has the later web pages, where the server ‘B’ does not work and neither does the config_hide stuff. As it won’t connect to the inverter I cannot use it let alone effectively test the settings. I also only have LAN sticks, which are quite different to the WiFi ones, although the later LAN stick assumes it is a WiFi model and wants SSIDs, even though it is a LAN stick and has no physical WiFi.

The latest protocol, V5, is becoming better documented. I also found this

https://pysolarmanv5.readthedocs.io/en/latest/index.html

As far as I can tell, Solarman have always used ‘Modbus over TCP’ in one form or another to connect to the cloud. Now (V5) use Modbus (over TCP) data packets, which are encapsulated into a proprietary message set (both message package and message sequences). The WiFi modules use chipsets that work to port 8899 by default, and older ‘open’ ports have been removed from the firmware settings.

I think the short answer is, yes you can get to the data via TCP connection, on port 8899. The IP address is a local (private) one, so probably should reflect the IP address of your stick. However, I suspect that a) this is encapsulated in the V5 protocol, and b) it appears it does not work with Solis S3-WIFI-ST. A guess is that some brandings (eg Solis) have complicated the setup even further!

All somewhat confusing, difficult to work out what is going on, what any particular stick actually is/does, and challenging to connect to. After months of working on this I have now given up on all my sticks, turned it off, and gone down a direct physical connection to the inverter RS485 port to connect directly with Modbus (over TCP via a serial-ethernet adaptor).

I wish you every success in your endeavours!

Hi again,

the WiFi Stick has a setting for the inverter make on the config_hide.html page. At the very bottom is a selection between Deye and Sofar, maybe you need to select a different make there with the newer stick you have ? The IP address is not from my local LAN, it shows as IP Address of the WiFi AP. It looks to me the AP is only used for the initial setup via the phone app. I did not have a chance yet to connect a device to it but I shall try that with a R-Pi next week. I have not yet been successful with the Node Red implementation, I cant seem to change the server IP address or at least nothing shows up on the Node Red debug output. I have to do some packet sniffing on the router to see if it actually send anything to my Node Red server, so far IDK if the issue is the Node Red implementation for this or if the Stick actually ignores anything I enter for the server. I think this will be a bit of a longer project. There was also a mentioning of simply parsing the output of status.html but that reveals only very little useful information.

I keep at it anyway.
Regards
Jan

PS. The firmware version on the WiFi Stick is LSW3_15_FFFF_1.0.78

Hello Ronald. Thanks for this but I get an error message when entering the curl command in step 2:
{
“code”: “2101006”,
“msg”: “invalid param”,
“success”: false,
“requestId”: “e25e55fec6exxxxx”
}

I have checked the different input without success. Any idea?

Hello, sorry for reviving an old Post.
I found this in my search to integrate my Sofar ME3000SP.
I have the API and also followed the instructions. Then I used your Config.yaml, but is does not read any data.

I see all the sofar entities but no values. I just can’t get it working.

Check out my post here, it runs you through exactly what you want as I have the Same Battery Inverter:

and here:

First, thanks for your reply and time you take to guide le in the correct direction.
Now I’m completely lost. :upside_down_face:

1st tried to set this Sofar up using the HACS module from Stephan Joubert

And from the issues I found out that I was not the only one not getting data. This does not require an API, correct?

2nd try, is the online API from Skully that I found (and also incorporated your findings)

Got the API info this week so started around noon playing around with the received info.

My JSON info that I get from JSON Path Finder

{
	"code": null,
	"msg": null,
	"success": true,
	"requestId": "f15ee17e81fcd340",
	"deviceSn": "2104559628",
	"deviceId": 213282644,
	"deviceType": "COLLECTOR",
	"deviceState": 1,
	"dataList": [
		{
			"key": "SN1",
			"value": "2104559628",
			"unit": null,
			"name": "Embedded Device SN"
		},
		{
			"key": "MDUv1",
			"value": "ME_08_2701_2.06",
			"unit": null,
			"name": "Module Version No"
		},
		{
			"key": "WORK_TIM1",
			"value": "693089",
			"unit": "s",
			"name": "Total running time"
		},
		{
			"key": "OFFSET_TIM1",
			"value": "0",
			"unit": "s",
			"name": "Offset time"
		},
		{
			"key": "SEND_PERIOD1",
			"value": "5",
			"unit": "Min",
			"name": "Data Uploading Period"
		},
		{
			"key": "COLLECT_PERIOD1",
			"value": "60",
			"unit": "s",
			"name": "Data Acquisition Period"
		},
		{
			"key": "max_conn_n1",
			"value": "2",
			"unit": null,
			"name": "Max. No. of Connected Devices"
		},
		{
			"key": "SGits1",
			"value": "0",
			"unit": null,
			"name": "Signal Strength"
		},
		{
			"key": "HEA_F1",
			"value": "120",
			"unit": "s",
			"name": "Heart Rate"
		}
	]
}

I get the idea that I don’t get all info from Solarman.
Setup is a Sofar with Battery and sensors to verify power from provider and solar panels (separate installation).

I have Solarman installed from home_assistant_solarman/README.md at main · StephanJoubert/home_assistant_solarman · GitHub

That gives you the following 40 entities:





To get these you need to have created an account on the solarmanpv.com website.

Start reading this post from “my information” yes you need your api and secret sent to you from Solarman and substitute your information in the guide. Don’t forget to hash your account password…everything is in the instructions:

Hello,

As mentioned I installed the Solarman integration trough HACS. I entered al the info. Even used the Auto discovery to test. IP is correct, device ID is correct (checked multiple times).
And I also read all info on the GitHub website. After the integrations is configured I can see the entities but no data/input (they are configured). There is no connection.
I also can’t find any mentioning of any email/log-in info for this integration to work either. Or I’m missing it. This integration is made to load data directly and not trough the Solarman website (API).
Or do I need to adjust the extra yaml that’s created for the Sofar?

Reading your second post, concerning the my info. You’re talking about the online interface (trough API). Or did you combine stuff? Meaning you use the local integration (the above one) together with the manual configuration.yaml.

I tried it all (integration, API) it’s just not working, no data whatsoever. Really followed the readme
Like my Sofar is talking a different language than my HomeAssistant.
Got several HACS integrations working but this Sofar/Solarman is not willing to cooperate.

Giving up on this one for the moment, thanks for the help.

It’s been a while since I set it up. But I remember that I had to email Solarman to ask for the API and secret. They sent it after a few days. Then follow my instructions. If you want an offline option then you need to build the RS485 module and connect it to your Sofar inverter. Then set up MQTT and use the sensor file that I posted.

Here is the email to send:

[email protected]

I just purchased a Sofar ME3000SP inverter and would like to get API access to pull data from the liver in to my Home Assistant system.

Please could you send me a AppID and AppSecret.

Thank you in advance for your assistance.

Thanks, that’s also what I did. Got all info but can’t get it working. So for me it stops here. Got other more important things to do. All the rest is working except the Sofar integration.

Sorry, just follow my instructions and it will work…

Don’t give up…I’ve recently had a Solar PV system installed (With Sofar Inverter) and had huge confusion around how to integrate…but got there in the end.
What I’ve gathered is that there are two options… 1) local and /or 2) via API, and both can work :sunglasses:
(Unfortunately threads seem to randomly jump between the two options and confuse things).

Option 1 is via GitHub - StephanJoubert/home_assistant_solarman: Home Assistant component for Solarman collectors used with a variety of inverters.
This reads locally but is totally dependent on the chosen yaml perimeter file during config and is specific to your setup…for me none of the default options worked and had to research to find one working with my model…was in the GitHub repository issues…the one that worked for me is in issue #53

Option 2 works well once you have the API details. It’s pulling the data from the Solarman Cloud so is delayed but does work (once you figure out the sensors you need - I found this post very helpful on that front Collect Inverter data from Solarman API - #49 by bino )

My advice…make a call on how you want to pull the data and then follow that path only until you succeed (or exhaust all options for that route)…

again, appreciate your help and as mentioned, it’s me, not you :-). Just can’t figure it out yet. And not enough time to play around. Also not having any way of log or test does not help. I can however connect to the local interface over my network. So the local IP is correct.

Thanks for sharing your info. What type of Sofar do you have? Will have a look at your info and the treads. just getting time for this

Concerning the local option. Can you share your config? I would rather want to work locally than over the cloud. the IP is 100% correct. Even when using the autoconfig it picks up the correct info. And the integration is still in active my HA. unfortunatly no data.

Hi there,

You just need to find the time to look at both the threads that I originally linked you to. I posted EVERYTHING that is needed, including the yaml configurations for sensors and mqtt.

I really can’t do any more than what I already did to make it as easy as possible for others to follow. I know only to well your difficult things can be as a HA learner myself… :wink:

2 Likes

I’ve a Sofar HYD6000-ES inverter…

No config to share as such…I’ve just installed the Component I linked in prev post and followed its instructions (using the config file from the GitHub post I linked to).

Think you just need to give yourself some time, read through the threads /posts and then have a go with either API or Local access or even try both :sunglasses:…good luck :+1:t2:

1 Like

I do not understand hardware wise how does it collect data every 30 sec?

Still nothing closer. What I tried

Start over again and again and this is the last info I can give

Concerning the API.
Followed the instructions as mentioned by Scully
Collect Inverter data from Solarman API - Share your Projects! - Home Assistant Community (home-assistant.io)

I get the impression that I don’t get all values that I should get. This is the output that I get for step 4 (and 5). So My API and all the rest is working for the moment.

{
    "code": null,
    "msg": null,
    "success": true,
    "requestId": "HIDDEN",
    "deviceSn": "HIDDEN",
    "deviceId": HIDDEN,
    "deviceType": "COLLECTOR",
    "deviceState": 1,
    "dataList": [{
        "key": "SN1",
        "value": "HIDDEN",
        "unit": null,
        "name": "Embedded Device SN"
    }, {
        "key": "MDUv1",
        "value": "ME_08_2701_2.06",
        "unit": null,
        "name": "Module Version No"
    }, {
        "key": "WORK_TIM1",
        "value": "1",
        "unit": "s",
        "name": "Total running time"
    }, {
        "key": "OFFSET_TIM1",
        "value": "1669772876",
        "unit": "s",
        "name": "Offset time"
    }, {
        "key": "SEND_PERIOD1",
        "value": "5",
        "unit": "Min",
        "name": "Data Uploading Period"
    }, {
        "key": "COLLECT_PERIOD1",
        "value": "60",
        "unit": "s",
        "name": "Data Acquisition Period"
    }, {
        "key": "max_conn_n1",
        "value": "2",
        "unit": null,
        "name": "Max. No. of Connected Devices"
    }, {
        "key": "SGits1",
        "value": "0",
        "unit": null,
        "name": "Signal Strength"
    }, {
        "key": "HEA_F1",
        "value": "120",
        "unit": "s",
        "name": "Heart Rate"
    }]
}

I do not get the info for my battery or what Scully mentioned, “the Cumulative Production kWh”. I do not have these sensors here so normal that I can get them in HA. I presume I need to get in touch with Solarman support ofr this. Or am I missing something and just being stupid :slight_smile:

Concerning the direct connection. (the system is connected through a LAN cable!)
StephanJoubert/home_assistant_solarman: Home Assistant component for Solarman collectors used with a variety of inverters. (github.com)

Started again and removed the integration, removed the HACS download. rebooted HA, added the HACS again, added the integration, rebooted.

The config of the integration (even added it as a double in the config.yaml afterwards to also try it that way, no difference in the behavior)

sensor:
  - platform: solarman
    name: SOFAR
    inverter_host: 192.168.1.157
    inverter_port: 8899
    inverter_serial: 2104559628
    scan_interval: 30
    lookup_file: sofar_lsw3.yaml

Screenshot of the integration

Screenshot of the direct connection to the dataloger

And HA does not want to connect (Not even talking of the sensors. It first needs to connect)

I really don’t know what to do more to get this working. First step is in getting it to connect.

There is no Firewall, no vlan stuff. HA can communicate with all the rest of my devices over IP.

I’m more and more convinced that it has something to do with the inverter (Called Collector in the JSON!) and how it is configured. Not with the integrations or API instructions. Weird thing is that I do see the typical data on the Solarman app and website.