changeset 321:79efb6fdcb95

rules updates for storage and changing Ignore-this: d9a72db03ad987a7253a6b5b51eee14e
author drewp@bigasterisk.com
date Mon, 03 Jul 2017 19:50:38 -0700
parents cd7610d7f735
children f420207c7fb4
files service/reasoning/oneShot service/reasoning/rules.n3
diffstat 2 files changed, 33 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/service/reasoning/oneShot	Mon Jul 03 19:48:48 2017 -0700
+++ b/service/reasoning/oneShot	Mon Jul 03 19:50:38 2017 -0700
@@ -7,9 +7,10 @@
 s, p, o = sys.argv[1:]
 
 prefixes = {
-'room' : 'http://projects.bigasterisk.com/room/',
-'shuttle': 'http://bigasterisk.com/room/livingRoom/shuttlepro/',
-    }
+    'room' : 'http://projects.bigasterisk.com/room/',
+    'shuttle': 'http://bigasterisk.com/room/livingRoom/shuttlepro/',
+    'sensor': 'http://bigasterisk.com/homeauto/sensor/',
+}
 
 def expand(term):
     if ':' not in term or term.startswith(('<', '"', "'")):
--- a/service/reasoning/rules.n3	Mon Jul 03 19:48:48 2017 -0700
+++ b/service/reasoning/rules.n3	Mon Jul 03 19:50:38 2017 -0700
@@ -11,6 +11,8 @@
 @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 } .
 
@@ -119,25 +121,26 @@
 { shuttle:dial :change :clockwise        } => { mpd: :audioState :volumeStepUp } .
 { shuttle:dial :change :counterclockwise } => { mpd: :audioState :volumeStepDown } .
 
-{ <http://bigasterisk.com/homeauto/sensor/motion0> :seesRecently <http://projects.bigasterisk.com/room/noMotion> . } => {
-  :storageCeilingLedCross :brightness 0 .
-  :storageCeilingLedLong :brightness 0 .
-} .
+#{ sensor:motionStorage :seesRecently :noMotion . } => {
+#  :storageCeilingLedCross :brightness 0 .
+#  :storageCeilingLedLong :brightness 0 .
+#} .
 
-{ <http://bigasterisk.com/homeauto/sensor/motion0> :seesRecently <http://projects.bigasterisk.com/room/motion> . } => {
+{ sensor:motionStorage :seesRecently :motion . } => {
   :storageCeilingLedCross :brightness 1 .
   :storageCeilingLedLong :brightness 1 .
 } .
 
-{ <http://bigasterisk.com/homeauto/sensor/motion0> :sees <http://projects.bigasterisk.com/room/motionStart> . } => {
-  :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 . } => {
@@ -161,8 +164,12 @@
   :changingWhite :brightness 0.3 .
 } .
 
-{ sensor:motionChanging :sees :motionStart90 } => {
-  :changingCam :grab <http://bang:9057/changing.jpg> .
+{ 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 . } => {
@@ -175,3 +182,14 @@
 } .
 
 
+
+{ <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 . } .
+