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

Allow re-using program output in multiple devices #57

Open
W-Floyd opened this issue Mar 6, 2023 · 0 comments
Open

Allow re-using program output in multiple devices #57

W-Floyd opened this issue Mar 6, 2023 · 0 comments

Comments

@W-Floyd
Copy link
Owner

W-Floyd commented Mar 6, 2023

I think it should be possible to do hack our way into this pretty easily at the moment, but it would require some fiddling with topics and such. Instead, I propose that I change to a model of commands generating a single topic output, which we can then reference easily per-device. For example, nvidia-smi has a ton of great data, but we currently have to probe it multiple times. Why not re-use this output? For example, we could create a topic of /ha-mqtt-iot/<deivce>/state/gpu/0 which will carry a full JSON output of what we want, and then use value_template on many entities to derive all the sensors we want. Probe once, post once, just tell HomeAssistant where to look.

In cases where we don't have more than one entity as a result of a command, we can still use the same format - keep it simple. Topic generation needs to be automatic.

A first thought at this is to name a command in one place, and reference it per entity - so each place we currently allow providing a function would now be a reference.

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