I want to create a helper value, that will follow the number.niro_dc_charging_limit, but ignore the “0” and keep the old value. To my surprise, it’s not that easy.
The 0 is probably a string because all entities are strings. try “0”.
But it might be “0.0” or whatever. look in the state machine and verify exactly what it is.
I just tried “0” as a string. There are no more errors, but the value of helper is “unknown”.
The developer tool says the state of number.niro_dc_charging_limit is just 80. Hard to tell if it’s a string or not, because “unknown” above is also without quotes.
Has it changed since you loaded the new sensor? It won’t be updated until it does.
Also, remove the step 10 if the value can be 81, or round the value to a multiple of 10.
Third: are you sure you want an editable number? If is should only be updated by the trigger, you need it to be a normal sensor. It might not work if you do not supply all needed actions for number, such as set_value.
I’m sorry. My sensor with trigger actually works. I confused “AC” with “DC”, therefore I was thinking I was changing the input entity, while in fact I didn’t.