Trying to use a simple input_number to calculate some values but after every home assistant reboot the value gets reset to 0.
i first made the input_number in frontend (helpers -> input number) but noticed there is no option to set the “initial” option which is added to the input_number as default “null” when checking the input_number in developertools.
also made the same input_number in configuration file while leaving the option “initial” out because as the guide says it’s optional and when not used it defaults to the value before the reboot. well it still gets the option “initial: null” so the option “initial” is mandatory for input_numbers now?
anyway, which value due i need to set the option “initial” to to default to the last know value before the restart?
Which version of Home Assistant are you running? My input_numbers keep their state after a restart, initial: is not set. If you set initial it will get this value after a reatart.
Any solution to this?
I am trying, as well, to use input_number for storing the current electricity kWh cost , and use it in a template sensor for calculation of the dayly/weekly/monthly energy cost…
I thought I could utilize the input_number to hold the current kWh-cost, and update whenever the cost changes…
What version of HA are you running, and how did you create the input_number? The lack of attributes suggests to me that you’ve probably used YAML — perhaps try recreating via the UI instead, or adding the same attributes as mine.