Remove deprecated internal MQTT broker (#13833)

* Remove deprecated internal MQTT broker

* ✏️ Process review comments
This commit is contained in:
Franck Nijhof 2020-06-24 19:03:38 +02:00 committed by GitHub
parent 8f31b710e1
commit 2a0eb99bd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 5 additions and 84 deletions

View File

@ -116,50 +116,3 @@ Home Assistant will automatically load the correct certificate if you connect to
If you experience an error message like `Failed to connect due to exception: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed`, then add `certificate: auto` to your broker configuration and restart Home Assistant.
</div>
### Embedded broker (Deprecated)
Home Assistant contains an embedded MQTT broker called [HBMQTT](https://pypi.python.org/pypi/hbmqtt). If you don't have an MQTT broker, you can configure this one to be used. If configured, Home Assistant will automatically connect to it.
| Setting | Value |
| -------------- | ---------------------------------- |
| Host | localhost |
| Port | 1883 |
| Protocol | 3.1.1 |
| User | `homeassistant` |
| Password | _password set under MQTT settings_ |
| Websocket port | 8080 |
```yaml
# Example configuration.yaml entry
mqtt:
password: hello
```
<div class='note warning'>
As of release 0.92, the embedded broker has been marked as deprecated. This means bugs may not be fixed, and the functionality may be removed in a future release.
</div>
<div class='note warning'>
There is [an issue](https://github.com/beerfactory/hbmqtt/issues/62) with the HBMQTT broker and the WebSocket connection that is causing a memory leak. If you experience this issue, consider using another broker like Mosquitto.
</div>
#### Owntracks
To use Owntracks with the internal broker a small configuration change must be made in order for the app to use MQTT protocol 3.1.1 (Protocol Level 4).
In the Owntracks preferences (Android: v1.2.3+, iOS: v9.5.1+) open **Configuration Management**; Find the value named `mqttProtocolLevel` and set the value to `4`. The application will now use MQTT 3.1.1 to connect, which is compatible with the embedded broker.
#### Settings
If you want to customize the settings of the embedded broker, use `embedded:` and the values shown in the [HBMQTT Broker configuration](http://hbmqtt.readthedocs.org/en/latest/references/broker.html#broker-configuration). This will replace the default configuration.
```yaml
# Example configuration.yaml entry
mqtt:
embedded:
# Your HBMQTT config here. Example at:
# http://hbmqtt.readthedocs.org/en/latest/references/broker.html#broker-configuration
```

View File

@ -43,12 +43,6 @@ discovery_prefix:
type: string
{% endconfiguration %}
<div class='note'>
The [embedded MQTT broker](/docs/mqtt/broker#embedded-broker) does not save any messages between restarts. If you use the embedded MQTT broker you have to send the MQTT discovery messages after every Home Assistant restart for the devices to show up.
</div>
The discovery topic need to follow a specific format:
```text

View File

@ -10,12 +10,6 @@ The `mosquitto` broker package ships commandline tools (often as `*-clients` pac
mosquitto_pub -h 127.0.0.1 -t home-assistant/switch/1/on -m "Switch is ON"
```
If you are using the embedded MQTT broker, the command looks a little different because you need to add the MQTT protocol version and your [broker credentials](/docs/mqtt/broker#embedded-broker).
```bash
mosquitto_pub -V mqttv311 -u homeassistant -P <broker password> -t "hello" -m world
```
Another way to send MQTT messages by hand is to use the "Developer Tools" in the Frontend. Choose the "MQTT" tab. Enter something similar to the example below into the "Topic" field.
```bash
@ -46,9 +40,3 @@ For reading all messages sent on the topic `home-assistant` to a broker running
```bash
mosquitto_sub -h 127.0.0.1 -v -t "home-assistant/#"
```
For the embedded MQTT broker the command looks like:
```bash
mosquitto_sub -v -V mqttv311 -u homeassistant -P <broker password> -t "#"
```

View File

@ -29,20 +29,6 @@ mqtt:
broker: IP_ADDRESS_BROKER
```
You can also use the [embedded MQTT broker](/docs/mqtt/broker#embedded-broker-deprecated). A separate broker is advised for more stability.
<div class='note warning'>
As of release 0.92, the embedded broker has been marked as deprecated. This means bugs may not be fixed, and the broker functionality will be removed in a future release.
</div>
```yaml
# Example configuration.yaml entry
mqtt:
password: hello
```
This allows you to connect to the MQTT broker with user `homeassistant` and password `hello`.
## Additional features
- [Certificate](/docs/mqtt/certificate/)

View File

@ -20,7 +20,7 @@ This post will give you a small overview of some other possibilities on how to u
## Manual usage
The simplest but not the coolest way as a human to interact with a Home Assistant sensor is launching a command manually. Let's create a "Mood" sensor. For simplicity Home Assistant and the MQTT broker are both running on the same host. The needed configuration snipplets to add to the `configuration.yaml` file consists of two parts: one for the broker and one for the sensor.
The simplest but not the coolest way as a human to interact with a Home Assistant sensor is launching a command manually. Let's create a "Mood" sensor. For simplicity Home Assistant and the MQTT broker are both running on the same host. The needed configuration snippets to add to the `configuration.yaml` file consists of two parts: one for the broker and one for the sensor.
```yaml
mqtt:

View File

@ -8,7 +8,7 @@ author_twitter: balloob
categories: Release-Notes
---
Party people, 0.16 is here! The big thing with this release is that we have completely removed the barrier to get started by MQTT by being able to launch an embedded MQTT server: [hbMQTT]. Just add `mqtt:` to your config and a broker is launched and connected with Home Assistant. See the [documentation][embedded server] for more info.
Party people, 0.16 is here! The big thing with this release is that we have completely removed the barrier to get started by MQTT by being able to launch an embedded MQTT server: [hbMQTT]. Just add `mqtt:` to your config and a broker is launched and connected with Home Assistant.
Further in this release a bunch of cool new stuff, bug fixes and rewrites for the Vera and Tellstick component (see breaking changes section at bottom for this!).
@ -49,7 +49,6 @@ Rock on.
[@robbiet480]: https://github.com/robbiet480
[@srcLurker]: https://github.com/srcLurker
[@stefan-jonasson]: https://github.com/stefan-jonasson
[embedded server]: /integrations/mqtt/#use-the-embedded-broker
[Arduino]: /integrations/arduino#switch
[Discovery]: /integrations/discovery/
[Growl (GNTP)]: /integrations/gntp

View File

@ -89,14 +89,15 @@ binary_sensor:
## MQTT Discovery
This is a section for advanced users as it will require to run a separate script. Instead of adding `demo` platforms to the configuration this setup make use of [MQTT discovery](/docs/mqtt/discovery/) and the [embedded MQTT broker](/docs/mqtt/broker/#embedded-broker). Simply add MQTT to your `configuration.yaml` file with `discovery:`
This is a section for advanced users as it will require to run a separate script. Instead of adding `demo` platforms to the configuration this setup make use of [MQTT discovery](/docs/mqtt/discovery/). Simply add MQTT to your `configuration.yaml` file with `discovery:`
```yaml
mqtt:
host: YOUR_MQTT_HOST
discovery: true
```
Download the [sample script](https://github.com/home-assistant/home-assistant-dev-helper/blob/master/ha-mqtt-demo.py). It depends on [paho-mqtt](https://pypi.python.org/pypi/paho-mqtt). If you run the script inside your [Home Assistant's virtual environment](/docs/installation/virtualenv/) then you are good to go as the dependency should be present if you have used MQTT before. Otherwise, install it with `$ pip3 install paho-mqtt`. The same applies to the embedded broker.
Download the [sample script](https://github.com/home-assistant/home-assistant-dev-helper/blob/master/ha-mqtt-demo.py). It depends on [paho-mqtt](https://pypi.python.org/pypi/paho-mqtt). If you run the script inside your [Home Assistant's virtual environment](/docs/installation/virtualenv/) then you are good to go as the dependency should be present if you have used MQTT before. Otherwise, install it with `$ pip3 install paho-mqtt`.
```bash
(ha)[ha-demo]$ python3 ha-mqtt-demo.py