Giving the sum of entity values to helper in automation

Hello, I need help because I could not find the solution anwhere.
I would like to add value to a helper from 3 entities sums.
Template is not is a solution because values of enties always change and I need it in the first action in the automation.
This is the script now:

Do you have any idea what is the problem here?

I tried it several forms but if I can save it the automation does not work and helper has not got any new value.

Thanks in advance.

The screen shot example you have shared is not valid because it is improperly formatted.

Next time, try setting up the action in the Automation editor and putting a dummy value where you plan to put the template. That will set everything up correctly. Then you can switch to YAML mode and add your template where the dummy value is.

Templates must either be surrounded by quote marks or include a block scalar identifier (| or >).

action: input_number.set_value
data:
  value: |
    {{ states('sensor.solarman_inverter_l1_power') | float(0) +
    states('sensor.solarman_inverter_l2_power') | float(0) +
    states('sensor.solarman_inverter_l3_power') | float(0) }}
target:
  entity_id: input_number.deye_sum_cons

There are also other ways to setup the template:

{{ ['sensor.solarman_inverter_l1_power', 'sensor.solarman_inverter_l2_power', 
'sensor.solarman_inverter_l3_power'] | map('states') | map('float', 0) | sum }}

Thanks for your quick answer. (Sorry meanwhile I edited the original post with another script but noone works.)

So I tried this now, but value is not changed:
action: input_number.set_value
data:
value: >
{{ [‘sensor.solarman_inverter_l1_power’,
‘sensor.solarman_inverter_l2_power’, ‘sensor.solarman_inverter_l3_power’] |
map(‘states’) | map(‘float’, 0) | sum }}
target:
entity_id: input_number.deye_sum_cons

Please follow Community Guidline #11. Share the entire automation, properly formatted… when you post unformatted text it is difficult (and sometimes impossible) for us to identify the source of the issue.

Thanks the hint.
Yes, it is readable.

action: input_number.set_value
data:
  value: >
    {{ ['sensor.solarman_inverter_l1_power',
    'sensor.solarman_inverter_l2_power', 'sensor.solarman_inverter_l3_power'] |
    map('states') | map('float', 0) | sum }}
  target:
    entity_id: input_number.deye_sum_cons

You have an indentation error. The target key should be at the same depth as data and action.