Could someone PLEASE tell me why my sensor is not showing in HomeKit?

Hi all,

So I had my Home Assistant setup finished and perfect. I was a happy person… until my SD card died!

So I’ve been trying to recover my setup. I cannot for the life of me work out how I got my Mi Flora sensor to show in HomeKit before the crash.

I have seen that you need to change the “device_class” by selecting the “cog” in the states tab of developer tools, but the cog is not there for this sensor. I’m not sure how to create a custom sensor that draws information from this device and I’m unsure how to manually set the device_class in a yam file (I saw something about a customisation.yaml but I do not have it). When I try to add “device_class”: “humidity” in the developer tools > states page I get the below error.

It is driving me mad because i had this working before the SD card died so If anyone could look at this and tell me how to get the sensor to show in homekit, even if this involves creating a new sensor that draws information from the device, I would be forever grateful;

      - automation.start_homekit
      - sensor.illumination_7811dcb7d9e9
      - input_boolean.xiaomi_vacuum_cleaner
  - platform: miflora
    mac: 'XX:superduperprivateithink:xx'
    name: Herbs
    force_update: true
    median: 3
      - moisture

Thank you all 18%20pm

you need


after “device_class”: “illuminance”


"device_class": "illuminance",

but for that example, you need "device_class":"humidity," as described in HomeKit Bridge - Home Assistant

1 Like

Wow. THANK YOU @n1k5y

Like this? (i meant to put it as “humidity” in the demo, not the other)

Will this save if I do a sudo reboot?

Thank you.


This is just for current state. You can do that in customization in UI or in config.

1 Like

Thanks mate. I appreciate the help. I wonder how the hell I did it without knowing how to do that before the SD card died. I wish I understood how to make a template sensor to draw on the input from the device.

1 Like

Thanks for the link, it mentions clicking on this “cog” that isn’t available on this entity so looking at manual, does this look like it would work in my configuration.yaml?

    # Add an entry for each entity that you want to overwrite.
      unit_of_measurement": "%",
      "friendly_name": "Herbs Moisture",
      "icon": "mdi:water-percent",
      "device_class": "humidity"
1 Like

This is YAML and here you don’t need “” or ‘’ and ,

    # Add an entry for each entity that you want to overwrite.
      unit_of_measurement: "%"
      friendly_name: Herbs Moisture
      icon: mdi:water-percent
      device_class: humidity
1 Like

Thanks mate!

That worked a damn treat. I encountered this error;

2019-08-02 23:56:41 ERROR (MainThread) [homeassistant.setup] Setup failed for customize: Integration not found.

Until I indented it under the “homeassistant:” block. Then it worked!

Actually, my configuration.yaml didn’t even have a “home assistant:” block, which is a worry.

Here’s how I implemented your solution and now it appears in homekit. Thank you so much for your help.

      unit_of_measurement: "%"
      friendly_name: Herbs Moisture
      device_class: humidity
1 Like