EKD - Ampere.StoragePro E3 with Ampere.IQ smartbox and REST api

Hello, I’m a newbie in HA and also in PV systems - but I have a PV system and also an a running HA on Raspberry since yesterday.
The PV systems answer on http request with a lot of different information via REST api.
If I send
Preformatted texthttp://MyIpAdress/rest/items/
I got following (json) feedback (reduced to one entry - overall 146 data):

{"link":"http://MyIpAdress/rest/items/foxesshybrid_battery_MySerial_battery_bms_1_soc","state":"54 %","stateDescription":{"pattern":"%.2f %%","readOnly":true,"options":[]},"editable":false,"type":"Number:Dimensionless","name":"foxesshybrid_battery_MySerial_battery_bms_1_soc","label":"#bms_1_soc","tags":[],"groupNames":[]},

In HA I added the configuration.yaml file:

# include PV sensor
homeassistant:
  packages: !include_dir_named integrations

and in integration folder I have a file with

rest:
  - resource: "http://MyIpAdress/rest/items/"
    scan_interval: 15
    sensor:
      - name: "Battery level"
        value_template: "{{ (value_json | selectattr('name','contains','battery_bms_1_soc') | list | first).state.split(' ')[0] | float | round(2) }}"
        unit_of_measurement: "%"
        unique_id: ampere_battery_stateOfCharge
        device_class: energy
        state_class: total

My questions :
Is this right?
Where can I find the SOC sensor value in HA?
How to implement this (and all other data) in the “Power Flow Card Plus”?
Is there anywhere already an implementation with these REST data and the (new) EKD system (–> there are foxess and also kiwigrid entries in the “Rest-answer” from system)

Do you by any chance have a wallbox installed? A friend of mine has a system from ekd, originally just with inverter and battery, but since he recently got a wallbox, a whole bunch of additional datapoints from foxess popped up. I’ve got the yaml code for the most important sensors on the laptop somewhere, need to look that up and will post here

Hi and sorry for late reply - system is working now with REST API interface.
No - I do not have a wallbox yet - but it is planned :slight_smile:

Thanks for this informations!
Would you please describe your solution “with REST API interface” in detail for other interested users?

1 Like

I’m still new to HA. I’ve also tried the examples using the REST API. However, the URL requires authentication. How did you solve that?

my Sample:

sensor:
  #Total Battery Charge in kwh
  - platform: rest
    resource: http://[IP.OF.IQ.BOX}/rest/items/sajhybrid_battery_94_[SERIALNUMBER]_battery_totalChargeEnergy
    name: Ampere Battery TotalChargeEnergy
    unique_id: ampere_battery_totalChargeEnergy
    value_template: '{{ value_json.state | regex_replace("([^\d.-]+)","") | float }}'
    unit_of_measurement: "kWh"
    device_class: energy
    state_class: total_increasing
    scan_interval: 15

I have tried

password:
username:

and alternate

method: POST
payload '{ "username" : "installer" , "url" : "/auth/login" , "password" : "mypaswd"  }'

greetings