There are example Things for that device further down in the readme.
See the Beginner’s Tutorial, the Items page and the Rules page in the docs for how to link a Thing’s channel to an Item and hot to use the Items in Rules.
@rlkoshak, thanks but isn’t that for the standard one? I do already have one normal Xiaomi OUT working with that things and items code, but the ones I have now are the ones with LUX light sensor built in (Aqara). I can’t see how the LUX should be determined in any of those items?
Thanks - I will go ahead and update to the latest snapshot then.
Do you have a rule that triggers some sort of light when the Motion is detected and the LUX = XX ?
did your new sensors get discovered? I upgraded to 2.2 Snapshot, but they aren’t showing in my things.
Also i have configured them in my xiaomi.things:
Thing mihome:sensor_motion_aq2:158d00016dac36 "Badezimmer - Body Sensor" [itemId="158d00016dac36"]
and corresponding items:
Switch Badezimmer_MotionStatus <motion> { channel="mihome:sensor_motion_aq2:158d00016dac36:motion" }
and so on.
But neither do they show in paperui or in one of the log files.
I’m on OH 2.1 and I need to manually install the Aqara motion sensors, I get the needed id’s from me xiaomi app, from the gateway -> bruger icon- > about -> gateway information
I use the Motion sensors, both original and auqa for light control at the moment, I made an switch item for each room and a rule that activates the motion sensor is triggered. The Item is only on for 10 min, which is a bit too short I think, by using the expire binding.
If it is dark and the “room item” is on then I will turn on the light. I also use the motion sensors for checking if somebody is home. If not I switch off most of the power (with xiaomi plugs) and turn down the temperature.
I can post some of the rules if you like.
Sounds really nice! What you mention is a lot of what I want to achieve. Currently my Motion Sensors register when I enter a room and the LUX is met. But in my case it turns off after I think 1 minute which might be the standard value where the motion sensor goes to sleep to save battery (not sure on this though). I was wondering if a sleep function would suite me if I wanted to postpone the lights from going off, but maybe I could get some clues from your rule.
Please post or PM. me some of yours, that would be much appreciated.
rule "HomeActivity turn - away off"
when
Item HomeActivity changed
then
logInfo("rules", "HomeActivity changed")
if (HomeActivity.state == ON) //ingen hjemme
{
AwaySwitch.sendCommand(OFF)
}
if (HomeActivity.state == OFF) //ingen hjemme
{
if (SwGoodNight.state == OFF) //If not sleeping then assum nobody is home
{
AwaySwitch.sendCommand(ON)
}
}
end
rule "Turn on Motion_Sensor_Stue_Status if dark "
when
Item Motion_Sensor_Stue_Status received update ON
then
StueLightActivity.sendCommand(ON)
end
rule "Turn on Motion_Sensor_Kitchen_Status if dark "
when
Item Motion_Sensor_Kitchen_Status received update ON
then
KitchenLightActivity.sendCommand(ON)
end
rule "Turn on Motion_Sensor_Gang_Status if dark "
when
Item Motion_Sensor_Gang_Status received update ON
then
GangLightActivity.sendCommand(ON)
end
rule "Turn on Motion_Sensor_Sove_Status if dark "
when
Item Motion_Sensor_Sove_Status received update ON
then
SoveLightActivity.sendCommand(ON)
end
// Light controllers----------------
rule "Turn on Light in Stue if dark "
when
Item StueLightActivity received update
then
if(StueLightActivity.state == ON && IsDark_SW.state == ON && SwGoodNight.state != ON)
{
Color_Stue_LED.sendCommand(ON)
Color_Kaempe.sendCommand(ON)
}
if(StueLightActivity.state == OFF && IsDark_SW.state == ON)
{
Color_Stue_LED.sendCommand(OFF)
Color_Kaempe.sendCommand(OFF)
}
end
rule "Turn on Light in Kitchen if dark "
when
Item KitchenLightActivity received update
then
if(KitchenLightActivity.state == ON && IsDark_SW.state == ON && SwGoodNight.state != ON)
{
Color_Kokken.sendCommand(ON)
}
if(KitchenLightActivity.state == OFF && IsDark_SW.state == ON)
{
Color_Kokken.sendCommand(OFF)
}
end
rule "Turn on Light in Gang if dark "
when
Item GangLightActivity received update
then
if(GangLightActivity.state == ON && IsDark_SW.state == ON && SwGoodNight.state != ON)
{
Color_Gang_LED.sendCommand(ON)
}
if(GangLightActivity.state == OFF && IsDark_SW.state == ON)
{
Color_Gang_LED.sendCommand(OFF)
}
end
rule "Turn on Light in Gang if dark "
when
Item SoveLightActivity received update
then
if(SoveLightActivity.state == ON && IsDark_SW.state == ON && SwGoodNight.state != ON)
{
Color_Loft.sendCommand(ON)
Color_MiHome.sendCommand(ON)
}
if(SoveLightActivity.state == OFF && IsDark_SW.state == ON)
{
Color_Loft.sendCommand(OFF)
Color_MiHome.sendCommand(OFF)
}
end
Hi,
I install nightly bindings (unziping .kar file and copy org.openhab.binding.mihome-2.2.0-SNAPSHOT.jar in /usr/share/openhab2/addons folder) but I can’t see illumination channel.
Can you help me ? I don’t want to switch all my openhab installation to 2.2 (too buggy for me).