ESPHome: button : template : how to pass variables?

I’ve implemented Atlas Scientific EZO ORP and pH sensor boards and its all mostly figured out. Both boards allow calibration and I’d like to have on Home Assistant (HA) dashboard a button to push (with calibration standard) so when I emerse probe into calibration standard just push button and set. Right now I have a button but had to hard code it for a particular standard value. I’d like to pass a value but it looks like ESPHome button/Template doesn’t support passed variables. Is that true or is there a way around it? Thanks in advance.

button:

  • platform: template
    name: “Orp Calibration”
    on_press:
    • logger.log: “Button Pressed”
    • lambda: id(orp_ezo).send_custom(“Cal,225”);

orp cal button press

Depends on where you are going to get the value

button:
  platform: template
  name: “Orp Calibration”
  on_press:
    - logger.log: “Button Pressed”
    - lambda: |-
        id(gloabal_var) = id(something).state;

or

    - lambda: |-
        id(gloabal_var) = id(something);

But maybe you can use a number template:

number:
  - platform: template
    name: "Template number"
    id: calibration_number
    optimistic: true
    min_value: 0
    max_value: 100
    step: 1
    restore_value: true

So you can use something like this:

sensor:
  - platform: template
    name: Calibration
    lambda: |-
        return (id(calibration_number).state * 3.1415);    

Thanks will try those methods