Tasmota power plugs MQTT connecting via automation

Hello,

I wanted to connect two of my working and integrated tasmota power plugs. I want that when I power on one device, the other should follow immediately.
The reason for that is I only wanted to trigger one light.

I tried it in the automation like this:

- alias: 'Rear starting'
  trigger:    
    - platform: mqtt
      topic: "plug1/power"
      payload: "on"
   action:
    - service: switch.turn_on
      entity_id:
        - switch.plug2

Waht is wrong there? I try to use the state from one device to trigger the next…

Best regards

- alias: 'Rear starting'
  trigger:
    - platform: state
      entity_id: switch.plug1
  action:
    - service: 'switch.turn_{{ trigger.to_state.state }}'
      target:
        entity_id: switch.plug2
1 Like

Thank you, it works leike a charm!

1 Like