Mercurial > code > home > repos > homeauto
annotate service/reasoning/rules.n3 @ 199:7d897fe34306
some fuxi issue
Ignore-this: a22564fc32a8528f937d714ee1cc4e84
author | drewp@bigasterisk.com |
---|---|
date | Sun, 04 Oct 2015 04:16:37 -0700 |
parents | 71577a849628 |
children | b0089d1ca4f6 |
rev | line source |
---|---|
129
745eff67ad40
reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents:
118
diff
changeset
|
1 # rules only! statements in this file will not be considered in the graph |
745eff67ad40
reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents:
118
diff
changeset
|
2 |
21 | 3 @prefix : <http://projects.bigasterisk.com/room/>. |
4 @prefix bigast: <http://bigasterisk.com/>. | |
5 @prefix dev: <http://projects.bigasterisk.com/device/>. | |
6 @prefix foaf: <http://xmlns.com/foaf/0.1/> . | |
7 @prefix env: <http://projects.bigasterisk.com/device/environment>. | |
54
42411726a7ca
screen out more values that change on every update
drewp@bigasterisk.com
parents:
31
diff
changeset
|
8 @prefix math: <http://www.w3.org/2000/10/swap/math#> . |
21 | 9 |
30 | 10 { <http://bigasterisk.com/wifiDevice/x> :connected bigast:wifiAccessPoints . } => { :auth :near :home } . |
11 { <http://bigasterisk.com/wifiDevice/x> :connected bigast:wifiAccessPoints . } => { :auth :near :home } . | |
12 { <http://bigasterisk.com/wifiDevice/x> :connected bigast:wifiAccessPoints . } => { :playstation :powerState :on } . | |
21 | 13 |
14 { env: :localHour 8 } => { env: :localHour :awakeTime } . | |
15 { env: :localHour 9 } => { env: :localHour :awakeTime } . | |
16 { env: :localHour 10 } => { env: :localHour :awakeTime } . | |
17 { env: :localHour 11 } => { env: :localHour :awakeTime } . | |
18 { env: :localHour 12 } => { env: :localHour :awakeTime } . | |
19 { env: :localHour 13 } => { env: :localHour :awakeTime } . | |
20 { env: :localHour 14 } => { env: :localHour :awakeTime } . | |
21 { env: :localHour 15 } => { env: :localHour :awakeTime } . | |
22 { env: :localHour 16 } => { env: :localHour :awakeTime } . | |
23 { env: :localHour 17 } => { env: :localHour :awakeTime } . | |
24 { env: :localHour 18 } => { env: :localHour :awakeTime } . | |
25 { env: :localHour 19 } => { env: :localHour :awakeTime } . | |
26 { env: :localHour 20 } => { env: :localHour :awakeTime } . | |
27 { env: :localHour 21 } => { env: :localHour :awakeTime } . | |
28 { env: :localHour 22 } => { env: :localHour :awakeTime } . | |
29 { env: :localHour 23 } => { env: :localHour :awakeTime } . | |
30 | |
31 { | |
32 :auth :near :home . | |
118 | 33 dev:theaterDoorOutsideMotion :state :sustainedMotion . |
21 | 34 dev:theaterDoorOpen :state :closed . |
35 env: :localHour :awakeTime . | |
36 } => { dev:theaterDoorLock :state :unlocked } . | |
37 | |
38 { dev:frontDoorOpen :state :closed } => { dev:frontDoorOpenIndicator :text "_" } . | |
39 { dev:frontDoorOpen :state :open } => { dev:frontDoorOpenIndicator :text "D" } . | |
40 | |
41 { dev:frontDoorMotion :state :noMotion } => { | |
42 dev:frontDoorMotionIndicator :text "_" . | |
43 dev:frontDoorLcd :brightness 0 . | |
44 } . | |
45 { dev:frontDoorMotion :state :motion } => { | |
46 dev:frontDoorMotionIndicator :text "D" . | |
47 dev:frontDoorLcd :brightness 255 . | |
48 } . | |
31 | 49 |
54
42411726a7ca
screen out more values that change on every update
drewp@bigasterisk.com
parents:
31
diff
changeset
|
50 { :darkKey :state :press } => { |
42411726a7ca
screen out more values that change on every update
drewp@bigasterisk.com
parents:
31
diff
changeset
|
51 <http://bigasterisk.com/host/dash/monitor> :powerState :off . |
42411726a7ca
screen out more values that change on every update
drewp@bigasterisk.com
parents:
31
diff
changeset
|
52 } . |
42411726a7ca
screen out more values that change on every update
drewp@bigasterisk.com
parents:
31
diff
changeset
|
53 |
88
3988aaa5ea82
change cactus button to one that works. yellow button plays music
drewp@bigasterisk.com
parents:
67
diff
changeset
|
54 { <http://projects.bigasterisk.com/room/star/button/blu> :change :down . } => |
67 | 55 { |
56 <http://bigasterisk.com/host/star/slideshow> :postAction <http://bigasterisk.com/host/star/slideshow/advance> . | |
88
3988aaa5ea82
change cactus button to one that works. yellow button plays music
drewp@bigasterisk.com
parents:
67
diff
changeset
|
57 <http://bigasterisk.com/host/star/slideshow> :postAction <http://star:9049/effects/beep2> . |
3988aaa5ea82
change cactus button to one that works. yellow button plays music
drewp@bigasterisk.com
parents:
67
diff
changeset
|
58 } . |
3988aaa5ea82
change cactus button to one that works. yellow button plays music
drewp@bigasterisk.com
parents:
67
diff
changeset
|
59 |
3988aaa5ea82
change cactus button to one that works. yellow button plays music
drewp@bigasterisk.com
parents:
67
diff
changeset
|
60 |
3988aaa5ea82
change cactus button to one that works. yellow button plays music
drewp@bigasterisk.com
parents:
67
diff
changeset
|
61 { <http://projects.bigasterisk.com/room/star/button/yel> :change :down . } => |
3988aaa5ea82
change cactus button to one that works. yellow button plays music
drewp@bigasterisk.com
parents:
67
diff
changeset
|
62 { |
129
745eff67ad40
reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents:
118
diff
changeset
|
63 <http://bigasterisk.com/host/star/slideshow> :postAction <http://bigasterisk.com/host/star/slideshow/toggleFeeder> . |
745eff67ad40
reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents:
118
diff
changeset
|
64 <http://bigasterisk.com/host/star/slideshow> :postAction <http://star:9049/effects/beep1> . |
88
3988aaa5ea82
change cactus button to one that works. yellow button plays music
drewp@bigasterisk.com
parents:
67
diff
changeset
|
65 } . |
3988aaa5ea82
change cactus button to one that works. yellow button plays music
drewp@bigasterisk.com
parents:
67
diff
changeset
|
66 |
181
71577a849628
new reasoning config for storage motion.
drewp@bigasterisk.com
parents:
129
diff
changeset
|
67 { <http://projects.bigasterisk.com/room/barcodeScan> <http://projects.bigasterisk.com/room/read> <http://projects.bigasterisk.com/room/barcode/UPC-A/4984343881945> } => |
71577a849628
new reasoning config for storage motion.
drewp@bigasterisk.com
parents:
129
diff
changeset
|
68 { |
71577a849628
new reasoning config for storage motion.
drewp@bigasterisk.com
parents:
129
diff
changeset
|
69 <http://bigasterisk.com/host/star/slideshow> :postAction <http://star:9049/effects/troyandabed> . |
71577a849628
new reasoning config for storage motion.
drewp@bigasterisk.com
parents:
129
diff
changeset
|
70 } . |
71577a849628
new reasoning config for storage motion.
drewp@bigasterisk.com
parents:
129
diff
changeset
|
71 |
71577a849628
new reasoning config for storage motion.
drewp@bigasterisk.com
parents:
129
diff
changeset
|
72 @prefix bed: <http://projects.bigasterisk.com/room/ariBed/> . |
71577a849628
new reasoning config for storage motion.
drewp@bigasterisk.com
parents:
129
diff
changeset
|
73 { bed:button1 :change :down . } => { |
71577a849628
new reasoning config for storage motion.
drewp@bigasterisk.com
parents:
129
diff
changeset
|
74 <http://bigasterisk.com/host/star/slideshow> :postAction <http://brace:9055/starTrekLight/toggle> . |
71577a849628
new reasoning config for storage motion.
drewp@bigasterisk.com
parents:
129
diff
changeset
|
75 <http://bigasterisk.com/host/star/slideshow> :postAction <http://brace:9049/effects/highlight> . |
71577a849628
new reasoning config for storage motion.
drewp@bigasterisk.com
parents:
129
diff
changeset
|
76 } . |
71577a849628
new reasoning config for storage motion.
drewp@bigasterisk.com
parents:
129
diff
changeset
|
77 { bed:button2 :change :down . } => { <http://bigasterisk.com/host/star/slideshow> :postAction <http://brace:9049/effects/troyandabed> . } . |
71577a849628
new reasoning config for storage motion.
drewp@bigasterisk.com
parents:
129
diff
changeset
|
78 { bed:button3 :change :down . } => { <http://bigasterisk.com/host/star/slideshow> :postAction <http://brace:9049/effects/beep1> . } . |
71577a849628
new reasoning config for storage motion.
drewp@bigasterisk.com
parents:
129
diff
changeset
|
79 { bed:button4 :change :down . } => { <http://bigasterisk.com/host/star/slideshow> :postAction <http://brace:9049/effects/beep1> . } . |
71577a849628
new reasoning config for storage motion.
drewp@bigasterisk.com
parents:
129
diff
changeset
|
80 { bed:button5 :change :down . } => { <http://bigasterisk.com/host/star/slideshow> :postAction <http://brace:9049/effects/jazztrumpet> . } . |
71577a849628
new reasoning config for storage motion.
drewp@bigasterisk.com
parents:
129
diff
changeset
|
81 |
129
745eff67ad40
reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents:
118
diff
changeset
|
82 |
745eff67ad40
reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents:
118
diff
changeset
|
83 # sound wasn't responding; waiting for other button fixes |
745eff67ad40
reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents:
118
diff
changeset
|
84 # { <http://projects.bigasterisk.com/room/star/button/yel> :change :down . } => |
745eff67ad40
reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents:
118
diff
changeset
|
85 # { |
745eff67ad40
reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents:
118
diff
changeset
|
86 # <http://bigasterisk.com/host/star/sound> :postAction <http://star:9049/sound?filename=/my/music/ubuntuone/Daft+Punk/Discovery/Harder+Better+Faster+Stronger.mp3> . |
745eff67ad40
reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents:
118
diff
changeset
|
87 # } . |
745eff67ad40
reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents:
118
diff
changeset
|
88 |
88
3988aaa5ea82
change cactus button to one that works. yellow button plays music
drewp@bigasterisk.com
parents:
67
diff
changeset
|
89 { <http://projects.bigasterisk.com/room/livingRoom/shuttlepro/dial> :change :up . } => { |
3988aaa5ea82
change cactus button to one that works. yellow button plays music
drewp@bigasterisk.com
parents:
67
diff
changeset
|
90 <http://bigasterisk.com/host/slash/sound> :postAction <http://slash:9049/volume?offset=.05&max=.6> . |
3988aaa5ea82
change cactus button to one that works. yellow button plays music
drewp@bigasterisk.com
parents:
67
diff
changeset
|
91 } . |
3988aaa5ea82
change cactus button to one that works. yellow button plays music
drewp@bigasterisk.com
parents:
67
diff
changeset
|
92 |
3988aaa5ea82
change cactus button to one that works. yellow button plays music
drewp@bigasterisk.com
parents:
67
diff
changeset
|
93 { <http://projects.bigasterisk.com/room/livingRoom/shuttlepro/dial> :change :down . } => { |
3988aaa5ea82
change cactus button to one that works. yellow button plays music
drewp@bigasterisk.com
parents:
67
diff
changeset
|
94 <http://bigasterisk.com/host/slash/sound> :postAction <http://slash:9049/volume?offset=-.05&max=.6> . |
67 | 95 } . |
96 | |
54
42411726a7ca
screen out more values that change on every update
drewp@bigasterisk.com
parents:
31
diff
changeset
|
97 #{ :playstation :powerState ?s } => { <http://bigasterisk.com/host/bang/monitor> :powerState ?s } . |
42411726a7ca
screen out more values that change on every update
drewp@bigasterisk.com
parents:
31
diff
changeset
|
98 |
42411726a7ca
screen out more values that change on every update
drewp@bigasterisk.com
parents:
31
diff
changeset
|
99 { |
42411726a7ca
screen out more values that change on every update
drewp@bigasterisk.com
parents:
31
diff
changeset
|
100 # this won't update right, currently, since I don't let the exact |
42411726a7ca
screen out more values that change on every update
drewp@bigasterisk.com
parents:
31
diff
changeset
|
101 # idle time into the rules recalculator. This threshold should be |
42411726a7ca
screen out more values that change on every update
drewp@bigasterisk.com
parents:
31
diff
changeset
|
102 # applied upstream. |
42411726a7ca
screen out more values that change on every update
drewp@bigasterisk.com
parents:
31
diff
changeset
|
103 |
42411726a7ca
screen out more values that change on every update
drewp@bigasterisk.com
parents:
31
diff
changeset
|
104 <http://bigasterisk.com/host/dash/xidle> :idleTimeMinutes ?idle . |
199 | 105 # broken with new fuxi- needs review: ?idle math:lessThan 30 . |
54
42411726a7ca
screen out more values that change on every update
drewp@bigasterisk.com
parents:
31
diff
changeset
|
106 } => { |
42411726a7ca
screen out more values that change on every update
drewp@bigasterisk.com
parents:
31
diff
changeset
|
107 :drew :at :desk . |
42411726a7ca
screen out more values that change on every update
drewp@bigasterisk.com
parents:
31
diff
changeset
|
108 # the plan here is that as soon as we can show that I'm not at my |
42411726a7ca
screen out more values that change on every update
drewp@bigasterisk.com
parents:
31
diff
changeset
|
109 # desk (cell phone wifi, asleep, etc), power the screen off |
42411726a7ca
screen out more values that change on every update
drewp@bigasterisk.com
parents:
31
diff
changeset
|
110 } . |
129
745eff67ad40
reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents:
118
diff
changeset
|
111 |
745eff67ad40
reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents:
118
diff
changeset
|
112 @prefix shuttle: <http://bigasterisk.com/room/livingRoom/shuttlepro/> . |
745eff67ad40
reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents:
118
diff
changeset
|
113 @prefix mpd: <http://bigasterisk.com/host/slash/mpd> . |
745eff67ad40
reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents:
118
diff
changeset
|
114 |
745eff67ad40
reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents:
118
diff
changeset
|
115 { ?button :state :press . ?button :playsMusic ?song } => { mpd: :startMusic ?song } . |
745eff67ad40
reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents:
118
diff
changeset
|
116 # the rest of this modeling is still a mess. Handled completely by special case in reasoning.py |
745eff67ad40
reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents:
118
diff
changeset
|
117 { shuttle:button12 :state :press } => { mpd: :playState :pause } . |
745eff67ad40
reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents:
118
diff
changeset
|
118 { shuttle:dial :change :clockwise } => { mpd: :audioState :volumeStepUp } . |
745eff67ad40
reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents:
118
diff
changeset
|
119 { shuttle:dial :change :counterclockwise } => { mpd: :audioState :volumeStepDown } . |
181
71577a849628
new reasoning config for storage motion.
drewp@bigasterisk.com
parents:
129
diff
changeset
|
120 |
71577a849628
new reasoning config for storage motion.
drewp@bigasterisk.com
parents:
129
diff
changeset
|
121 { <http://bigasterisk.com/homeauto/sensor/motion0> :seesRecently <http://projects.bigasterisk.com/room/noMotion> . } => { |
71577a849628
new reasoning config for storage motion.
drewp@bigasterisk.com
parents:
129
diff
changeset
|
122 :storageCeilingLedCross :brightness "0" . |
71577a849628
new reasoning config for storage motion.
drewp@bigasterisk.com
parents:
129
diff
changeset
|
123 :storageCeilingLedLong :brightness "0" . |
71577a849628
new reasoning config for storage motion.
drewp@bigasterisk.com
parents:
129
diff
changeset
|
124 } . |
71577a849628
new reasoning config for storage motion.
drewp@bigasterisk.com
parents:
129
diff
changeset
|
125 |
71577a849628
new reasoning config for storage motion.
drewp@bigasterisk.com
parents:
129
diff
changeset
|
126 { <http://bigasterisk.com/homeauto/sensor/motion0> :seesRecently <http://projects.bigasterisk.com/room/motion> . } => { |
71577a849628
new reasoning config for storage motion.
drewp@bigasterisk.com
parents:
129
diff
changeset
|
127 :storageCeilingLedCross :brightness "1" . |
71577a849628
new reasoning config for storage motion.
drewp@bigasterisk.com
parents:
129
diff
changeset
|
128 :storageCeilingLedLong :brightness "1" . |
71577a849628
new reasoning config for storage motion.
drewp@bigasterisk.com
parents:
129
diff
changeset
|
129 } . |