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

Offer device discovery broadcast over MQTT #45

Open
GraffJosh opened this issue Jul 19, 2024 · 5 comments
Open

Offer device discovery broadcast over MQTT #45

GraffJosh opened this issue Jul 19, 2024 · 5 comments

Comments

@GraffJosh
Copy link

This one might be a bit out of scope of this plugin, but home assistant offers automatic device configuration using discovery broadcast topics. Right now I'm faking it by broadcasting them FROM home assistant with the requisite details.

It might be too home assistant specific to be worth implementing, but it would make it a lot easier to use with other tools.

@tkurki
Copy link
Owner

tkurki commented Jul 20, 2024

Can you provide more details? Certainly doable i would think.

@tkurki
Copy link
Owner

tkurki commented Jul 20, 2024

See also SignalK/signalk-server#1374 (comment)

@GraffJosh
Copy link
Author

Yeah, this might be a rework of the Homeassistant plugin, though I haven't had success with it just yet. The idea is that HA is looking for a JSON string that describes the device. In the case of SK, this would probably define the 'vessel' (and all subtopics) as the device, and the subtopics as sensors on that device:

Some information here:
https://www.home-assistant.io/integrations/sensor.mqtt/#:~:text=Or%20set%20up%20via%20MQTT%20discovery

Some more information on the 'device' concept on this forum: https://community.home-assistant.io/t/creating-a-device-with-multiple-sensor-entities-via-mqtt-discovery/584372/4?

It looks like each sensor gets a mqtt discovery JSON pub, and the device tag in that JSON package links them together.

@GraffJosh
Copy link
Author

Per your comment, I have HA reading the sensors quite well, configured individually in the HA yaml config, but they aren't capable of being device-grouped in that method, and all units and metadata have to be configured manually.

I haven't yet sent data from HA to SK, but from what I've seen that might be straightforward, I'll try it in a few weeks.

@tkurki
Copy link
Owner

tkurki commented Jul 28, 2024

This is certainly doable, but probably nontrivial. It would be great if somebody who uses SK and HA both actively would pick this up so that real world testing is included in the development loop.

I can provide generic assistance.

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

2 participants