Skip to content

Allow re-using program output in multiple devices #57

@W-Floyd

Description

@W-Floyd

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions