-
Notifications
You must be signed in to change notification settings - Fork 694
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
feat: bundle MQTT data in one json blob #3660
Comments
Continued discussion from #3657, focussed on active drive navigation data: I fully agree, for "same time define data" such as latlong and initial navigation state. For the other travel ETA's not so much, these update throughout the journey, which will require to update the complete blob. It is likely that the latlong will be set (data will be pushed/updated) and the route will still be calculating, resulting in two messages anyway, not solving the issue. This can be tested Also adding more stuff to a big json requires the processing client (often HA) to parse this json, where normally an mqtt topic can be read easily. I think both ways can be done and advocated for, zigbee2mqtt is more json based too, but i'd suggest to not wait for a possible complete revamp of the mqtt structure for this awesome change already. |
Also in regards to the other discussion #3657 It would be nice to have the distance and minutes to destination into MQTT so that I could automate things for my Home Assistant instance. |
That's already merged and will be included in the next release. |
I would like to make sure I understand the intent here. The idea is to group similar topics into a single topic with a json payload. for example
and
would be made available as
but not to group all topics into a single json payload...
While I can see the value in grouping |
Correct, the idea is to bundle the data which belongs together, like position data in one Json blob, time and distance to destination. |
Tagging @tobiasehlert and @brchri as their projects consume Teslamate MQTT payloads. |
Just confirming that my PR did not include distance and minutes in the MQTT output, I only added it to the state parser |
Thanks for clarification, absolutely right. |
I want to fix this now, but not sure what format I should use, examples include:
1 and 2 are smaller, but could be confusing, easy to get latitude and longitude confused. Not sure about 3rd party support[1] I am not particularly fussed either way, but is important we try to get this right from day 0. Notes: [1] I think it might be possible in home-assistant, see https://community.home-assistant.io/t/split-sensor-data-into-two-using-comma-as-delimiter/567217. For node-red guessing https://flowfuse.com/node-red/core-nodes/split/ might work. |
I vote 3 or 4, for what it's worth. json is a standard for this type of usage, and for third parties, it seems like making an opinionated decision on whether lat or lng should be first could be contentious and compatibility may vary by consumer; json takes out the guesswork for consumers. I'm not particularly opinionated on elevation being included, but as food for thought, KML spec does optionally bundle altitude with lat and lng when defining geofences, but I'm really not sure it matters as much. |
I vote for option 4. |
* Add location topic Fixes #3660. * doc: update mqtt topics with new location topic --------- Co-authored-by: Jakob Lichterfeld <jakob-lichterfeld@gmx.de>
(see #3657 (comment))
The text was updated successfully, but these errors were encountered: