mqtt:
  switch:
    - unique_id: switch1
      name: "ESP-01 switch1"
      state_topic: "ESP-01/switch/state"
      command_topic: "ESP-01/switch/set"
      payload_on: "ON"
      payload_off: "OFF"
      state_on: "ON"
      state_off: "OFF"
      optimistic: false
      qos: 0
      retain: true
    - unique_id: switch2
      name: "ESP-01 switch2"
      state_topic: "ESP-02/switch/state"
      command_topic: "ESP-02/switch/set"
      payload_on: "ON"
      payload_off: "OFF"
      state_on: "ON"
      state_off: "OFF"
      optimistic: false
      qos: 0
      retain: true 
  
 
我这边用的mqtt的开关,试试看正常不正常 |