FREE Shipping on all orders over $99 & LIMITED TIME USE CODE "NEW" FOR 10% OFF

Sensors: MQTT Door / Window Sensor Software

MQTT Door / Window Sensor

Software: 

sudo nano /etc/openhab2/items/home.items 
 
 
 
//Security items
 
Switch SecuritySystem "Security System" 
 
Contact MKDoorSensor1 "Side Door [%s]" <door> { mqtt="<[broker:MK-SmartHouse/security/MK-DoorSensor1:state:default]" }
 
 
 
sudo nano /etc/openhab2/sitemaps/home.sitemap
 
 
 
Switch item=SecuritySystem
 
Text item=MKDoorSensor1
 
 
 
sudo nano /etc/openhab2/rules/home.rules
 
 
//Side Door Sensor Is Open
 
rule "Side Door Sensor"
 
when
 
   Item MKDoorSensor1 received update OPEN
 
then
 
       if(SecuritySystem.state == ON)
 
       {
 
           sendBroadcastNotification("SECURITY SYSTEM: SIDE DOOR OPEN")
 
       }
 
end