Skip to content

Add MQTT export component#1518

Closed
fabaff wants to merge 1 commit into
home-assistant:devfrom
fabaff:mqtt-export
Closed

Add MQTT export component#1518
fabaff wants to merge 1 commit into
home-assistant:devfrom
fabaff:mqtt-export

Conversation

@fabaff
Copy link
Copy Markdown
Member

@fabaff fabaff commented Mar 10, 2016

Description:
This component collects and sends all states as one MQTT messages to a given topic. In addition there is the current configuration attached (as shown in the Rest API docs).

Example entry for configuration.yaml (if applicable):

mqtt_export:
  publish_topic: "home/states"

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.

@Bart274
Copy link
Copy Markdown
Contributor

Bart274 commented Mar 10, 2016

What's the use of this export?

Op 10 mrt. 2016 om 19:10 heeft Fabian Affolter notifications@github.com het volgende geschreven:

Description:
This component collects and sends all states as one MQTT messages to a given topic. In addition there is the current configuration attached (as shown in the Rest API docs).

Example entry for configuration.yaml (if applicable):

mqtt_export:
publish_topic: "home/states"
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.
You can view, comment on, or merge this pull request online at:

#1518

Commit Summary

Add mqtt_export component
File Changes

A homeassistant/components/mqtt_export.py (44)
A tests/components/test_mqtt_export.py (47)
Patch Links:

https://github.com/balloob/home-assistant/pull/1518.patch
https://github.com/balloob/home-assistant/pull/1518.diff

Reply to this email directly or view it on GitHub.

@fabaff
Copy link
Copy Markdown
Member Author

fabaff commented Mar 10, 2016

It would save you the trouble of subscribing (again because you already did it in your configuration.yaml file) to all state topics of your devices if your want to use their information in any third-party tool that can handle MQTT like collectd or logstash and elasticsearch. The component sends the details as JSON payload including the attributes which give you access to the friendly_name and any other available field.

With #1496 included this will enable me to create a simple static web page which will use the websocket support of HBMQTT to display state information. I will not use the term "Smart mirror" here but it will go in this direction.

@Bart274
Copy link
Copy Markdown
Contributor

Bart274 commented Mar 10, 2016

Hmm, is the message being retained?
If so, you can try to load the last state of a sensor or device by just reading the last message when HA starts

Op 10 mrt. 2016 om 19:52 heeft Fabian Affolter notifications@github.com het volgende geschreven:

It would save you the trouble of subscribing (again because you already did it in your configuration.yaml file) to all state topics of your devices if your want to use their information in any third-party tool that can handle MQTT like collectd or logstash and elasticsearch. The component sends the details as JSON payload including the attributes which give you access to the friendly_name and any other available field.

With #1496 included this will enable me to create a simple static web page which will use the websocket support of HBMQTT to display state information. I will not use the term "Smart mirror" here but it will go in this direction.


Reply to this email directly or view it on GitHub.

@fabaff
Copy link
Copy Markdown
Member Author

fabaff commented Mar 10, 2016

If so, you can try to load the last state of a sensor or device by just reading the last message when HA starts

There is a story for this kind of feature. It would only make sense to use a retained message if history is not used.

@balloob
Copy link
Copy Markdown
Member

balloob commented Mar 11, 2016

I don't see the benefit of adding another component to export data to MQTT.

For MQTT we already have the MQTT Eventstream component which forwards all events (including state changed) to an MQTT topic.

For the different stats aggregators we have individual components to export the data.

@fabaff
Copy link
Copy Markdown
Member Author

fabaff commented Mar 19, 2016

I think that this PR was open long enough. The requester seems to want something different anyway.

So, the place for this component is in my config/custom_components/ folder.

@fabaff fabaff closed this Mar 19, 2016
@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