I want to have a certain value in max_value for my number-template, read from a sensor with lambda.
Is it wrong syntax, or just not working?
Any other ideas to make this work?
max_power is a float value, but gets a value first at startup of the esp.
The goal is to limit the range of the input number. The max_value can change sometimes.
Fixed min and max values makes sense. If the boundaries are 0…100, you set its value to 90 and then change the max to 50, the value it holds would suddenly be outside its boundaries.
Okay, I understand.
Flexible max value would make sense in my case, because too high values given by the UI will be outside the range. The max. possible value can change and is set from a measurement in may case.
I adapted my code to check the given value somewhere else.
The project is a power regulator, and the connected power depends on the ac-devices, that are hooked on. The power is measured at startup of the ESP, but can also repeated later.
The max_value in the input field should be set to the max. power of the connected devices.
Is it then possible to reduce a actually too high value to my given maximum?
Like: Input number was 2000. Max. possible value is just 1500 → reduce the value to 1500 AND show this in the UI…