Newbe config issues cross talk between switches

i am trying to configure two Sonoff =tasmmoto relays the first one worked fine plant light turns on at dawn off at dusk and the second seemed to work switching the Living room lights BUT when i switch on the plant light manually it also turns on the living room light.They work independently shutting off.

mycnf.yaml

mqtt:
broker: localhost

light:

  • platform: mqtt
    name: “Plant light”
    entity_id: plantlight
    state_topic: “adamson/plantlight/POWER”
    command_topic: “adamson/plantlight/cmnd/POWER”
    qos: 1
    payload_on: “ON”
    payload_off: “OFF”
    retain: true
  • platform: mqtt
    name: “Living Room Light”
    entity_id: livlite
    state_topic: “adamson/livlite/POWER”
    command_topic: “adamson/livlite/cmnd/POWER”
    qos: 1
    payload_on: “ON”
    payload_off: “OFF”
    retain: true

The first thing is that you have to format your configuration using the instructions in the blue box at the top of the pager, otherwise the spacing is lost, which is important.

But to investigate what is actually happening I think first you need to make sure the messages are being sent to the broker. Try this from the command line

mosquitto_sub -v -t "'#"

which will print all messages displayed by the broker.

Secondly, check the log of your broker, to make sure both switches are connected all the time. You did use a different client_id on each sonoff didn’t you?

This is what i get with a single click on my Plant light

cmnd/adamson/plantlight/POWER ON
stat/plantlight/RESULT {“POWER”:“ON”}
stat/plantlight/POWER ON
cmnd/adamson/plantlight/POWER ON
stat/plantlight/RESULT {“POWER”:“ON”}
stat/plantlight/POWER ON
cmnd/adamson/livingroomlight/POWER ON
stat/livingroomlight/RESULT {“POWER”:“ON”}
stat/livingroomlight/POWER ON
tele/adamson/livingroomlight/STATE {“Time”:“2017-10-16T04:49:37”, “Uptime”:13, “Vcc”:3.214, “POWER”:“ON”, “Wifi”:{“AP”:1, “SSId”:“2WIRE703”, “RSSI”:82, “APMac”:“6C:72:20:12:4C:D0”}}
tele/adamson/plantlight/STATE {“Time”:“2017-10-16T04:49:42”, “Uptime”:14, “Vcc”:3.195, “POWER”:“ON”, “Wifi”:{“AP”:1, “SSId”:“2WIRE703”, “RSSI”:74, “APMac”:“6C:72:20:12:4C:D0”}}

I do not see any dropout in the brocker log

None of the topics in your log match the configuration in your first post, so its hard to help at all. The only speculation I can make is that your living room light is subscribing to multiple topics, possibly using the # flag.