Send 2 mqtt topic with a switch

Hi all,
someone know if, and how, it’s possible send 2 mqtt topic/payload using a switch ?

I have 2 switch:
1 - relay1 on/off
2 - ralay2 on/off

I need a switch to turn off both the relay.

Thnaks you
Alessandro

I have 2 relay controls. One is single relay the other is double relay. I control both differently.

switch 4:
  - platform: mqtt
    name: Das Relay
    state_topic: homie/a020a6125481/light/on
    command_topic: homie/a020a6125481/light/on/set
    payload_on: 'true'
    payload_off: 'false'
    optimistic: false
    qos: 0
    retain: true

And the other one is done using aRest. Relay 2 is the same just different digital pin.

switch 6:
  platform: command_line
  switches:
    arest_pin_two:
      command_on: '/usr/bin/curl -X GET http://192.168.20.25/digital/2/0'
      command_off: '/usr/bin/curl -X GET http://192.168.20.25/digital/2/1'
      friendly_name: Relay 1

Hi,
my case is different. I have a 2 relay board controlled via mqtt for a windows cover.
Hi have 2 switch, on for open the cover (power on relay1) and the second for close the cover (power on relay2).
I want to add a switch to stop the cover, in this case I should send 2 mqtt topic:

  • power off relay1
  • power off relay2

Regards
Alessandro

Could you find a solution i have the same Problem.

Hi @Phoenix,
the first solution is using nodered for relay cntrol, so my mqtt command is for nodered who does all the work.
The last solution is the interlock function added to the firmware, I use Electodragon relay board,