Mi(Xiaomi) Smart home bindings?


(Josep Xavier Sellart I Gine) #873

You must activate the developer mode and in Hub Info, you must exit all the sensors with your ID.
I look to get you a capture


(Patrik) #874

Thanks man! I Found the ID!


(Josep Xavier Sellart I Gine) #875

sorry for the delay, I was making the catches, but I see that they are no longer necessary


(Pakcikjack) #876

i change the code to this structure and it worked,

rule “Mijia & Aqara Wireless Switch”
when
Channel “mihome:sensor_switch:158d0001f3ad02:button” triggered SHORT_PRESSED
then
if (Gateway_LightSwitch.state == OFF) Gateway_LightSwitch.sendCommand(ON)
else Gateway_LightSwitch.sendCommand(OFF)
end

rule “Mijia & Aqara Wireless Switch2”
when
Channel “mihome:sensor_switch:158d0001f3ad02:button” triggered DOUBLE_PRESSED
then
if (MomsBedroom_light.state == OFF) MomsBedroom_light.sendCommand(ON)
else MomsBedroom_light.sendCommand(OFF)
end

rule “Mijia & Aqara Wireless Switch3”
when
Channel “mihome:sensor_switch:158d0001f3ad02:button” triggered LONG_PRESSED
then
if (Amanbedroom_Power.state == OFF) Amanbedroom_Power.sendCommand(ON)
else Amanbedroom_Power.sendCommand(OFF)
end

rule “Mijia & Aqara Wireless Switch4”
when
Channel “mihome:sensor_switch:158d0001f3ad02:button” triggered LONG_RELEASED
then
sendCommand(Gateway_SoundVolume,10)
sendCommand(Gateway_Sound,29)
Thread::sleep(5000) /* play for 10 seconds */
sendCommand(Gateway_Color, 7)
sendCommand(Gateway_SoundVolume, 10)
sendCommand(Amanbedroom_Power, OFF)
end


(Koltsz) #877

Really dumb question, can’t seem to find it anywhere online, is there any Alarm system support for the gateway? or is this not going to happen ?

Regards


(Thomas Binder) #878

there’s no “real” Alarm System for Mihome. Yet there are either Window sensors and Motion sensor. There’s no glass breakage detector or other “industrial grade” Alarm sensors.
The sensors are not sealed or protected against sabotage or vandalism. For simple purposes they’re sufficient, but if you really need one you should go with a professional alarm system with an Integration option in a smarthome.


(Koltsz) #879

cheers for the reply, also thank you, I didn’t consider the device as just a speaker and light. I just need to create rules based on the door sensors and PIR’s that tell it to make noise and send notifications.


(Thomas Binder) #880

That’s no problem at all. You could do that by just the MiHome-App alone.
But of course if you integrate the gateway, you can use OH2-rules and do the same plus you can trigger OH2-connected things also.