Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MQTT server component #1496

Merged
merged 2 commits into from
Mar 13, 2016
Merged

Add MQTT server component #1496

merged 2 commits into from
Mar 13, 2016

Conversation

balloob
Copy link
Member

@balloob balloob commented Mar 7, 2016

Description:
This PR will update the MQTT component. It will now automatically start an embedded broker if no broker config is given and connect to it. It is using the HBMQTT broker.

It will significantly lower the barrier for people that are trying out MQTT.

The default config for the broker is to allow access using user/pass homeassistant / <your api password>

Test with:

# First run HASS with mqtt component activated without any config
# In terminal 1
mosquitto_sub -V mqttv311 -t # -v
# In terminal 2
mosquitto_pub -V mqttv311 -t hello -m world

You can provide config for the embedded server using the embedded config key (see example YAML below).

To do:

  • If no config given, automatically generate one based on your current HTTP configuration
  • Tests
  • HA Shutdown hook to properly shutdown broker

Related issue (if applicable): Fixes #1178

Example entry for configuration.yaml (if applicable):

mqtt:

# or

mqtt:
  embedded:
    # Your HBMQTT config here. Example at:
    # http://hbmqtt.readthedocs.org/en/latest/references/broker.html#broker-configuration

Checklist:

  • Local tests with tox run successfully.
  • TravisCI does not fail. Your PR cannot be merged unless CI is green!
  • Fork is up to date and was rebased on the dev branch before creating the PR.
  • Commits have been squashed.
  • If the code does not interact with devices:
    • Tests have been added to verify that the new code works.

@balloob
Copy link
Member Author

balloob commented Mar 7, 2016

Instead of making this a standalone component, we should have this server be spin up by the MQTT component if no other broker specified.

Default server settings should be same password as http component.

@balloob balloob force-pushed the mqtt-server branch 3 times, most recently from b4f9927 to b616ac7 Compare March 8, 2016 06:21
@balloob balloob changed the title Add MQTT server component (proof of concept) Add MQTT server component Mar 8, 2016
@fabaff
Copy link
Member

fabaff commented Mar 9, 2016

Works like a charm during a short test. I really like the idea of the coupling with the MQTT platforms.

This will definitely lower the barrier to use MQTT. It's not hard to get mosquitto/mosca running but even better if you just can start using something without the hassle of external servers/daemons.

👍

@balloob
Copy link
Member Author

balloob commented Mar 10, 2016

I am waiting for njouanin/hbmqtt#22 to be released before merging this component.

@balloob balloob force-pushed the mqtt-server branch 4 times, most recently from 2d77e2d to bbd223c Compare March 13, 2016 05:37
balloob added a commit that referenced this pull request Mar 13, 2016
@balloob balloob merged commit 7d23a5f into dev Mar 13, 2016
@balloob balloob deleted the mqtt-server branch March 13, 2016 05:53
@maddox
Copy link
Contributor

maddox commented Mar 14, 2016

It will significantly lower the barrier for people that are trying out MQTT.

💃

@home-assistant home-assistant locked and limited conversation to collaborators Mar 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants