Is there a reason that input_number.add_value does not exist?

I am tracking a lot of stuff in input_number entities and after writing the templates to add a number to an existing value for the twentieth time, I couldn’t help but wonder, why a input_number.add_value services doesn’t exist. Especially because input_number.increment does exists and that is basically a “add +1” or whatever the step is.

Would it make sense to create a feature request for input_number.add_value and input_number.substract_value?

Thanks,
Julian

Probably because it’s easy to use the existing set_value service to add or subtract. For example, this adds 10 to the input_number’s value.

- service: input_number.set_value
  target:
     entity_id: input_number.whatever
  data:
     value: "{{ states('input_number.whatever') | float + 10 }}"

Because setvalue is all you need. Using your logic, people will request multiply, divide, etc.

By that logic, we should get rid of input_number.increment asap :slight_smile:

The increment/decrement service calls represent a significant simplification compared to using set_value.

This is what it would take to increment by step using set_value.

- service: input_number.set_value
  target:
     entity_id: input_number.whatever
  data:
     value: "{{ states('input_number.whatever') | float + state_attr('input_number.whatever', 'step') | float  }}"

The proposed add_value and subtract_value don’t simplify the task by the same magnitude.

However, if you feel strongly about it, post it as a Feature Request and maybe some developer will implement it. Or if you have the requisite software development skills, you can submit it as a PR to the Core repo.