MQTT Sensor Connectivity not showing up

I have defined several sensors on MQTT (temperature and humidity) they show up and work well under devices section in HA. Now I just added a ‘Connectivity’ sensor, but it doesn’t show under HA. If I change the device class to something else, then the device will show, hence I think I need something more for the connectivity sensor.

{
  "dev_cla":"connectivity", 
  "name":"rho2_status", 
  "uniq_id":"rho2_status", 
  "dev":{"ids":"rho2","name":"rho2","mdl":"PLATFORMIO_D1_MINI","mf":"espressif"}, 
  "avty_t":"homeassistant/availability/rho2", 
  "~":"homeassistant/sensor/connectivity/rho2", 
  "stat_t":"~/out", 
  "val_tpl":"{{value_json.value}}"
}

What I’m missing so that the connectivity sensor show up on devices ??

Are you publishing this to define an MQTT Binary Sensor? In other words, does the discovery topic look something like this:

homeassistant/binary_sensor/your_sensor/config

The connectivity device_class is exclusively for binary_sensors. In contrast, temperature and humidity are device_classes for sensors.

1 Like

That was exactly the trouble!
Thanks a lot!

1 Like

You’re welcome!

Please mark my post with the Solution tag to indicate to other users (who may have a similar problem) that this topic has an accepted solution. It will automatically place a check-mark next to the topic’s title.