Populate MQTT Device Attributes from State

I can think of a hack to build a HASS Discovery block of JSON from the version sensor, then publish to MQTT from HASS, which then injests the auto-discovery config and configures the main Tesla entity replacing the local YAML config.

Here’s a mosquitto_pub example to get you started hacking together a proof of concept:

HASS changes immediately on receiving the publish.

Another example:

I’ve published data to MQTT from HASS automations but not discovery - should work as all are just MQTT payloads.

Don’t know if a more Python-esque API-based solution exists though.

If this helps, :heart: this post!

1 Like