Entity_category MQTT diagnostic and config

How do I config a sensor to show as an diagnostic in home assistant?

  "entity_category": "diagnostic",
  "expire_after": "180",
  "name": "IP",
  "state_topic": "homeassistant/sensor/lavan/ip/state",
  "unique_id": "s6l",
  "device": {
    "identifiers": [
    "name": "Lavanderia"

I tried entity_category but it still shows the entity as a sensor:

Code to auto config (arduino):

    ConexaoMQTT.publish("homeassistant/sensor/lavan/ip/config","{\"entity_category\": \"diagnostic\",\"expire_after\": \"180\",\"name\": \"IP\",\"state_topic\": \"homeassistant/sensor/lavan/ip/state\",\"unique_id\": \"s6l\",\"device\": {\"identifiers\": [\"1la\"],\"name\": \"Lavanderia\"}}", true);

I was expecting the IP to be shown like this (sorry for 2 posts in a row, I’m a new user):

If I look at an existing diagnostic sensor, it is “entity_category”:“diagnostic”

      "model":"TRADFRI control outlet (E1603/E1702/E1708)",
   "name":"Last seen",
   "value_template":"{{ value_json.last_seen }}"

Thanks I deleted the retained config message and reset the device, now it works as I wanted it to.
@francisp for the configuration values how do I add the slide/button?