Xiaomi Mijia BT temperature and humidity sensor

Hi There,
A Home Assistant noob here (lovelace UI) with a question.
I have a Xiaomi Mijia BT temperature and humidity sensor sucessfully configured in my configuration.yaml file as follows:

sensor:

  • platform: mitemp_bt
    mac: ‘4C:XX:XX:XX:XX:XX’
    name: Attic_Room
    force_update: false
    median: 1
    monitored_conditions:
    • temperature
    • humidity
    • battery

I can see the Temperature, humidity & battery level reported on my hassio overview screen.

If possible, I want to graph the temperature values using the History Graph Card
example from the documentation for the History Graph Card is as follows:

type: history-graph
title: ‘My Graph’
entities:

  • sensor.outside_temperature
  • entity: media_player.lounge_room
    name: Main player

For my sensor how do I reference the temperature data to use in the history Graph? What value should I enter for the sensor and entity entries in the History Graph config?

Thanks in advance! :slightly_smiling_face:

If you click the three lines on the upper left of your home assistant UI, it will bring up a side-bar menu on the left.

Look down at the bottom under ‘Developer Tools’, and click the <>.

That will bring up a list of all the components and the Mi Temp will be listed there, as something like sensor.

You’ll probably be using that section a lot, everyone does :slight_smile:

With the mitemp_bt platform there will be multiple sensors created, based on the name and monitored condition (like sensor.name_temperature, sensor.name_humidity). Since you have the name as Attic_Room, the temperature sensor would be sensor.attic_room_temperature (the entity ids need to be lowercase) so the following should work:

type: history-graph
title: My Graph
entities:
  - entity:sensor.attic_room_temperature
    name: Attic Room Temperature
1 Like

Hi Bit-River,

Many thank,s this is exactly what I was looking for! I was trying attic.room.temperature but I see that the _ is used which I didn’t try!
As you say I’ll be using <> page a lot I think :slight_smile: Thanks again

1 Like

Hi Steven,
Thanks, that’s working for me now, great to be up and running :+1:

If anyone else is having trouble getting the MAC address of the BLE sensor (I was initially) I couldn’t get it directly from my android phone (Andriod 9) but I used an app called BLE Scanner which did the trick.

Thanks again.

Thank you so much… its work for me now