How to copy value from one number helper to another?

Hello,

It must be simple, but I don’t know…

How to copy the value from the helper ‘input_number.number_solar_panel_1’ to the helper ‘input_number.number_solar_panel_initialisation_1’ ?

This seems not to work… :thinking:

- service: input_number.set_value
  data:
    value: {{ states('input_number.number_solar_panel_1') | float(0) }}
  target:
    entity_id: input_number.number_solar_panel_initialisation_1

1 Like

Quote your single line templates.

- service: input_number.set_value
  data:
    value: "{{ states('input_number.number_solar_panel_1') }}"
  target:
    entity_id: input_number.number_solar_panel_initialisation_1

Thank you Tom !

1 Like

Hi all,

it seems it is not working with me.

The input variables changes and it is defined.

Using my example:

not

  data: "{{ states('input_number.number_solar_panel_1') }}"

(you are missing the value: bit).

And you don’t need the |float filter in your template this time. The set_value action can use a string representation of a number.

1 Like

Really thank you.

1 Like