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

Reduce MQTT overhead #1181

Open
IgnacioHR opened this issue Nov 23, 2024 · 0 comments
Open

Reduce MQTT overhead #1181

IgnacioHR opened this issue Nov 23, 2024 · 0 comments

Comments

@IgnacioHR
Copy link

Describe the bug

The MQTT Integration is a nice feature to integrate with Home Assistant. Thanks for supporting it.

Recently, I've followed a similar approach when doing my own integration for another device (diematic_server) and I noticed this integration should benefit for my findings too so I'm documenting them here.

This is a screen capture of my mqtt broker.
image

At the bottom, there is the ecowitt integration running and my diematic2mqtt integration. Both have a topic with values published as they are collected from the device.

This is a screen capture of one of the sensors.
image

The specific comments are:

  1. The state should't be there at all. The state_topic from the config should point to the bottom ecowitt/meteo and use value_template to pick up the value of the winddir from there. This way, the simple push to ecowitt/meteo fires the update at home assistant.
  2. The availability topic shall be global for the device. Set a last will and testament message to the broker so when the connection is lost the front end is notified and the entities are represented as unavailable. If there is a possibility for a single entity to be unavailable use the alternative availability syntax where multiple topics can be referenced.
  3. The attributes is not used at all and shall be removed.

To Reproduce
Steps to reproduce the behavior:

This section does not apply.

Expected behavior

There should be no publish messages to the mqtt server under the "homeassistant/sensor/{device-id} other than just the one to fire the mqtt discovery (once when the connection is first stablished) and then, the messages to update the values to "ecowitt/meteo" to set the values periodically.

I hope this information helps yo to move forward this repository as it has served me to kick off doing my own mqtt integration and learn about how to work with messages brokers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant