Mercurial > code > home > repos > homeauto
view service/reasoning/rules.n3 @ 1153:e4f49cd9dda3
add :pointsAtLeastEvery control
Ignore-this: 9d0236b56b2a7592211ca68b87b4a5d1
darcs-hash:76e4d358cb6b039351c9b6f8e3bb825aaaefcc57
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Sun, 15 Apr 2018 04:41:00 -0700 |
parents | 114ca7fd9d01 |
children | 79d041273e26 |
line wrap: on
line source
# rules only! statements in this file will not be considered in the graph @prefix : <http://projects.bigasterisk.com/room/>. @prefix bigast: <http://bigasterisk.com/>. @prefix dev: <http://projects.bigasterisk.com/device/>. @prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix env: <http://projects.bigasterisk.com/device/environment>. @prefix math: <http://www.w3.org/2000/10/swap/math#> . @prefix star: <http://bigasterisk.com/host/star/> . @prefix bang: <http://bigasterisk.com/host/bang/> . @prefix dash: <http://bigasterisk.com/host/dash/> . @prefix slash: <http://bigasterisk.com/host/slash/> . @prefix sensor: <http://bigasterisk.com/homeauto/sensor/> . { ?d :deviceName "drew-phone"; :connected bigast:wifiAccessPoints . } => { :auth :near :home } . { ?d :deviceName "Kelsis-iPhone"; :connected bigast:wifiAccessPoints . } => { :auth :near :home } . { env: :localHour 8 } => { env: :localHour :awakeTime } . { env: :localHour 9 } => { env: :localHour :awakeTime } . { env: :localHour 10 } => { env: :localHour :awakeTime } . { env: :localHour 11 } => { env: :localHour :awakeTime } . { env: :localHour 12 } => { env: :localHour :awakeTime } . { env: :localHour 13 } => { env: :localHour :awakeTime } . { env: :localHour 14 } => { env: :localHour :awakeTime } . { env: :localHour 15 } => { env: :localHour :awakeTime } . { env: :localHour 16 } => { env: :localHour :awakeTime } . { env: :localHour 17 } => { env: :localHour :awakeTime } . { env: :localHour 18 } => { env: :localHour :awakeTime } . { env: :localHour 19 } => { env: :localHour :awakeTime } . { env: :localHour 20 } => { env: :localHour :awakeTime } . { env: :localHour 21 } => { env: :localHour :awakeTime } . { env: :localHour 22 } => { env: :localHour :awakeTime } . { env: :localHour 23 } => { env: :localHour :awakeTime } . { :auth :near :home . dev:theaterDoorOutsideMotion :state :sustainedMotion . dev:theaterDoorOpen :state :closed . env: :localHour :awakeTime . } => { dev:theaterDoorLock :state :unlocked } . { dev:frontDoorOpen :state :closed } => { dev:frontDoorOpenIndicator :text "_" } . { dev:frontDoorOpen :state :open } => { dev:frontDoorOpenIndicator :text "D" } . { dev:frontDoorMotion :state :noMotion } => { dev:frontDoorMotionIndicator :text "_" . dev:frontDoorLcd :brightness 0 . } . { dev:frontDoorMotion :state :motion } => { dev:frontDoorMotionIndicator :text "D" . dev:frontDoorLcd :brightness 255 . } . { :darkKey :state :press } => { dash:monitor :powerState :off . } . { <http://projects.bigasterisk.com/room/star/button/blu> :change :down . } => { star:slideshow :postAction star:slideshowadvance . star:slideshow :postAction <http://star:9049/effects/beep2> . } . { <http://projects.bigasterisk.com/room/star/button/yel> :change :down . } => { star:slideshow :postAction star:slideshowtoggleFeeder . star:slideshow :postAction <http://star:9049/effects/beep1> . } . { <http://projects.bigasterisk.com/room/barcodeScan> <http://projects.bigasterisk.com/room/read> <http://projects.bigasterisk.com/room/barcode/UPC-A/4984343881945> } => { star:slideshow :postAction <http://star:9049/effects/troyandabed> . } . @prefix bed: <http://projects.bigasterisk.com/room/ariBed/> . { bed:button1 :change :down . } => { star:slideshow :postAction <http://brace:9055/starTrekLight/toggle> . star:slideshow :postAction <http://brace:9049/effects/highlight> . } . { bed:button2 :change :down . } => { star:slideshow :postAction <http://brace:9049/effects/troyandabed> . } . { bed:button3 :change :down . } => { star:slideshow :postAction <http://brace:9049/effects/beep1> . } . { bed:button4 :change :down . } => { star:slideshow :postAction <http://brace:9049/effects/beep1> . } . { bed:button5 :change :down . } => { star:slideshow :postAction <http://brace:9049/effects/jazztrumpet> . } . # sound wasn't responding; waiting for other button fixes # { <http://projects.bigasterisk.com/room/star/button/yel> :change :down . } => # { # star:sound :postAction <http://star:9049/sound?filename=/my/music/ubuntuone/Daft+Punk/Discovery/Harder+Better+Faster+Stronger.mp3> . # } . { <http://projects.bigasterisk.com/room/livingRoom/shuttlepro/dial> :change :up . } => { slash:sound :postAction <http://slash:9049/volume?offset=.05&max=.6> . } . { <http://projects.bigasterisk.com/room/livingRoom/shuttlepro/dial> :change :down . } => { slash:sound :postAction <http://slash:9049/volume?offset=-.05&max=.6> . } . { # this won't update right, currently, since I don't let the exact # idle time into the rules recalculator. This threshold should be # applied upstream. dash:xidle :idleTimeMinutes ?idle . # broken with new fuxi- needs review: ?idle math:lessThan 30 . } => { :drew :at :desk . # the plan here is that as soon as we can show that I'm not at my # desk (cell phone wifi, asleep, etc), power the screen off } . @prefix shuttle: <http://bigasterisk.com/room/livingRoom/shuttlepro/> . @prefix mpd: <http://bigasterisk.com/host/slash/mpd> . { ?button :state :press . ?button :playsMusic ?song } => { mpd: :startMusic ?song } . # the rest of this modeling is still a mess. Handled completely by special case in reasoning.py { shuttle:button12 :state :press } => { mpd: :playState :pause } . { shuttle:dial :change :clockwise } => { mpd: :audioState :volumeStepUp } . { shuttle:dial :change :counterclockwise } => { mpd: :audioState :volumeStepDown } . #{ sensor:motionStorage :seesRecently :noMotion . } => { # :storageCeilingLedCross :brightness 0 . # :storageCeilingLedLong :brightness 0 . #} . { sensor:motionStorage :seesRecently :motion . } => { :storageCeilingLedCross :brightness 1 . :storageCeilingLedLong :brightness 1 . } . #{ sensor:motionStorage :sees :motionStart . } => { # :storageCeilingLedCross :brightness 1 . # :storageCeilingLedLong :brightness 1 . #} . @prefix bed: <http://bigasterisk.com/homeauto/sensor/bed/> . { bed:greenButton :buttonState :press } => { :headboardWhite :brightness 0.0 . :anim1 :position :end . } . { bed:redButton :buttonState :press . :headboardWhite :brightness 0.0 . } => { :headboardWhite :brightness 0.2 . } . { bed:redButton :buttonState :press . :headboardWhite :brightness 0.2 . } => { :headboardWhite :brightness 1 . } . @prefix sensor: <http://bigasterisk.com/homeauto/sensor/> . { sensor:buttonAriBed :buttonState :press } => { :starTrekLight :brightness 0.0 . } . { sensor:motionChanging :seesRecently30 :noMotion } => { :changingWhite :brightness 0.0 . } . { sensor:motionChanging :seesRecently30 :motion } => { :changingWhite :brightness 0.3 . } . { sensor:motionChanging :sees :motionStart90 . dev:calendar :twilight :daytime .} => { :changingCam :grab <http://bang:9057/changing-day.jpg> . } . { sensor:motionChanging :sees :motionStart90 . dev:calendar :twilight :withinTwilight .} => { :changingCam :grab <http://bang:9057/changing-night.jpg> . } . { :bookSwitch :buttonState :press . :livingRoomLamp1 :brightness 0.0 . } => { :livingRoomLamp1 :brightness 1.0 . :livingRoomLamp2 :brightness 1.0 . } . { :bookSwitch :buttonState :press . :livingRoomLamp1 :brightness 1.0 . } => { :livingRoomLamp1 :brightness 0 . :livingRoomLamp2 :brightness 0 . } . { <http://bigasterisk.com/homeauto/sensor/motionGarageDoorInside> :seesRecently :noMotion . } => { :garageOverhead :brightness 0 . } . { <http://bigasterisk.com/homeauto/sensor/motionGarageDoorInside> :seesRecently :motion . } => { :garageOverhead :brightness 1 . } . { sensor:motionBed :sees :motion . } => { :anim1 :playback :start . } . { sensor:motionFrontdoorInside :seesRecently30 :motion } => { <http://bigasterisk.com/host/frontdoor/monitor> :powerState :on . } . { <http://projects.bigasterisk.com/room/remoteButton/KEY_POWER> :state :press } => { #star:slideshow :postAction <http://dash:9049/effects/question> . bang: :postAction <http://10.2.0.62/rpc/motor> . } .