Installing Mosquitto Broker on Raspberry PI running Hass.io

I read all the logs, searched this forum but cant see what I am missing when trying to get Mosquitto on my Raspberry PI running Hass.io
I use raspberry Pis a lot, I have 10 of them and am very familiar with Ubuntu 16.04. Having said that Hass,io is a mystery. No sudo when I SSH in, no access to lots of Ubuntu goodies, looks like Hass.io really locks you down.
I followed the welcome video on set up and installed Configurator, SSH, SAMBA all worked fine. Then I tried installing Mosquitto. I followed the instructions, modified the configuration.yaml to add

mqtt:
  broker: core-mosquitto
  username: admin
  password: xxxxxxx

and modified the config for MQTT to add a password, set customise to ‘true’, created a ‘insecure.conf’ file in share/mosquitto to restrict access to only port 8883 externally etc.
Then I get nothing but errors saying port 1883 and 8883 are already in use. Looks like there is some cutdown MQTT broker already in HASS.IO.
So I read the info on Mosquitto and it says:

If you are running a Mosquitto instance on the same server as Home Assistant then you must ensure that the Mosquitto service starts before Home Assistant. For a Linux instance running Systemd (Raspberry Pi, Debian, Ubuntu and others) then you should edit the file /etc/systemd/system/[email protected] as root (e.g., sudo nano /etc/systemd/system/[email protected]) and add the mosquitto service

So I SSH in, cant run sudo, there is no directory systemd under etc (which there damn well should be in Ubuntu) so now I am frustrated. I have set up MQTT Brokers dozens of times, never seen it so hard in an application as it is in Hass.io

Help please.

Your configuration.yaml should look like the following:

mqtt:
  broker: localhost
  discovery: true
  username: username
  password: password

My Hass.io Mosquito config looks like this:

{
  "plain": true,
  "ssl": false,
  "anonymous": false,
  "logins": [
    {
      "username": "username",
      "password": "password"
    }
  ],
  "customize": {
    "active": false,
    "folder": "mosquitto"
  },
  "certfile": "fullchain.pem",
  "keyfile": "privkey.pem"
}

Thanks, that worked, but is completely different to the guide on the hass.io website which has the configuration I showed.

Mine looks like yours and works too. What are your addon settings?

Because it isn’t a general Linux distro. You’re not supposed to have those things. It’s an appliance. Use the ADD-ONS.

Because it isn’t Ubuntu.

There also is nothing else running on the host OS but Docker.

The home-automation website has 1094 components. The hass.io implementation on my raspberry pi shows 20 official ADD-ONs and 20 Community Hass.io Add-ons.

Does this make the Raspberry Pi almost pointless as a home-automation device?

Would I not be better just installing Ubuntu 16.04 on it and then I would get access to the much richer set of components? It has lots of devices I own on the Home Automation components list:
D-Link
z-wave
Onkyo
Sonoff (via MQTT)
LG WebOS Smart TV

etc
Is this docker super light version of Home Automation the poor cousin?

You can configure and use all the components with hassio - all 1094 of them. However any components that require you to install something with Linux won’t work unless there is a provided hassio addon.

You should have no problems with any of the devices you are trying to use that you listed.

Hassio is not the poor cousin - it’s just different. Hassio is pretty much the only way Home Assistant can ever become mainstream.

You are confusing the terminology.

Add-ons are not components. Components are usabe by home assistant no matter how you installed it, albeit with very few caveats as @DavidFW1960 mentioned.

@flamingm0e
Can you provide a description on the difference between an add-on and a component then? Are components just entries into configuration.yaml?
On a similar topic, if i add something like

media_player:
  - platform: webostv
    host: 192.168.2.204
    name: Living room TV

does it then load some interface from the web to support webostv?

Basically yes.

It’s already installed

If you find a component that you want to use that DOESN’T require installing things manually, then you just add the components to your config.

So all 1094 components are already installed in my Hass.io docker on the Raspberry Pi. If new components become available does this update?

MOST of them are. If you find things that require INSTALLATION of anything in the component page, you will have to find out what it is asking for and if hassio already has it.

Every major update to Home Assistant adds new components, just have a look at the release notes.

Hey guys, im trying to test a Basic MQTT Example on Mosquitto broker (https://www.home-assistant.io/cookbook/python_component_mqtt_basic/) but i got this:

Ivalid Config
The following components and platforms could not be set up: .hello-mqtt Please cher your config

Any ideas?

With hassio you need the MQTT Broker addon installed.

Im getting Error during setup of component hello_mqtt

so your issue is one of CREATING A CUSTOM COMPONENT and it’s not working. This has nothing to do with getting MQTT running.

If you have an issue when you create a custom component you need to start your own thread. You do not create custom components to turn on MQTT.

Hi,

I am just beginner with Hassio.
Newest version of Mosquitto MQTT there seems to be not anymore “plain” and “ssl” parametres available?
What was the purpose of these?

Just curious while learning to make setup and understanding it.

Br,
Jussi