Integrating RWE Sonnenbatterie

RWE sells (selled?) an OEM version of the Sonnenbatterie.
I wrote to the support and they sent me an API document.
I made an integration of it.

In the configuration.yaml add (alter YOUR_IP to the one of your Sonnenbatterie):

rest:
  resource: http://YOUR_IP:7979/rest/devices/battery
  method: GET
  headers:
    User-Agent: Home Assistant
    Content-Type: application/json
  scan_interval: 60
  timeout: 15
  sensor:
    - name: "Sonnenbatterie current pv power"
      value_template: '{{ value_json["M03"] }}'
      unit_of_measurement: W
      device_class: power
    - name: "Sonnenbatterie current total consumption"
      value_template: '{{ value_json["M04"] }}'
      unit_of_measurement: W
      device_class: power
    - name: "Sonnenbatterie display state of charge (SOC)"
      value_template: '{{ value_json["M05"] }}'
      unit_of_measurement: '%'
      device_class: battery
    - name: "Sonnenbatterie current consumption L1"
      value_template: '{{ value_json["M07"] }}'
      unit_of_measurement: W
      device_class: power
    - name: "Sonnenbatterie current consumption L2"
      value_template: '{{ value_json["M08"] }}'
      unit_of_measurement: W
      device_class: power
    - name: "Sonnenbatterie current consumption L3"
      value_template: '{{ value_json["M09"] }}'
      unit_of_measurement: W
      device_class: power
    - name: "Sonnenbatterie soc relative to usable capacity"
      value_template: '{{ value_json["M30"] }}'
      unit_of_measurement: '%'
      device_class: battery
    - name: "Sonnenbatterie total stored energy over lifetime"
      value_template: '{{ value_json["M31"] }}'
      unit_of_measurement: kWh
      device_class: battery
    - name: "Sonnenbatterie current discharging power"
      value_template: '{{ value_json["M34"] }}'
      unit_of_measurement: W
      device_class: power
    - name: "Sonnenbatterie current charging power"
      value_template: '{{ value_json["M35"] }}'
      unit_of_measurement: W
      device_class: power
    - name: "Sonnenbatterie current feed in"
      value_template: '{{ value_json["M38"] }}'
      unit_of_measurement: W
      device_class: power
    - name: "Sonnenbatterie usable battery capacity"
      value_template: '{{ value_json["S69"] }}'
      unit_of_measurement: Wh
      device_class: battery

I’m pretty new to Home Assistant, so please be patient.