How to change the increment value

Hi,

I’m working on an S0PCM5 sensor, to count pulses from the utility sensors.
That is working fine most of the time, but sometimes it misses some pulses.

For that reason, I have a helper for each counter (just talking about the first one, to keep things short):

input_number.m1_offset

When I notice I missed pulses, I need to correct this offset. For various reasons, I want to to this with a button, which increments this offset. So I made a helper button:

input.button.add_m1

On the dashboard, I added a ‘Button’ card, selected this button, and on the click action, I used:

call_service: input_number.increment -> entity: input_number.m1_offset

When I click the button, the input_number is incremented with 0.001, which is the step size of the input_number.m1_offset helper.

Because my correction can be bigger, I want to know if there is a way to change the value of this increment, eg 0.01, 0.1, 1, or even -1.

I’ve put this in a grid card, which results in the following yaml:

square: true
columns: 2
type: grid
cards:
  - type: entity
    entity: input_number.m1_offset
  - show_name: true
    show_icon: true
    type: button
    tap_action:
      action: call-service
      service: input_number.increment
      data: {}
      target:
        entity_id: input_number.m1_offset
    entity: input_button.add_m1
    hold_action:
      action: none

Is it possible to change the value the service is incrementing with?

Marcel

You can make separate buttons with separate step sizes:

    tap_action:
      action: call-service
      service: input_number.increment
      data:
        step: 0.1

Hi tom_i,
Thanks for your reply, but unfortunately it doesn’t work:

show_name: true
show_icon: true
type: button
tap_action:
  action: call-service
  service: input_number.increment
  data:
    step: 10
  target:
    entity_id: input_number.add_testnumber
entity: input_button.add10
name: '+10'

Gives me:

I was wondering where I can find that/if the data field accepts attrib/value pairs, and what attribs are valid?

I am missing a kind of reference guide, where all the possibilities are listed, with an explanation. Any pointers?

https://www.home-assistant.io/integrations/input_number/#services

Looks like step is fixed to a single value.

You’d have to make your own increment script if you want a variable step.