Two Sonoff Similtanously

Hi Guys ,
I have two sonoffs ( one basic , one Touch) both flashed with tasmoto OTA , and working fine when added to HA alone , when adding two of them ( one as light another as a switch) , one of them only works at a time . I have each one configured on a seperate topic per below , please advise what could be the issue :slight_smile:

switch:

  • platform: mqtt
    name: “Living Room Lamp”
    state_topic: “stat/sonoff1/POWER”
    command_topic: “cmnd/sonoff1/power”
    qos: 1
    payload_on: “ON”
    payload_off: “OFF”
    retain: true

Set log level

logger:

light:

  • platform: mqtt
    name: “Kitchen light”
    state_topic: “stat/sonoff3/POWER”
    command_topic: “cmnd/sonoff3/power”
    qos: 1
    payload_on: “ON”
    payload_off: “OFF”
    retain: true

other as the first one but with sonoff1 in Topic

Please can you expand on what you mean by “only one of them works at a time”?

In any case the docs say that the command topic should be “POWER” and not “power”

PS To make it easier for others to help you in future please post your code by (1) pasting in your excerpt, then (2) highlighting it and (3) hitting the </> button in the toolbar

thank you for your feedback. It actually works with “power” too. I will try to do the mods also . I mean that one switch or light works ( controlling from the interface) the other one doesnt work when sliding the switch/light. If i restart one of them , the other one works and the previous one doesnt
 this is a very werid behavior .

Are you able to check what MQTT messages are being posted by both the light and the switch?

I usually do this by using the following command at a terminal -

mosquitto_sub -u USERNAME -P PASSWORD -v -t '\''#'\''

Ya you mean to subscribe to all mqtt messages , but actually am getting ,
pi@raspberrypi:~$ mosquitto_sub -u homeassistant -P welcome -v -t ‘'’#‘'’

maybe mosquitto not installed? cause nothing appears after>>

Are you using the embedded MQTT broker? If so, have you followed the steps in the Testing section?

If you are and you have then it appears that the Sonoffs are not posting to your MQTT broker. Are you sure that the IP address, user name and password are correct on the Sonoffs setup?

EDIT - nothing will appear after the mosquito_sub command until you have triggered an event - either by hitting a button on the Sonoffs or the HA interface. You did do this, right?

I think that the Client ID’s on the sonoffs are the problem.
Should be all different.
Best you leave them at default value (DVES_XXXXXX).

1 Like

Oh der. Didn’t spot that. :slight_smile:

thaaaaaanks guys! yes its the client ID !! Appreciate your response and support :):grinning:

thaaaaanks :slight_smile: