MQTT and Mysensors

Hi!

I’m pulling my hair here. I’m new to using both Arduinos, MQTT and Mysensors.
First of all, I’m trying to figure out how it all works. My idea is to have a MQTT Gateway running on an Arduino, which recieves data from sensors and send it to Hass via MQTT.

I currently have an MQTT Gateway up and running and now I’m trying to configure Hass.

Do I need to specify anything in particular with the mqtt: in my configuration? As I can understand from the docs, just adding mqtt: will start up an embedded MQTT broker. Then I want to add the mysensors: to my hass config and specify as below. However, hass is giving me errors on the mysensors part of the configuration.

Is someone willing to try to explain what I’m not understanding and why Hass won’t accept my mysensors config?

# MQTT Broker
mqtt:

# Mysensors
mysensors:
  gateways:
  - device: mqtt
    persistence_file: '/config/mysensors.json'
    topic_in_prefix: 'mygateway1-out'
    topic_out_prefix: 'mygateway1-in'
  optimistic: false
  persistence: true
  retain: false
  version: '2.0'

It’s probably indentation, given that from the docs…

mysensors:
  gateways:
    - device: mqtt
      persistence_file: 'path/mysensors4.json'
      topic_in_prefix: 'mygateway1-out'
      topic_out_prefix: 'mygateway1-in'
  optimistic: false
  persistence: true
  retain: true
  version: '2.0'

It should look like this ------^