Xiaomi sensors over GW in connection with Z-Wave

Hi there,

I started with hassio and I like it in general.
The integration of the Xiaomi Gateway (v3 I guess) worked.

I got some sensors here which I would like to use together with Z-Wave components and in general I would like to get an idea, how to set up automated progresses.
For e.g.: lm <200, motion detected -> do this or that.
Or I have a door sensor on the garage door and if there is a timeframe reached while it is opened without any movement inside, then the Z-Wave component should be activated to close the door.
I hope you got a picture of what I am trying to achieve and give me a hint or two.:wink:

Thank you very much in advance.

What you are looking for are automations.

Check out the docs here:

Thank you for your answer, but the automating part is a bit short documented.
I thought so, that this might be the way.

I have read that it could be possible to set up these sensors that way that they just tell the base that there was activity or something in a specific time frame. But what are the states (possible) of these sensors?
In my opinion this is hard to imagine - this does not even work with Xiaomi it self. - How would I deactivate the usual reporting to the gateway then?

Is there a way to set it up as in Smart Things or Ziparo?
What would be the benefit of using MQTT? Would it be possible to use it?

There are examples here:

https://www.home-assistant.io/docs/automation/examples/

And also explanation about the Automation Editor, which should make automations easy with a GUI.

I don’t know what you mean with this? which base are you talking about?

Did you read the part “Exploring the internal state” in the first link I provided? There it explains how you can see the state of the sensor.

Why would you want to deactivate the reporting to the gateway? If you deactivate the reporting to the gateway, then home assistant will also not see the state of the sensors.

Can you maybe give an example of an automation that you want to do and provide the name of the sensors you have in home assistant which would be included in this automation?

Quoting does nor work for me, sorry.

1:
I mean the Gateway - sorry for the confusion.

2:
Yes, I tried that before your post, but that for I would have to know what the values and the format of different sensors would be, what the payload in the speficic case would be and these things.

3:
I read that but this is very generic and for a person who is new into this it is not that self-explanatory as you might think.

4:
that was just an idea because I saw an example and I thought in a scenario in our hall where a motion sensor would be to light up the a dimmed light at night it would be usefull. Otherwise if we walk across it all the day the battery drain would be too high for nothing usefull.

I have found Node-Red which as I thought a solution could look like. But I did not found out how to link different sensors together.

But back to the initial example:
It would be an FGS-212 and a Xiaomi Motion Sensor (light sensor included).

Just mark the text you want to quote and then a small text “Quote” will appear. Click on it and done.

Once again, did you read the part “exploring the internal state”? If you go to Developer Tools → States
you will see all your sensors, their name and their current state.

I wouldn’t suggest starting with Node-Red before you understand the basic principles of how home assistant works.

So you added these two already to home assistant? What are the entity names for these devices? For the FGS it should be something like switch.blablalba and for the Xiaomi it should be something like binary_sensor.blablabal

In your example the automation is structured like this:
Trigger: motion detected (motion sensor has state “on”)
Condition: lumen < 200 (light sensor has state < 200 lumen)
Action: turn on light (turn on FGS-212)

Try to do it like this with the automation editor.

1 Like

Ah, I see. Thank you for that hint. :wink:

That’s what I said. But the workflow is not clear to me.
I have known before that there are stats under the development tools.

But how should this help?
grafik

Yeah that hint is also welcome but I am not very sure about the workflow which is intended for this usually. If there even is one because every use case is very individual.

Yeah at least the GW, zigbee senors and a homematic keylock and such things.
The strange part is that the sensor is advertised as having a sensor but just the GW seems to have one.

That was one of the reasons why I was asking.
Does that mean I don’t have the chance to communicate with that sensor?
Or may do I have a chance to force some commands or stats to be asked from HA to these sensors?

The FGS-212 is planned for the upcomming week.

How many and which sensors are connected to the Xiaomi Gateway?
If you go to Developer Tools → States and scroll down there, are there a lot of entities? Can you see some binary_sensors (motion sensors are generally set up as binary sensors )?

The different possible states of an entity depend on what kind of entitiy it is. E.g. binary sensors can either be “on” or “off”. If you are on the states page you will see the current state of all the entities there, so you can test what the state will be when you walk in front of the motion sensor and check again on this page.

Sensors:
3x Xiaomi Mi Motion Sensors
1x Aqara (?) Door Sensor (two addional ones are not connected yet)
Others should have been following.

This are all of the motion sensors:

I made a mistake:
I wrote

What i meant was a sensor for luminance was advertised.
Main question would be if it Aqara version of the motion sensor would have that luminance sensor built-in.

Thank you for your help but i guess there is nothing more left what can be done. :frowning:

Do you have sensors called something like sensor.illumination.... in the states page?

Yes, I do. But the ID is very the same as the one from the gateway.
Means: just the gateway has a sensor for the illumination. The sensors do not.

I am on my mobile, but I guess these would be the right ones:

These are the Aqara ones. - Misleading advertising from the vendor. A bit too late now.
Thank you for help.

Do you see multiple of these sensor.illumination… or only one? The topic you posted talks mainly about the very low reporting frequency and of the sensor not being really good at detecting luminance. So even if you have them, I don’t think they will be good for automations

That was of reasons I was asking - it is just the one associated to that GW it self. Not the motion sensors.
I think I am fine with the fact having been tricked a bit.
You might be right but in general it seems to work not bad at all.

I will have to take a look at these automations anyway and for any use case where the luminance could be important I might think about another solution like another sensor or adjusting the rules to make it more suitable. Thank you, once more.