//--------------------------------------- //Item Definition //--------------------------------------- /*Laundry Room */ //in the folder //create 3 pngs // myalarm.png // myalarm-off.png // myalarm-on.png // mylight.png // myalarm-0.png // myalarm-1.png Number itm_laun_dryer_mqtt "Dryer [MAP(laundry.map):%s]" (ALL) {mqtt="<[mymosquitto:3042:state:default]"} Number itm_laun_washer_mqtt "Washer [MAP(laundry.map):%s]" (ALL) {mqtt="<[mymosquitto:3052:state:default]"} Switch itm_laun_water_leak_alm_enb "Laundry Water Leak Notifier" Switch itm_laun_water_leak_alm_sta "Laundry Water Leak Status" Number itm_laun_water_leak_mqtt "Water Leak" (ALL) {mqtt="<[mymosquitto:3032:state:default]"} Number itm_laun_temp "Laundry Room Temp [%.1f °F]" (All) {mqtt="<[mymosquitto:3022:state:default]"} Number itm_laun_hum "Laundry Room Humidity [%.1f %%]" (All) {mqtt="<[mymosquitto:3023:state:default]"} Number itm_laun_light_mqtt "Light Sensor [%.1f]" (ALL) {mqtt="<[mymosquitto:3062:state:default]"} Number itm_laun_light_icon "Laundry Room Light" //--------------------------------------- //Site Map //--------------------------------------- Text label="Laundry Room" icon="firstfloor" { Frame label="Laundry Room Status" { Text item=itm_laun_dryer_mqtt valuecolor=[<1="gray",==1="green",>1="red"] labelcolor=[<1="gray",==1="green",>1="red"] Text item=itm_laun_washer_mqtt valuecolor=[<1="gray",==1="green",>1="red"] labelcolor=[<1="gray",==1="green",>1="red"] Text item=itm_laun_temp Text item=itm_laun_hum Text item=itm_laun_light_icon Switch item=itm_laun_water_leak_alm_sta mappings=[OFF="Reset"] //Text item=itm_laun_water_leak_alm_sta valuecolor=[==0="black",==1="red"] labelcolor=[==0="black",==1="red"] } Frame label="Alarm Enable" { Switch item=itm_laun_water_leak_alm_enb } } //--------------------------------------- //Rules //--------------------------------------- rule "Laundry Lights" when Item itm_laun_light_mqtt received update then if(itm_laun_light_mqtt.state < 350) { sendCommand(itm_laun_light_icon, 0) } else { sendCommand(itm_laun_light_icon, 1) } end rule "Washer Complete" when Item itm_laun_washer_mqtt received update then if(itm_laun_washer_mqtt.state == 2) { say("Washer Complete!") } end rule "Dryer Complete" when Item itm_laun_dryer_mqtt received update then if(itm_laun_dryer_mqtt.state == 2) { say("Dryer Complete!") } end /* --------- Laundry Water Leak ---------- */ rule "Laundry Water Leak" when Item itm_laun_water_leak_mqtt received update then sendCommand(itm_laun_water_leak_alm_sta, ON) end rule "Laundry Water Leak response" when Item itm_laun_water_leak_alm_sta changed from OFF to ON then if(itm_laun_water_leak_alm_enb.state == ON) { sendMail("email_Address@domain.com", "laundry water leak" , "laundry water leak detected") } //playSound("alarm.mp3") end