Get Xiaomi Sensor Readings

Hi,
So I’ve moved across from OpenHab. I haven’t started looking at the GUI yet as I think that will be massive, and probably the area the Home Asssistant isn’t as strong in. Got most things up and running however I am not really sure how I get the readings for my sensors? There doesnt seem to be anywhere that I can “tag” my devices, as they have auto discovered once I added the Gateways. I need a function similar to OpenHab where I can ask Google Home (I’ve got that working) whether a sensor is active or a door is open but at the moment the devices dont show in my Home, only the lights.

I think it will be something basic I am missing, but really can’t work it out.

Scott

Hi Scott,

What Xiaomi sensors do you have. What protocol do they use?

greetz,

Rudolf

I used openHAB for several months so I can shed some light on a few of your concerns.

Unlike openHAB, where you are obliged to create a UI in order to have a UI, Home Assistant will automatically create one for you (the Lovelace UI). Initially, it may not be attractive (everything on one page) but it will be functional. Afterwards, at your leisure, you can modify it to suit your preferences. You have the option of modifying it two different ways:

  • The default way is to modify it directly within the UI, like HABpanel.
  • The optional way is to modify it as a text file, like Basic UI.

To be clear, that’s two different ways to modify the same Lovelace UI (unlike Basic UI and HABpanel which are completely independent and separate UI’s). Be advised that if you choose to modify the Lovelace UI as a text file, you give up the ability to modify it via the UI (there’s an awkward workaround but let’s leave that out for now).

Got most things up and running however I am not really sure how I get the readings for my sensors?

All entities (a similar but not equivalent term to openHAB’s Items) that are automatically discovered by Home Assistant or manually defined by you (configuration.yaml) will appear in the States page (list format) and in the Lovelace UI.

What kind of sensors are you using?

There doesnt seem to be anywhere that I can “tag” my devices, as they have auto discovered once I added the Gateways. I need a function similar to OpenHab where I can ask Google Home (I’ve got that working) whether a sensor is active or a door is open

Unlike openHAB, you don’t “tag” each entity individually to make it accessible to Google Assistant or Amazon Alexa. You define which entities (or entire domains) are included, or excluded, from being controlled by Google Assistant. The documentation for Google Assistant contains an example.

but at the moment the devices dont show in my Home, only the lights.

The implication here is that Home Assistant automatically discovered your lights but nothing else. Therefore the other devices will probably need to be manually defined. What are these other devices?

Thank you @123 for your really details response - and also for yours Rudolf.

I think Home Assistant is amazing - it’s just a massive learning curve when you spend a log time learning OpenHab and they operate in different ways.

What I want to be able to do, for example, is as Google if any of the doors are open, and it tell me. In OpenHAB I could tag each Door Sensor as a switch, and if I asked if the Living Room door was open, it could tell me. I also had a ‘dummy’ item called all doors, and a rule that if one door sensor was open, it would turn on, so I could ask if “All Doors” was closed, and it would give me the status of the dummy item. I’m hoping I can do similar in HA.

Does that make sense?

Scott

You can but, like I said, you don’t have to tag each entity (Item) individually like in openHAB.

Entities are already compatible with Google Assistant, you just need to specify what will be accessible to it. You may want every entity, group, automation, etc accessible to the Assistant or just a few. You control that in the configuration and can optionally rename the entity for use with the Assistant. Here’s an example from the documentation:

google_assistant:
  project_id: YOUR_PROJECT_ID
  api_key: YOUR_API_KEY
  exposed_domains:
    - switch
    - light
  entity_config:
    switch.kitchen:
      name: CUSTOM_NAME_FOR_GOOGLE_ASSISTANT
      aliases:
        - BRIGHT_LIGHTS
        - ENTRY_LIGHTS
    light.living_room:
      expose: false
      room: LIVING_ROOM
    group.all_automations:
      expose: false

Here’s another one.

I now see, from the thread’s title, that you are using Xiaomi sensors. Are you using the Xiaomi gateway, a zigbee coordinator, or zigbee2mqtt, to communicate with the sensors?