Automatic Trigger Generation for Rule-based Smart Homes
Chandrakana Nandi, Michael D. Ernst UW Seattle, USA
ACM SIGPLAN PLAS, Vienna, Austria 10-24-2016
Automatic Trigger Generation for Rule-based Smart Homes ACM - - PowerPoint PPT Presentation
Automatic Trigger Generation for Rule-based Smart Homes ACM SIGPLAN PLAS, Vienna, Austria 10-24-2016 Chandrakana Nandi, Michael D. Ernst UW Seattle, USA 2 3 Common architecture OR 4 How to control your home? 5 How to control your home?
Chandrakana Nandi, Michael D. Ernst UW Seattle, USA
ACM SIGPLAN PLAS, Vienna, Austria 10-24-2016
2
3
4
OR
5
6
Ur+ CHI 2014, 2016 Ur+ HUPS 2014 Dey+ Pervasive 2006
7
8
Huang+ Ubicomp 2015
9
Huang+ Ubicomp 2015
mental model actual rule
rule “start laundry” when Item laundry_machine changed then if (laundry_machine == FULL) { sendCommand(laundry_machine, “ON”) } end
10
11
12
13
rule "Away rule" when Item State_Away changed
then if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end
14
rule "Away rule" when Item State_Away changed
then if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end
15
rule "Away rule" when Item State_Away changed
then if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end
trigger block
16
rule "Away rule" when Item State_Away changed
then if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end
trigger item trigger item trigger block
17
rule "Away rule" when Item State_Away changed
then if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end
action block
rule "Away rule" when Item State_Away changed
then if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end
18
State_Away = ON State_Sleeping = ON
19
20
21
rule "Away rule" when Item State_Roomheater changed then if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end
22
rule "Away rule" when Item State_Away changed then if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end
23
rule "Away rule" when Item trigger_1 changed Item trigger_2 changed Item trigger_n changed then if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end
24
rule “rule 1” when Item owner_entering_home changed then if (owner_entering_home == true) { sendCommand (hall_light, “ON”) } end rule “rule 2” when Item past_midnight changed then if (past_midnight == true) { sendCommand (hall_light, “OFF”) } end
(owner_entering_home == true && past_midnight == true)
25
26
27
rule "Away rule" when Item State_Away changed then if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end
28
29
rule "Away rule" when Item State_Away changed then if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end
30
rule "Away rule" when Item State_Away changed then if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end
31
rule "Away rule" when Item State_Away changed then if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end
32
rule "Away rule" when Item State_Away changed then if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end
33
rule "Away rule" when Item State_Away changed then if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end
34
rule "Away rule" when Item State_Away changed then if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end
35
rule "Away rule" when Item State_Away changed then if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end
36
rule "Away rule" when Item State_Away changed then if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end
37
rule "Away rule" when Item State_Away changed then if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end
38
rule "Visitor notification system rule" when Item State_Sleeping changed then if (State_Sleeping.state == ON) { postUpdate (Notification_System , OFF) } else { postUpdate (Notification_System , ON) } end
39
rule "Visitor notification system rule" when Item State_Sleeping changed then if (State_Sleeping.state == ON) { postUpdate (Notification_System , OFF) } else { postUpdate (Notification_System , ON) } end rule "Away rule" when Item State_Away changed then if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end 40
Wrongly deactivates notification system
41
rule "Away rule" when Item State_Away changed then if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end
42
rule "Away rule" when Item State_Away changed
then if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end
43
44
45
46
rule "Away rule" when Item State_Away changed then State_Notify = ON if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end
47
rule "Away rule" when Item State_Away changed then State_Notify = ON if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end
action block AST ○ potential triggers
48
rule "Away rule" when Item State_Away changed then State_Notify = ON if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end
action block AST ○ potential triggers
49
rule "Away rule" when Item State_Away changed then State_Notify = ON if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end
action block AST ○ potential triggers
not live ○ redundant triggers ■ State_Notify
50
rule "Away rule" when Item State_Away changed then State_Notify = ON if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end
action block AST ○ potential triggers
not live ○ redundant triggers ■ State_Notify
State_Sleeping: live
51
item repository rule identify all potential triggers eliminate redundant triggers by live variable analysis
52
rule "Rule 1" when trigger then action end
State_Notify State_Away State_Sleeping State_Away State_Sleeping Comparer State_Away Laundry_Machine State_Sleeping Laundry_Machine wrong/extra missing end-user written
53
54
55
56
57
58
55%
59
60
61
62
63