automatic trigger generation for rule based smart homes
play

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?


  1. 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. 2

  3. 3

  4. Common architecture OR 4

  5. How to control your home? 5

  6. How to control your home? Automation rules: when I come home then turn lights on 6

  7. How to control your home? Automation rules are easy and useful Ur+ CHI 2014, 2016 Ur+ HUPS 2014 Dey+ Pervasive 2006 7

  8. How to control your home? Writing correct automation rules is hard Huang+ Ubicomp 2015 8

  9. How to control your home? rule “start laundry” when Item laundry _ machine changed mental model actual rule then if (laundry_machine == FULL) { sendCommand(laundry _ machine, “ON”) } end Writing correct automation rules is hard Huang+ Ubicomp 2015 9

  10. Effects of wrong rules ● Likely unexpected behavior ● Security vulnerabilities 10

  11. Overview ● Background on automation rules ● Problem statement ● Solution ● Algorithm and tool development ● Experiments 11

  12. Overview ● Background on automation rules ● Problem statement ● Solution ● Algorithm and tool development ● Experiments 12

  13. Rule Example rule "Away rule" when Item State_Away changed or Item State_Sleeping changed then if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end 13

  14. Rule Example rule "Away rule" when Item State_Away changed or Item State_Sleeping changed then if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end 14

  15. Rule Example rule "Away rule" when Item State_Away changed trigger block or Item State_Sleeping changed then if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end 15

  16. Rule Example rule "Away rule" when trigger item Item State_Away changed trigger block or Item State_Sleeping changed then trigger item if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end 16

  17. Rule Example rule "Away rule" when Item State_Away changed or Item State_Sleeping changed then if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { action block postUpdate (State_Sleeping, OFF) } } end 17

  18. State_Away = ON rule "Away rule" when Item State_Away changed or Item State_Sleeping changed then if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } State_Sleeping = ON end 18

  19. Overview ● Background on automation rules ● Problem statement ● Solution ● Algorithm and tool development ● Experiments 19

  20. Possible mistakes in rules 20

  21. Wrong trigger block rule "Away rule" when Item State_Roomheater changed then if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end 21

  22. Wrong trigger 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 22

  23. Wrong trigger block 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 23

  24. Conflicts rule “rule 2” rule “rule 1” when when Item past_midnight changed Item owner_entering_home changed then then if (past_midnight == true) { if (owner_entering_home == true) { sendCommand (hall_light, “OFF”) sendCommand (hall_light, “ON”) } } end end (owner_entering_home == true && past_midnight == true) 24

  25. ● Wrong trigger blocks ● Conflicts 25

  26. ● Wrong trigger blocks ● Conflicts 26

  27. Why is it bad? 27

  28. rule "Away rule" when Item State_Away changed then if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end !(State_Away = ON && State_Sleeping = ON) 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 29

  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 30

  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 31

  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 32

  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 33

  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 34

  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 35

  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 36

  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 37

  38. Both states can be set to true! 38

  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 39

  40. Example Attack rule "Away rule" rule "Visitor notification system rule" when when Item State_Away changed Item State_Sleeping changed then then if (State_Away.state == ON) { if (State_Sleeping.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (Notification_System , OFF) postUpdate (State_Sleeping, OFF) } else { } postUpdate (Notification_System , ON) } } end end Wrongly deactivates notification system 40

  41. Overview ● Background on automation rules ● Problem statement ● Solution ● Algorithm and tool development ● Experiments 41

  42. Solution 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

  43. Solution rule "Away rule" when Item State_Away changed or Item State_Sleeping changed // Fix then if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end 43

  44. Overview ● Background on automation rules ● Problem statement ● Solution ● Algorithm and tool development ● Experiments 44

  45. TrigGen: automatically infer triggers from actions using static analysis Idea: live items must be triggers 45

  46. Idea: live items must be triggers Items that are read from before being written to, at the beginning of the action block 46

  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 47

  48. ● Identify all items in the rule "Away rule" when action block AST Item State_Away changed then ○ potential triggers State_Notify = ON if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end 48

  49. ● Identify all items in the rule "Away rule" when action block AST Item State_Away changed then ○ potential triggers State_Notify = ON if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) } } end 49

  50. ● Identify all items in the rule "Away rule" when action block AST Item State_Away changed then ○ potential triggers State_Notify = ON if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) ● eliminate those that are } } not live end ○ redundant triggers ■ State_Notify 50

  51. ● Identify all items in the rule "Away rule" when action block AST Item State_Away changed then ○ potential triggers State_Notify = ON if (State_Away.state == ON) { if (State_Sleeping.state != OFF) { postUpdate (State_Sleeping, OFF) ● eliminate those that are } } not live end ○ redundant triggers ■ State_Notify ● State_Away, State_Sleeping: live 51

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend