HA MQTT configuration help

Hi

In order to start learning yaml configs and HA, I thought I would setup a simple MQTT broker / client scenario using the example configuration from the HA MQTT blog page: https://home-assistant.io/blog/2015/09/11/different-ways-to-use-mqtt-with-home-assistant/. This requires two additions to configuration.yaml, namely:

mqtt:
  broker: 127.0.0.1

sensor:
  - platform: mqtt
    name: "Fabian's Mood"
    state_topic: "home-assistant/fabian/mood"

After rebooting however, HA fails to start and I get a log entry of:

16-11-20 23:10:19 homeassistant.util.yaml: duplicate key: "sensor"

So, I changed ‘sensor’ to sensor2. HA now boots, but I get a log entry of:

'16-11-20 23:33:08 homeassistant.loader: Unable to find component sensor2'

searching for help and hints seems to confirm that the singular term ‘sensor’ should be correct.

Any advice to help me move on to the next point of failure???

Cheers!

Tom

Group your sensor with the existing sensor: that you’ve already defined. You should only have a single sensor: block.

sensor:
  - platform: mqtt
    name: sensor one
  - platform: time_date
    display_options:  
      - 'time'
      - 'date'
      - 'date_time'

That makes so much sense!

Many thanks.