What mqtt QOS is used when automation is calling service Switch: Turn on/off

I have automation, that is calling service Switch: Turn on/off. The switch is mqtt switch and this is the definition:

  - platform: mqtt
    name: "myswitch"
    state_topic: "hass/sonoff/tele/s20-id1/STATE"
    state_off: "OFF"
    state_on: "ON"
    value_template: "{{ value_json.POWER }}"
    command_topic: "hass/sonoff/cmnd/s20-id1/POWER"
    payload_on: "1"
    payload_off: "0"
    availability_topic: "has/sonoff/tele/s20-id1/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
    qos: 1
    retain: false

broker is external:

  port: 1883
  username: pi
  password: xxxxxx

when hass calling the service, I assume it publishes mqtt message, but what QOS is used and can it be modified?


I am afraid this qos is not reflected, when HASS automation calls service Switch: Turn on or you think hass reads this QOS value and issues publish towards MQTT entity with this QOS value? I need to understand it.

yes I read https://www.home-assistant.io/integrations/switch.mqtt/#qos but still it is not clear to me

Well, look at the hass/sonoff/cmnd/s20-id1/POWER topic whith MQTTExplorer, it will tell you which qos was used.

yes as expected, QOS was 0 and not 1

thanks for hint, but now question is how to call service Switch: Turn on/off with QOS 1

Did you ever get an answer to this one ?

I’m finding myself asking the same question.


I actually left this topic as I wanted to have QOS 1 on Tasmota devices and Tasmota does not support QOS anyway.