MQTT Device Tracker issues

I’m having troubles with the MQTT Device Tracker implementation in HA.
Resources used: MQTT Device Tracker - Home Assistant (home-assistant.io)

I’m creating a script that will download the Airtag data from an iPhone and would like to publish it so I can put in in HA (once done I’ll publish it here: Apple AirTag - Share your Projects! - Home Assistant Community (home-assistant.io))

I’ve followed the example found in the resource and the commands below work:

Config

mosquitto_pub -h mqttbroker -u username -P password -t homeassistant/device_tracker/findmy_$serialnumber/config -m ‘{“state_topic”: "homeassistant/device_tracker/findmy_’$serialnumber’/state", “name”: “FindMy ‘$serialnumber’”, “payload_home”: “home”, “payload_not_home”: “not_home”, “json_attributes_topic”: “homeassistant/device_tracker/findmy_‘$serialnumber’/attributes”}’

State

mosquitto_pub -h mqttbroker -u username -P password -t homeassistant/device_tracker/findmy_$serialnumber/state -m ‘’“$addressmapItemFullAddress”‘’

Attributes

mosquitto_pub -h mqttbroker -u username -P password -t homeassistant/device_tracker/findmy_$serialnumber/attributes -m ‘{“latitude”: ‘$locationlatitude’, “longitude”: ‘$locationlongitude’, “altitude”: ‘$locationaltitude’, “vertical accuracy”: ‘$locationverticalaccuracy’,“horizontal accuracy”: ‘$locationhorizontalaccuracy’, “battery_level”: ‘$batterystatus’, “antenna_power”: ‘$antennapower’}’

The resource says I can create a unique_id, but when I enter this into either the “config”, “state”, “attribute” ("unique_id": '$serialnumber', ) the device disappears.
Another issue is that there isn’t a History (“No state history found.”) or Logbook (“No logbook events found.”) when I open up the entity; when I leave the enity open for a while then there is some history being shown but when I close it, it is gone.

Also when I enter the device (manufacturer, model, sw version, etc.) info the entire entity is gone.

EDIT: The no history and logbook was resolved by restarting HA twice, for some reason my MariaDB had issues and that was resolved by rebooting twice.

type or paste code here