API integration for Solplanet inverter (AISWEI)

Hi there

Im looking for help integrating a solplanet hybrid inverter into hassio
I have the api key, api docs, token.

But just can figure out how to communicate with the API.
after plenty videos and reading im now asking for help.

Please could i be pointed in the right direction or if someone could be so kind to hold my hand to get the api talking.

2 Likes

I have the solplanet configured in Home assistan and can read out this values

You need to configure your configuration.yaml and add this lines:

sensor: !include_dir_merge_list includes/sensor/
template: !include_dir_merge_list includes/template/

Then make one solar.yaml in sensor catalog

  • platform: rest
    resource: http://your-ip:8484/getdevdata.cgi?device=2&sn=your serialnumber
    scan_interval: ā€œ00:00:10ā€
    name: Solplanet
    value_template: OK
    json_attributes:
    • flg # ???
    • tim # date/time
    • tmp # inverter temperature / 10
    • fac # frequency / 100
    • pac # actual power watt
    • sac # apparent power
    • qac # reactive power
    • eto # total produced / 10
    • etd # total produced daily / 10
    • hto # running time
    • pf # ???
    • wan # ???
    • err # errors
    • vac # voltage / 10
    • iac # current / 10
    • vpv # string voltage
    • ipv # string current
    • str

And one solar.yaml in template katalog

  • sensor:
    • name: Solplanet producerat
      unique_id: solplanet_current_production
      state: ā€œ{{ state_attr(ā€˜sensor.solplanetā€™, ā€˜pacā€™) | float(0) }}ā€
      unit_of_measurement: ā€œWā€
      device_class: energy
      state_class: measurement
      icon: mdi:transmission-tower-export

    • name: Solplanet producerat dagligen
      unique_id: solplanet_daily_production
      state: ā€œ{{ state_attr(ā€˜sensor.solplanetā€™, ā€˜etdā€™) | float / 10 }}ā€
      unit_of_measurement: ā€œkWhā€
      device_class: energy
      state_class: total_increasing

    • name: Solplanet producerat totalt
      unique_id: solplanet_total_production
      state: ā€œ{{ state_attr(ā€˜sensor.solplanetā€™, ā€˜etoā€™) | float / 10 }}ā€
      unit_of_measurement: ā€œkWhā€
      device_class: energy
      state_class: total_increasing

    • name: Solplanet temperatur
      unique_id: solplanet_temperature
      state: ā€œ{{ state_attr(ā€˜sensor.solplanetā€™, ā€˜tmpā€™) | float / 10 }}ā€
      unit_of_measurement: ā€œCā€
      device_class: temperature
      state_class: measurement

    • name: Solplanet ampere
      unique_id: solplanet_ampere
      state: ā€œ{{ state_attr(ā€˜sensor.solplanetā€™, ā€˜ipvā€™) | float(0) }}ā€
      unit_of_measurement: ā€œAā€
      device_class: current
      state_class: measurement

    • name: Solplanet volt
      unique_id: solplanet_volt
      state: ā€œ{{ state_attr(ā€˜sensor.solplanetā€™, ā€˜vpvā€™) | float(0) }}ā€
      unit_of_measurement: ā€œVā€
      device_class: voltage
      state_class: measurement

Thanks a lot! This worked perfectly with Solarplanet.

Im trying to get this to workā€¦ do you create sensors first? Is your inverter connected via w-lan dongle or lan? Iā€™ve created all files an added lines to config but its still not working.

Hello
The sensors you must create first.
And my solplanet is connected to my local network with the wifi dongel.
http://10.10.1.238:8484/getdevdata.cgi?device=2&sn=LM011K09S2390718

Thank for your answerā€¦ but I still have some questions. Wich sensors do you create? Youā€™ve created them in helpers section right? My assist still wants to now the input sensor to create a helperā€¦
but with the yaml code there where no inputs. My assist is also not affraid about the changes in the config.yaml. You wrote ā€˜create in the catalogā€™ what does this mean exactly?

this is my config:

/config/configuration.yaml :

added
sensor: !include_dir_merge_list includes/sensor/
template: !include_dir_merge_list includes/template/

/config/includes/sensor/solar.yaml :

  • platform: rest
    resource: http://1**.1**.1**.65:8484/getdevdata.cgi?device=2&sn=B3200H31063C
    scan_interval: ā€œ00:00:10ā€
    name: KorteHomePV
    value_template: OK
    json_attributes:
    • flg # ???
    • tim # date/time
    • tmp # inverter temperature / 10
    • fac # frequency / 100
    • pac # actual power watt
    • sac # apparent power
    • qac # reactive power
    • eto # total produced / 10
    • etd # total produced daily / 10
    • hto # running time
    • pf # ???
    • wan # ???
    • err # errors
    • vac # voltage / 10
    • iac # current / 10
    • vpv # string voltage
    • ipv # string current
    • str

/config/includes/template/solar.yaml :

sensor:

  • name: KorteHomePV Produktion
    unique_id: solplanet_current_production
    state: ā€œ{{ state_attr(ā€˜sensor.solplanetā€™, ā€˜pacā€™) | float(0) }}ā€
    device_class: energy
    state_class: measurement
    icon: mdi:transmission-tower-export
  • name: KorteHomePV Tageswert
    unique_id: solplanet_daily_production
    state: ā€œ{{ state_attr(ā€˜sensor.solplanetā€™, ā€˜etdā€™) | float / 10 }}ā€
    unit_of_measurement: ā€œkWhā€
    device_class: energy
    state_class: total_increasing
  • name: KorteHomePV gesamt
    unique_id: solplanet_total_production
    state: ā€œ{{ state_attr(ā€˜sensor.solplanetā€™, ā€˜etoā€™) | float / 10 }}ā€
    unit_of_measurement: ā€œkWhā€
    device_class: energy
    state_class: total_increasing
  • name: KorteHomePV temperatur
    unique_id: solplanet_temperature
    state: ā€œ{{ state_attr(ā€˜sensor.solplanetā€™, ā€˜tmpā€™) | float / 10 }}ā€
    unit_of_measurement: ā€œCā€
    device_class: temperature
    state_class: measurement
  • name: KorteHomePV Ampere
    unique_id: solplanet_ampere
    state: ā€œ{{ state_attr(ā€˜sensor.solplanetā€™, ā€˜ipvā€™) | float(0) }}ā€
    unit_of_measurement: ā€œAā€
    device_class: current
    state_class: measurement
  • name: KorteHomePV Volt
    unique_id: solplanet_volt
    state: ā€œ{{ state_attr(ā€˜sensor.solplanetā€™, ā€˜vpvā€™) | float(0) }}ā€
    unit_of_measurement: ā€œVā€
    device_class: voltage
    state_class: measurement

and still not working. Did you enter the SN of your dongle or the inverter?

Hello
The serial number of the inverter! And the ip adress for your dongel.

Now it works! The issue was about the wrong serial number an wrong sensor names. Great Work :v:

Great work, i will soon install solplanet inverter and FAB battery 10kw. Do you guys have also battery and can display the battery information in HA?

Hi all,
may I ask you to support me in this case? I am brand new in Homeassistant and I have a solplanet PV as well. I tried to integrate my solplanet as discribed by Peter above. I can see the entities but I still got unavailable status in home assistant for all entities.
Do you have any idea? YAML check in HA without any fault.
Thank you in advance

Here my configuration:

- platform: rest
  resource: http://1xx.1xx.2.1xx:8484/getdevdata.cgi?device=2&sn=LM010K09S227xxxx
  scan_interval: "00:00:10"
  name:  Solplanet PV
  value_template: "OK"
  json_attributes:
    - flg # ???
    - tim # date/time
    - tmp # inverter temperature / 10
    - fac # frequency / 100
    - pac # actual power watt
    - sac # apparent power
    - qac # reactive power
    - eto # total produced / 10
    - etd # total producted daily / 10
    - hto # running time
    - pf # ???
    - wan # ???
    - err # ???
    - vac # voltage / 10
    - iac # current / 10
    - vpv # string voltage
    - ipv # string current
    - str
- sensor:
  - name: "Solplanet PV Produktion"
    unique_id: solplanet_current_production
    state: "{{ state_attr('sensor.solplanet_pv_produktion', 'pac') | float }}"
    unit_of_measurement: "W"
    device_class: energy
    state_class: measurement
    icon: mdi:transmission-tower-export

  - name: "Solplanet PV Tageswert"
    unique_id: solplanet_daily_production
    state: "{{ state_attr('sensor.solplanet_pv_tageswert', 'etd') | float / 10 }}"
    unit_of_measurement: "kWh"
    device_class: energy
    state_class: total_increasing

  - name: "Solplanet PV gesamt"
    unique_id: solplanet_total_production
    state: "{{ state_attr('sensor.solplanet_pv_gesamt', 'eto') | float / 10 }}"
    unit_of_measurement: "kWh"
    device_class: energy
    state_class: total_increasing

  - name: "Solplanet PV Temperatur"
    unique_id: solplanet_temperature
    state: "{{ state_attr('sensor.solplanet_pv_temperatur', 'tmp') | float / 10 }}"
    unit_of_measurement: "Ā°C"
    device_class: temperature
    state_class: measurement

Hello
Have you made sensor yaml file and template yaml file?

Hello,
yes, made a directory includes and there a sensor and template directory. In each I have a solar.yaml with the code you can see above.
In config.yaml I have this code

sensor: !include_dir_merge_list includes/sensor/
template: !include_dir_merge_list includes/template/

Hello,
sorry, didnĀ“t read your message exactly.
Dou you mean a sensor.yaml and template.yaml or the directory sensor and template?
For what would be these both ymal files? I understoud to have two solar.yaml in the directories sensor and template?

You have to exactly name the path in your configuration.yaml
In my config Iā€™ve named the files:

sensor: !include sensor_solar.yaml
template: !include template_solar.yaml

And stored the files in the /config folder with no subfolder. Just this worked in my case.
And give an eye in sensor names. Whatā€™s named in templates also must be named in sensors if you want to rename your sensors.

Hello Kevin,
you made my day. It works. Thank you very much.
I realy don`t know what the problem realy was but I assume it was a copy mistake in the sensor name (kind of a fals formatted character).
Anyway: I took over your configuration (without subfolders) and it works.
Thank you one more time.

Hello all,
it is me again :slight_smile:
I found out that the attribute ā€œpacā€ shows the actual power of a solplanet inverter including the power (discharging) of the battery (if available).
Does anybody know how to seperate the acutal power from the battery power so you can see the real power comming from the modules? So, is there maybe another attribute to be added to do so?
Thank you one more time.

1 Like

I had not the time to evaluate all values, but there are more if Your change the device=2 to
device=3:

{"flg":1,"tim":"","pac":-2480,"itd":290,"otd":1390,"iet":3997,"oet":7021,"mod":11,"enb":1}

or device=4:

{"flg":1,"tim":"20230909145450","ppv":4180,"etdpv":240,"etopv":13796,"cst":10,"bst":3,"eb1":65535,"wb1":65535,"vb":21150,"cb":1,"pb":21,"tb":273,"soc":99,"soh":100,"cli":250,"clo":300,"ebi":40,"ebo":12,"eaci":0,"eaco":0,"vesp":2339,"cesp":1,"fesp":0,"pesp":1,"rpesp":0,"etdesp":0,"etoesp":0,"charge_ac_td":0,"charge_ac_to":0}

Hi Guys

I played around and got 4device 4 to work the main item that im interested is SOC which is state of health which is the battery %

I will figure out the rest of the device numbers and see what else is useful

Hi all,
thank you heinzb for your support.

MPender: I think SOC is ā€œState of chargeā€. SOH is ā€œState of healthā€. Both in %
More information about attributes would be helpfull. Thank you as wellā€¦