I can´t configure multiple switchs in Hassbian

Hello everyone,

i have a Hassbian 0.74 and in configuration.yaml added two switches, but in the home assistant just appear and work well the 1st switch, i already tried change the identation of several ways, but none of them worked.

anyone ave idea how i can solve this?

switch:

  • platform: mqtt
    mqtt name: “sonoff_escritorio_interior”
    state_topic: “stat/sonoff_escritorio/POWER1”
    command_topic: “cmnd/sonoff_escritorio/power1”
    qos: 0
    payload_on: “ON”
    payload_off: “OFF”
    retain: true

  • platform: mqtt
    mqtt name: “sonoff_escritorio_exterior”
    state_topic: “stat/sonoff_escritorio/POWER2”
    command_topic: “cmnd/sonoff_escritorio/power2”
    qos: 0
    payload_on: “ON”
    payload_off: “OFF”
    retain: true

You need to follow the instructions (which are thankfully back!) at the top of the page to properly format your code. But, even so, I think this is the problem:

mqtt name: "sonoff_escritorio_interior"

and

mqtt name: "sonoff_escritorio_exterior"

The parameter is name:, not mqtt name:. Change these lines to:

name: "sonoff_escritorio_interior"

and

name: "sonoff_escritorio_exterior"
1 Like

Alright pnbruckner, sorry about this but it was my first publication :slight_smile: Thank you very much, it works finally! :wink:

No worries. Most new posters need a gentle nudge about formatting. :slight_smile:

Glad it’s working for you!