YAML syntax

Hi, I am trying to add a switch in YAML that, rather than and on/off state, it simply sends a payload with a value of 0 (zero) when you press it (I think it’s called a momentary switch. Also is there a way to have a confirmation dialog box (maybe a modal) appear when you press it, so an “Are Yo Sure - Y/N” choice? This is what I have written so far with the topic that needs to be published with a payload of zero. Not sure if I need to use ‘mode_command_topic’ or some other variant. Can anyone help me?

switch:

  • name: Afterburner Fuel Reset
    unique_id: afterburner_fuel_reset
    command_topic: "AfterburnerXXXXXX/sts/PumpCount"
    {% if value == "1" %}
    0
    {% endif  %}`Preformatted text`
    

It is impossible to read your code.
Edit your text and mark your code text and then click the </> icon.

For momentary functionality, you likely want a MQTT Button instead of a switch.

OK I’ve done it