Write Single Register - Float / Integer Problem

Hello everyone,

i’m an absolute newbie to home assistant and i hope my question is not too dump … :wink:

What i want to do:
I have to solar inverters and i sum the solar production of these two inverters in my templates.yaml:

- sensor:
  - name: Kaco PV Gesamt
    unique_id: kaco_pv_gesamt
    unit_of_measurement: kW
    state: >
        {{ ( states('sensor.kaco_watt_hours_1')|float + states('sensor.kaco_watt_hours_2')|float ) }}

This is working fine and i get my actual total solar power production, for example the value: 8,07 kW

Now i want to send these value to my heat pump via modbus.
I want to do this via an automation and via modbus TCP.

Here is what i’ve done in the automation.yaml:

- id: '1668426381693'
  alias: IDM
  description: ''
  trigger:
  - platform: time_pattern
    seconds: "/30"
  action:
  - service: modbus.write_register
    data:
      address: 74
      slave: 1
      value: "{{ states('sensor.kaco_pv_gesamt') }}"
      hub: idm

Sadly the value in the heat pump isn’t updating and i think it has something to do with wrong number formats or anything like that.

Address 74 in my heat pump:

Could anyone of you help me with my topic? :slight_smile:

Best regards and TIA for your help,
Chris

Hello, this should help.