[SOLVED] MQTT Select Command template

I have an HP integrated into HA via ebusd, so far so good, I’m able to read and modify many numerical parameters via native (MQTT discovery) integration.
I have a slight problem in setting the pump operation mode, this is a choiche between 3 different states, I have set-up a MQTT select config in my YAML and the reading part works correctly.
I have a problem with writing the correct value with command_template statement, here is my current YAML:

- select:
      name: "HP Pump Modulation"
      unique_id: hp_pump_modulation_mqtt
      options:
        - "Low Speed"
        - "High Speed"
        - "Modulating"
      state_topic: "ebusd/heatpump/pump_operation"
      value_template: >
        {% if value_json['0'].value ==  "low_speed" %} Low Speed
        {% elif value_json['0'].value == "high_speed" %} High Speed
        {% elif value_json['0'].value == "modulating" %} Modulating
        {% endif %}
      command_topic: "ebusd/heatpump/pump_operation/set"
      command_template: >
        {% if value == "Low Speed" %}
           'low_speed'
        {% elif value == "High Speed" %}
           'high_speed'
        {% elif value == "Modulating" %}
           'modulating'
        {% endif %}

the reading works as the state_topic is interpreted, here a JSON message:

{
  "0": {
    "name": "",
    "value": "high_speed"
  }
}

using MQTT Explorer I’m able to write the value using the topic

ebusd/heatpump/pump_operation/set

and in raw mode I simply enter one of the 3 options in the raw section:

How can I do the same via commad_template statement?

TY

Ok, double stupid mistake, first there was a misspelling on the “Modulating” entry then I realized that ebusd integration for this kind of write operations (simple string values converted by ebusd to decimal then hex values) needs to be passed via MQTT without any quoting.

For anyone needing the info this is the correct YAML, tested and working.

  - select:
      name: "HP Pump Modulation"
      default_entity_id: select.hp_pump_modulation_mqtt
      unique_id: hp_pump_modulation_mqtt
      options:
        - "Low Speed"
        - "High Speed"
        - "Modulating"
      state_topic: "ebusd/heatpump/pump_operation"
      value_template: >
        {% if value_json['0'].value ==  "low_speed" %} Low Speed
        {% elif value_json['0'].value == "high_speed" %} High Speed
        {% elif value_json['0'].value == "modulating" %} Modulating
        {% endif %}
      command_topic: "ebusd/heatpump/pump_operation/set"
      command_template: >
        {% if value == "Low Speed" %}
           low_speed
        {% elif value == "High Speed" %}
           high_speed
        {% elif value == "Modulating" %}
           modulating        
        {% endif %}