What's wrong with this syntax?

I have the following in configuration.yml:

switch:
  - platform: mqtt
    name: "Alert Delays"
    state_topic: "nfc/alert_delays"
    command_topic: "nfc/alert_delays"
    qos: 1
    payload_on: "yes"
    payload_off: "no"
    retain: true

  - platform: mqtt
    name: "Vacation"
    state_topic: "nfc/vacation"
    command_topic: "nfc/vacation"
    qos: 1
    payload_on: "yes"
    payload_off: "no"
    retain: true

However, only one switch shows up in the dashboard. Sometimes it’s the first one, after a restart it can be the second one. Seems one random gets picked.

I don’t have MQTT switches, but I wonder if the issue is that some platforms define like this:

switch 1:
  - platform: mqtt
    name: "Alert Delays"
    state_topic: "nfc/alert_delays"
    command_topic: "nfc/alert_delays"
    qos: 1
    payload_on: "yes"
    payload_off: "no"
    retain: true

switch 2:
  - platform: mqtt
    name: "Vacation"
    state_topic: "nfc/vacation"
    command_topic: "nfc/vacation"
    qos: 1
    payload_on: "yes"
    payload_off: "no"
    retain: true

I found the issue. I was using Mosquitto on Ubuntu 14, which requires the following setting in the broker config:

protocol: 3.1