I have some questions on Xiaomi devices and OpenHab, I asked them in the big Xiaomi topic but did not get any answer, I fear it might have gone un-noticed, so I reask here.
Motion sensors from Xiaomi have the ability to report illumination or brightness, and I don’t see this info being reported in the available channels for motion sensors? I don’t see it either in the doc for Xiaomi Binding… Is there a reason for this?
Same for smoke detectors, I don’t see the channel for battery level and low battery appearing? Do I have a problem with my setup? And I don’t see either the “smoke density” and “ability to see in the smoke” info that are popping up in other plateforms for the same device…
What would be the right way for me to monitor the “reachability” or “aliveness” of a device? I just noticed that one of the Water leak sensors I have is out of reach and so basically is not connected to OH, and nothing mentioned it (it appears nicely “online” in the things list)…
Several channels seem to be mapped to a Switch type of item while I think they are more a read only info (e.g. LowBattery). Is this intentional or a mistake?
Hi @Simsal, thanks for sharing the info. I am on 2.2.0 snapshot binding, and the illumination thing did not show up in the UI:frowning:
I have added one extra item by means of text definition (on top of the other items for the other channels which I kept defined with Paper UI) and so far, nothing popped up in this channel.
I have understood the cause of my problem for the motion sensor : I first used the older version of the binding to discover my sensors and I missed the “_aq2” part… I noticed I had one item in the inbox that was waiting for my inclusion and now I understand what that was : version aq2 was popping up while I had version 1 declared, it seems… I have deleted the first one, and then created again clean first as a thing in PaperUI and then I declared the items in text file.
For the smoke sensor, I have added the items definition in my text file and we’ll see if that changes something.
I think I have other issues like this for other sensors, and I really need to find a way to move from PaperUI to text files while keeping names as much as possible…
what is the difference betwen “alarm” and “status” for the smoke detector?
also, what am I supposed to be able to do with stuff like “MotionOffTimer”? Am I supposed to be able to set it from opehab or is it a read only info that appears only when different from default?
The MotionOffTimer is a value you can define, when the motion sensor sends his MotionDetected = false;
I think the standard behaviour ist that it recognizes a movement ->MotionDetected =true then it goes to sleep for 60 seconds and waits another 60 seconds if concurrent motion occurs. These second 60 seconds can be increased or decreased with the MotionOffTimer value.
Thanks @Simsal for the answer on MotionOffTimer. This is what I had understood, but I can’t get basic UI to show me an interface to set this timer… How should I do this? What is the way I have to configure the item and the sitemap to be able to set this value and send it to the device?
rule "Xiaomi default values"
when
System started
then
sendCommand(Xiaomi_Gateway_Sound, 10000) // set sound to stop
sendCommand(Xiaomi_Gateway_SoundVolume, 0) // set volume to zero / off
sendCommand(Xiaomi_MotionSensor_MotionOffTimer,120)
sendCommand(Xiaomi_MotionSensorAqara_MotionOffTimer,120)
sendCommand(Xiaomi_Magnet_garage_AlarmTimer,7200)
end
Regarding the smoke sensor: alarm is set to ON when smoke is detected. So I use this item in my rules to notify myself when something is wrong. status … I actually don’t know It says unknown in my config. I was not able to receive another output yet.
Ahhh! Got it! Thanks a lot! Very clear. Yes, for me as well, alarm is set to ON when there is smoke detected, and status is set to unknown…
I looked a bit for the “status” of the smoke detector and I see that other platforms have a concept of “optical sensor visibility” in % in addition to the smoke density, not sure if this helps… I’ll keep checking this just in case I could find the explanation of what this is about.
when Channel "mihome:sensor_magnet:<ID>:isOpenAlarm" triggered ALARM
I’m not too sure if my problem is that I’m not able to connect the isOpenAlarm channel properly to an Item or if it is not supposed to be ever connected to an Item and it should be a channel and be handled as such???
A bit lost, at this stage
where do you find isOpenAlarm (I see that this is used in the rules examples, but this seems to be incorrect)? There are 5 channels for the door sensors:
isOpen: reports OPEN or CLOSED
lastOpened: reports date/time when magnet was last opened
isOpenAlarmTimer: can’t remember exactly how or why this is used…
batteryLevel: battery level in %
lowBattery: switches to ON when batteryLevel is 10% or less
@wars, good question:-) I’m almost sure that it got created by openHab when I was declaring the things and items via paperUI.
But also, i think that this isOpenAlarm is the logical complement of the isOpenAlarmTimer and my tests showed it works as follows: set isOpenAlarmTimer to 120 seconds, then open the door, isOpen goes to ON and then if you don’t close the door for the next 120 seconds, an alarm is raised as I described.
The intent looks clear to me, what is less clear is how openHab manages it:slight_smile:
If you can test it on your side, we’d know if I’m dreaming or if there is something missing…
I saw in the binding code on github some explanations regarding the status: ALARM_STATUS_MAP.put(0, "OK"); ALARM_STATUS_MAP.put(1, "Fire alarm"); ALARM_STATUS_MAP.put(2, "Analog alarm"); ALARM_STATUS_MAP.put(8, "Battery fault alarm"); ALARM_STATUS_MAP.put(64, "Sensitivity fault alarm"); ALARM_STATUS_MAP.put(32768, "I2C communication failure");
It seems that the smoke sensors is not returning one of the numbers above…
same with mine. The Status never gets updated, as I see it.
Another Thing is “density” The smoke sensor sometimes Returns density with “1”, most times it’s “0”. is there a known Scala or what does density stand for?
I’ve just added a few Aqara motion sensors v2 to my Openhab setup and I find the illumination values to be outdated. I am still not quite sure what is going on under the hood, but I have an impression that the illumination value is only updated in case of motion is detected.
I’ve done the following test:
entering the room, lights go on, luminosity is updated to some high value
leaving the room, the lights go off and the luminosity is expected around zero (since it is night and no lights)
monitoring the luminosity value and seeing its not getting any changes for a couple of minutes.
entering the room again and seeing the luminosity gets updated.
I wonder if anyone else is experiencing similar behaviour?
legend: I use the Motion sensor in a remote place and I can’t see a difference between people in the room and moving (friday night till sunday noon) and an empty cottage. (despite the obvious use of lights in the after hours)…
obviously the weekend was very sunny - monday was cloudy…
But what I experience: the updates the Aqara-sensors do aren’t quite regularly like every 10mins or so, they seem do depent on other influences - so best would be to wait like an hour or so, usually they come at least evey 20mins…
after quite some more time and stumbling over this old thread: I experience more varianzes for the smoke sensor… usually the sensor tells something between 1 and 4, sometimes 8. Except, if you’re cooking bacon - then the firealarm triggers obviously like Saturday evening: