MQTT service installation not working

Hi Guys trying to add a MQTT broker to HA with the following code but when launching HA/services mqtt publish option is not avialable

mqtt
  broker: 192.168.2.1
  port: 1883
  client_id: home-assistant
  username: username
  password: xxxx
  keepalive: 60
  protocol: 3.1.1

any one help

mqtt must end with a colon.
Here’s mine

mqtt:
  broker: 127.0.0.1
  port: 1883
  client_id: home-assistant-1
  keepalive: 60
  protocol: 3.1
#  username: USERNAME
#  password: PASSWORD

Edit: and please read the blue box on top of every page here. :slight_smile:

Hello

Thank you for the help but it still does not work.

mqtt:
   broker: 192.168.2.1
   port: 1883
   client_id: home-assistant-1
   keepalive: 60
   protocol: 3.1
   username: username
   password: password
when HA starts it list mqtt as invalid config

On wich OS runs your HA?
MQTT broker installed and running?

Edit: Aaahh, your indentation is not correct. There should be two spaces in front.

mqtt:
  broker: ...

I changed it to two spaces makes no difference.

I have a linux device running mosquito and is subscribed to a topic. HA is installed on windows 10 and they connect via Ethernet cable .

Strange! Firewall on WIndows 10?
Anything in the logs of mosquitto?
Here’s a mosquitto.conf that Hassbian uses https://github.com/home-assistant/hassbian-scripts/blob/master/files/mosquitto.conf
Then i give up for now!

Btw, if you have a Linux device, why not running HA on it?

Im not sure if i can. the linux device is a multitech lora gateway. dont want to mess with its other duties

The config looks fine to me also. Can you show your HA log file so we can see the exact error.