MQTT device_tracker Discovery Config JSON format -- extra attributes not detected

Hi All,

I’m trying to propagate iPhone Home Assistant Mobile device trackers from an HA instance running at our main house to a second HA instance running at a vacation condo over MQTT. I’m able to get the device tracker to show up, but not any of the extra attributes like longitude and latitude.

I have MQTT broker running via Mosquito add-on on my main home HA instance with MQTT Statestream configured to publish device_tracker state changes to MQTT:

mqtt_statestream:
  base_topic: "ha/boulder"
  publish_attributes: true
  publish_timestamps: true
  include:
    domains:
      - device_tracker
    entities:
      - light.mf_rr_ls

The expected messages are showing up on MQTT:
Screenshot from 2021-06-26 15-09-14

I currently have a custom blueprint which will publish the config messages resulting in the config message above. Full contents of the config being published:
Screenshot from 2021-06-26 15-13-46

On the vacation condo I have MQTT configured to connect to the MQTT broker running on the home HA instance.

mqtt:
  discovery: true
  discovery_prefix: "ha/boulder"

The vacation condo is picking up the device trackers, but none of the extra attributes like latitude and longitude:

I suspect that there is an issue with my published config and MQTT Discovery not picking up the extra attributes, but can’t figure out the right way from post topic posts and the documentation.

What am I missing?

Thanks!
-Alan

json_attributes_topic should be a topic containing a json dictionary string like

{
  "attr1": "value1",
  "attr2": "value2"
}

see MQTT Sensor - Home Assistant (home-assistant.io)

StateStream publishes each attribute is its own topic, which is incompatible with discovery.
I know, pretty dumb that HA doesn’t provide anything to read statestream, nor to write discovery.

Thanks for the info @koying. I guess those APIs are intended for interfacing with other platforms instead of other Home Assistant instances. Guess I may need to think about an automation to catch StateStream messages and repost them for consumption by other HA instances. Thanks!

I actually created a blueprint a while ago to “integrate” statestream in a discovery setup:

I updated it to include attributes.

Where is device_tracker domain?
How to transfer device_tracker to another Home Assistant?