Hi,
I am running HA 2026.3.1 in docker without any issues.
Out of curiosity, I would like to monitor the charging state of my PV battery at specific times of day.
My idea was the following:
create a helper to store the value at a specific time e.g. charge_state_0700
run an automation at 0700 each day to set charge_state_0700 to the actual charging state
put somewhere a diagram to show the charging state how it evolves over time (days, weeks,…)
So, in the GUI I created a helper of the type “input_number” called “charge_state_0700”.
Then, I wanted to create an automation with a trigger at 0700. The trigger is no problem. As action I choose “number set”. But I “number set” I cannot find my “charge_state_0700”.
What am I doing wrong? Or where is the mistake in my way of thinking?
When using an action to set the value of an input_number entity, the action required is input_number.set_value. This action is different to number.set_value
You probably want something like {{ states('sensor.my_battery_charge') | float(0) }}
although you will have to decide exactly what your sensor holds in the state value. This will be a string, and you need to turn it into a number, either integer or float, depending on how you set up your input_number helper (step size as integer or float).
You can test any template in the Developer Tools > Templates to make sure it returns the value you want, or use the ‘debug’ icon in the value edit window to turn on testing.
In the template editor {{states('sensor.solaredge_i1_b1_state_of_energy') | int(0)}}
provides the correct result.
However, if I copy&paste this exact expression into the value field in the automation and hit Run action I get an error: required key not provided @ data['value']. Got None.
You and me both. I set my automation up ages ago and forgot how I had to do it…
So, start a new automation in the UI, and in the Then Do section select “input number” and the action “input_number.set”
This will give you the action, and the action edit box.
Select your target entity (the input_number.whatever) you want to set.
Then comes the fun bit.
We need to set a template for the value, but the UI does not permit this, so switch the action to “edit in YAML”, which will give you something like the following with the correct action and your target entity:
This sets the action data object with a property “value” which has a string containing a template. This should render correctly.
Note that you need the quotes around the template.
You can return to the UI editor mode, and the value box should now show the template, and allow you to edit the template, and also should work with the ‘bug’ option to render the template in situ.