From 2a0eb99bd56af4c266435dc76b5cfb998da81172 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Wed, 24 Jun 2020 19:03:38 +0200 Subject: [PATCH] Remove deprecated internal MQTT broker (#13833) * Remove deprecated internal MQTT broker * :pencil2: Process review comments --- source/_docs/mqtt/broker.markdown | 47 ------------------- source/_docs/mqtt/discovery.markdown | 6 --- source/_docs/mqtt/testing.markdown | 12 ----- source/_integrations/mqtt.markdown | 14 ------ ...s-to-use-mqtt-with-home-assistant.markdown | 2 +- ...ded-mqtt-broker-uber-yamaha-growl.markdown | 3 +- source/_posts/2017-10-28-demo.markdown | 5 +- 7 files changed, 5 insertions(+), 84 deletions(-) diff --git a/source/_docs/mqtt/broker.markdown b/source/_docs/mqtt/broker.markdown index 893843346cb..3e71ff41e7e 100644 --- a/source/_docs/mqtt/broker.markdown +++ b/source/_docs/mqtt/broker.markdown @@ -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. - -### 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 -``` - -
-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. -
- -
- -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. - -
- -#### 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 -``` diff --git a/source/_docs/mqtt/discovery.markdown b/source/_docs/mqtt/discovery.markdown index b29f357e909..6e6df14030b 100644 --- a/source/_docs/mqtt/discovery.markdown +++ b/source/_docs/mqtt/discovery.markdown @@ -43,12 +43,6 @@ discovery_prefix: type: string {% endconfiguration %} -
- -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. - -
- The discovery topic need to follow a specific format: ```text diff --git a/source/_docs/mqtt/testing.markdown b/source/_docs/mqtt/testing.markdown index a3eeacd7bd7..8870b0ffaf7 100644 --- a/source/_docs/mqtt/testing.markdown +++ b/source/_docs/mqtt/testing.markdown @@ -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 -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 -t "#" -``` diff --git a/source/_integrations/mqtt.markdown b/source/_integrations/mqtt.markdown index 7e15e1de438..b2d5b055d7c 100644 --- a/source/_integrations/mqtt.markdown +++ b/source/_integrations/mqtt.markdown @@ -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. - -
-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. -
- -```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/) diff --git a/source/_posts/2015-09-11-different-ways-to-use-mqtt-with-home-assistant.markdown b/source/_posts/2015-09-11-different-ways-to-use-mqtt-with-home-assistant.markdown index d3e86ee1b71..88cb2946445 100644 --- a/source/_posts/2015-09-11-different-ways-to-use-mqtt-with-home-assistant.markdown +++ b/source/_posts/2015-09-11-different-ways-to-use-mqtt-with-home-assistant.markdown @@ -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: diff --git a/source/_posts/2016-03-26-embedded-mqtt-broker-uber-yamaha-growl.markdown b/source/_posts/2016-03-26-embedded-mqtt-broker-uber-yamaha-growl.markdown index d8bd4653398..88be2585a35 100644 --- a/source/_posts/2016-03-26-embedded-mqtt-broker-uber-yamaha-growl.markdown +++ b/source/_posts/2016-03-26-embedded-mqtt-broker-uber-yamaha-growl.markdown @@ -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 diff --git a/source/_posts/2017-10-28-demo.markdown b/source/_posts/2017-10-28-demo.markdown index c361170d3da..0294193f663 100644 --- a/source/_posts/2017-10-28-demo.markdown +++ b/source/_posts/2017-10-28-demo.markdown @@ -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