Collect Inverter data from Solarman API

:SOLVED:
Hello Everyone!

I have been working on integrating my inverter for a few days now. But can’t seem to understand why the sensor data won’t display in home assistant. I tested everything via the Curls command and could see the data for the logger and the inverter.

I created a separate sensor for the both of them but only the data of the logger will display within home assistant.

I tried different methods where i tried to gain a part of the sensor by using the path configuration as displayed but it will only show that the state is unknown.

I think part of the problem might be the fact that there is a T at the start of the serial number of my inverter. But as far as I can tell the payload is read as a string so that shouldn’t be the issue.

payload: ‘{ “deviceSn”: T62060…etc.}’

The brand used is the Afore 6 kw, a sub-brand which uses the Solarman logger.

I honestly have no idea what I am doing wrong at the moment. I might want to try the Mqtt route, but am fairly unfamiliar with the process so the instructions are a bit unclear for me.

Thanks in advance!

EDIT: I was right and the system couldn’t read the Serial number. I put it between brackets “T62060…” and it could the number :slight_smile:

After having the luxury of getting realtime data from my inverter via Modbus RTU since August, my inverter was replaced last week because it had an issue. Until I figure out how to pull real time data from the new inverter, I need to collect the data using the Solarman API. I thought this would be a simple thing to do, as I have done it before, and I was of the impression that the method still worked (I’m the writer of post 153).

However, I got stuck at step 6: using JSON Path Finder to find the appropriate value_jsons to bring into Home Assistant. As I only got an error message, I searched for an alternative that accepts the code from my earlier post:

curl --request POST \
  --url 'https://globalapi.solarmanpv.com/device/v1.0/currentData?appId=APIID&language=en&=' \
  --header 'Authorization: bearer ACCESSTOKEN' \
  --header 'Content-Type: application/json' \
  --data '{
  "deviceSn": "SERIALNUMBER"
  }'

I finally found out that the solution is to paste the code into Recbins Run Curl Commands Online and click “Run”. Then click JSON (placed above the window below where I pasted the code). Then you are able to find the appropriate value_jsons to bring into Home Assistant.

Dear all,

I guess I need some advise where to next look into, else I might give up.

I tried all 3 discussed ways to read data from my Deye Sun600 inverter but all seem to fail. mostly.

  1. The method of the Solarman integration available through HACS does not work for me with any of the YAML templates.

My Serial # of the inverter starts with 41***, so there seems to be totally different ModBus adresses used than the ones I can find ind various documents. If anyone has a documentions for those converters with 41*** serial numbers, I’d appraciate any guidance.

  1. The method of collecting data from the Solarman API works in principal, but only spills out some basic data points, nothing that deals with energy production.

I managed to get the app ID, secret, all I need etc and was able to address the API with CURL, getting back the JSON response I need regarding available data the API provides.

Basically I only get a dataList which consists of 10 entities, such as device serial #, firmware version, …, MAC address, … and it ends with the WiFI SSID used.

Copying the CURL response into json path finder also only shows10 data points available. If I compare other’s API output this is frustrating. Somehow it seems to me the API does not reveal my energy data at all.
Clues??

{
    "code": null,
    "msg": null,
    "success": true,
    "requestId": "2bdf27ac36b7ed4a",
    "deviceSn": "417######",
    "deviceId": 2203####,
    "deviceType": "COLLECTOR",
    "deviceState": 1,
    "collectionTime": 1709137950,
    "dataList": [{
        "key": "SENSOR_LI1",
        "value": "5406",
        "unit": null,
        "name": "sensor List"
    }, {
        "key": "SN1",
        "value": "417#######",
        "unit": null,
        "name": "Embedded Device SN"
    }, {
        "key": "MDUv1",
        "value": "MW3_16U_5406_2.32-D1",
        "unit": null,
        "name": "Module Version No"
    }, {
        "key": "ESv1",
        "value": "V1.1.00.11",
        "unit": null,
        "name": "Extended System Version"
    }, {
        "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": "1",
        "unit": null,
        "name": "Max. No. of Connected Devices"
    }, {
        "key": "SGits1",
        "value": "49",
        "unit": null,
        "name": "Signal Strength"
    }, {
        "key": "MDU_MAC_ADD1",
        "value": "##########",
        "unit": null,
        "name": "Module MAC Address"
    }, {
        "key": "R_SSID",
        "value": "#######",
        "unit": null,
        "name": "Router SSID"
    }]
}

  1. Final and last try I evaluated is reading the local webIF of the converter as described by @mennosmit erlier in this discussion. I don’t get any result so far, my feeling is that I created the sensor in an incorrect way. I don’t see a template.yml or similar, so maybe I’m just to stupid and need some hint on how to do that.

I’m hoping it’s just a small mistake?

I copied the following lines into my configuration.yaml, but get an error message on the template. What else do I need to do?

'# Solarman local logger
sensor:
  - name: solarmanlocal_power_solar_now
    platform: command_line  
    command: curl -s -u admin:admin http://192.168. 178.39/status.html | grep -E "\webdata_now_p(\s|$)" | cut -d'"' -f 2
    unit_of_measurement: 'W'
    scan_interval: 10
  - name: solarmanlocal_power_solar_today
    platform: command_line  
    command: curl -s -u admin:admin http://192.168. 178.39/status.html | grep -E "\webdata_today_e(\s|$)" | cut -d'"' -f 2
    unit_of_measurement: 'kWh'
    scan_interval: 60
  - name: solarmanlocal_power_solar_total
    platform: command_line  
    command: curl -s -u admin:admin http://192.168. 178.39/status.html | grep -E "\webdata_total_e(\s|$)" | cut -d'"' -f 2
    unit_of_measurement: 'kWh'
    scan_interval: 60
    
template:
  sensor:
  - name: "solarmanlocal_production_daily"
    state: "{{ states('sensor.solarmanlocal_power_solar_total')}}"
    unit_of_measurement: kWh
    device_class: energy
    state_class: total_increasing
    unique_id: solarmanlocal_production_daily

Hi everyone.
I’m new to the forum and followed the guide
I sent an email to “[email protected]” to request API access and they replied like this:

Sorry, due to the API business adjustment, temporarily does not support opening.

Your understanding and patience is greatly appreciated."

Has this happened to anyone before? I have an afore af6k-sl inverter and I can’t add it to homeassistant

I asked for API-ID and I got unfortunately exactly the same answer as u posted…

From: [email protected]
Date: 06.03.2024
Message:„ Sorry, due to the API business adjustment, temporarily does not support opening.
Your understanding and patience is greatly appreciated.“

Hi,
Has anyone managed to remotely control an inverter using API? As far as I can see in the documentation there is remote control, but there is no list of commands…

Hi I have the same problem with second inverter config, did you manage it on on config.json file?

AllesKutEnter

Good day, the first code is clear, but how to apply the second one is not clear! Can you provide more detailed information?

I received this response from Solarman when asked for API access. Is this the expected response? Will will be crossing that 2 Lakhs API call volume by chance?

Dear Clients,

Thank you for your interest in Wuxi IGEN Technology Co. (hereinafter referred to as “IGEN Technology” or “us”) and for considering using our Solarman OpenAPI service. Before you officially subscribe, we would like to provide you with some important information.

Firstly, in the services provided to individual users, the following free usage quotas are include·

  1. API call volume of 200,000 times per year

  2. Number of power stations within 3

If it exceeds the usage limit we provide, we will have to temporarily suspend your service. To ensure that your service can be restored as soon as possible, please contact us as soon as possible for further communication on a solution.

In addition, to ensure that the rights and interests of both parties are fully protected when using the API, we recommend that you review and agree to our developer agreement. You can download the attachment “Developer Agreement” in this email to view the API developer agreement. And reply via email with ‘I have understood all the contents of the Developer Agreement and agree to be bound by it’ to “ [email protected] “ to complete agreement confirmation.

After you confirm the agreement, our service specialist will send you account information and OpenAPI usage documentation via email,

If you have any questions or need further information about the content of the agreement, please feel free to contact us at any time.

Thank you again for your trust and support in IGEN Technology!

regards,

Wuxi IGEN Technology Co.

[SOLARMAN OpenAPI Developer Agreement.pdf]

Thank you very much @Gav_in . I was unable to move further as I was following the old API link. Now I understood the reason :slight_smile:

1 Like

Before pushing it further, do you think this method applies to KSTAR: KSG-2K ?

Hi,
I know this was long time ago but it looks like your steps are immortal :slight_smile: I am trying to integrate solarman and currently I am on step 4. Do you remember what is deviceSN and how I can get it?

it’s the actual serial number of your inverter as far as I remember…been a while since I set this up but fairly sure that’s it.

1 Like

have you ever succeeded? I have a KSTAR KSG 5K and I can’t get it to work with Solarman.

Hello everyone,

I’m staring with HA and Solarman Integration, please, do you have any material to install step by step?
Because I don’t understand, where I should create sensor, mqq, doker etc, I did only Hacs integration :D, maybe you have, one step by step, where you said first, config mqq blablabl second create file sensor.yaml in the paste xxx etc

Thanks for atention.

In my experience the following integration is best: GitHub - davidrapan/ha-solarman: ⚡ Solarman Stick Logger integration for 🏠 Home Assistant

1 Like

I can’t config.
this integration doesn’t connect with my micro_inversor

Welcome to the Forums…
You’ve not giving any info on what Inverter you have, what Integration (which version, fork, etc) you are trying to use, etc, etc so it’s kinda difficult to assist you.
Also you are posting in a thread about a specific topic that probably isn’t relative to your query so that’s not helping either.

Read here to get you started with how to go about looking for help on the forum and then would suggest opening a new Topic with your specific queries and go from there…

as a PS…the Integration Martijn mentions above your previous post is a good place as any to start with integrating your Inverter with HA

1 Like

Hello, community!

I’m working on an integration in Home Assistant using the Solarman API, and I came across the documentation for the Device Historical Data feature:
API Documentation - Historical Data

Has anyone here used this part of the API? I’m particularly interested in understanding:

  1. What parameters are required to query historical data?
  2. Any tips on handling authentication and requests?
  3. Practical examples of how to format the query and process the returned data would be very helpful!

If anyone has integrated this feature into Home Assistant or has experience with it, I’d love to hear your insights. Any help would be greatly appreciated!

Thanks!

I haven’t gotten into it yet, but I’m looking for help to find the easiest way to do it! It’s doable ! but I don’t know how yet.

Help guys !