Input_number.set_value

Hi,
I would like to use 3 home batteries to work as 1 by dividing the CT (Shelly Pro 3EM) value by 3 and sending this value to the manual control of each battery.

I have already made a helper that gives this output (e.g. house power consumption is 600W, helper output is 200W).

Now I would like to use this helper output value “sensor.shelly_actueel_verbruik_gedeeld_door_3_en_negatief_gemaakt” and use it to change “number.lilygo_rs485_venus_1_marstek_forcible_charge_power” or “number.lilygo_rs485_venus_1_marstek_forcible_discharge_power” depending on whether the value is + or minus.

Simultaneously, the batteries need an instruction to start charging or discharging by changing a select option: “select.lilygo_rs485_venus_1_marstek_forcible_charge_discharge” from stop to charge or discharge, depending on whether the value from “sensor.shelly_actueel_verbruik_gedeeld_door_3_en_negatief_gemaakt” is + or -.

How would I go about doing this? I figure the answer lies in input_number.set_value, which I have setup and is trying to change the number and is trigger each time the value of the sensor changes. However, the number is never changed.

service: input_number.set_value
data:
  value: "{{ states('sensor.shelly_actueel_verbruik_gedeeld_door_3_en_negatief_gemaakt')|int(0) }}"
target:
  entity_id: number.lilygo_rs485_venus_1_marstek_forcible_discharge_power

It is not an input_number helper, it is a number entity. Two different domains with different actions. Use the number set value action.

action: number.set_value
data:
  value: "{{ states('sensor.shelly_actueel_verbruik_gedeeld_door_3_en_negatief_gemaakt')|int(0) }}"
target:
  entity_id: number.lilygo_rs485_venus_1_marstek_forcible_discharge_power