Conditional payload on Switch

is there someone who can help me with mqtt switch please?

switch:
  - platform: mqtt
    name: "Room AC"
    command_topic: "cmnd/smartostatac/IRsend"
    qos: 0
    payload_on: "loud_on"
    payload_off: "off"

Is it possible to have a conditional payload on a mqtt switch like that based on a toggle? how can I create the toggle that should “conditionate” the payload_on of the switch? Is this possible?

Basically I would like to have a toggle named silent, if the toggle is ON, the payload_on of the switch should change from “loud_on” to “silent_on”.

Any help could be really appreciated.

The way to do it would be to have an input select that has "loud’, "silent’ and ‘off’ as options.

Trigger an automation whenever the input select changes. Use the mqtt publish service in the actions to send a message depending on the trigger_to state (templating).