MQTT Device_Tracker Entity Registration Issue

Hello everyone, I’m having an issue with a device_tracker entity that I’ve configured with MQTT. Here’s the configuration:

mqtt:
  - device_tracker:
      name: "- Location"
      object_id: "simone_smartphone"
      unique_id: "simone_smartphone"
      icon: "mdi:cellphone"
      device:
        identifiers: "fasffhgasfha"
        manufacturer: "Samsung"
        model: "SM-S918B/DS"
        name: "Simone's Smartphone"
        sw_version: "Android 14"
      state_topic: "homeassistant/device_tracker/update"
      value_template: "{{ value_json.state }}"
      json_attributes_topic: "homeassistant/device_tracker/update"
      json_attributes_template: "{{ value_json.attributes | tojson }}"
      source_type: "gps"
      payload_available: "online"
      payload_not_available: "offline"
      payload_home: "home"
      payload_not_home: "not_home"

I send an HTTP request with Tasker with a different payload text based on the connected Wi-Fi. For example, when connected to the home Wi-Fi, the following payload is sent:

{"state":"home","attributes":{"source_type":"GPS","latitude":40.1232731,"longitude":14.1257423,"gps_accuracy":5,"altitude":50,"speed":0.0}}

and the entity is correctly registered as “Home.”

When not connected to Wi-Fi, the following payload is sent:

{"state":"not_home","attributes":{"source_type":"GPS","latitude":"unavailable","longitude":"unavailable","gps_accuracy":"unavailable"}}

and the entity is correctly registered as “Away.”

I’ve also created a zone called “Work.” When connected to the work Wi-Fi, the following payload is sent:

{"state":"Work","attributes":{"source_type":"GPS","latitude":43.1232731,"longitude":17.1257423,"gps_accuracy":5,"altitude":100,"speed":0.0}}

The entity is registered as unknown, and it doesn’t work. I’ve tested sending the payload with only the state value of the “Work” entity (without attributes), and it’s correctly registered as “Work.”

I hope that a Home Assistant expert can help me troubleshoot this issue.