-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathlaundry_room.config
99 lines (91 loc) · 3.48 KB
/
laundry_room.config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
//---------------------------------------
//Item Definition
//---------------------------------------
/*Laundry Room */
//in the <OpenHAB15\webapps\images> 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" <myalarm>
Number itm_laun_water_leak_mqtt "Water Leak" (ALL) {mqtt="<[mymosquitto:3032:state:default]"}
Number itm_laun_temp "Laundry Room Temp [%.1f °F]" <temperature> (All) {mqtt="<[mymosquitto:3022:state:default]"}
Number itm_laun_hum "Laundry Room Humidity [%.1f %%]" <temperature> (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" <mylight>
//---------------------------------------
//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 protected]", "laundry water leak" , "laundry water leak detected")
}
//playSound("alarm.mp3")
end