changeset 1687:3c18ec6cb6ef

reasoning rule updates
author drewp@bigasterisk.com
date Mon, 27 Sep 2021 23:16:46 -0700
parents a79d253769bf
children 5871ef3a380e
files service/reasoning/input/devices.n3 service/reasoning/rules.n3
diffstat 2 files changed, 132 insertions(+), 106 deletions(-) [+]
line wrap: on
line diff
--- a/service/reasoning/input/devices.n3	Mon Sep 27 23:17:29 2021 -0700
+++ b/service/reasoning/input/devices.n3	Mon Sep 27 23:16:46 2021 -0700
@@ -11,80 +11,89 @@
 :off :putValue "off" .
 
 
-#<http://bigasterisk.com/host/bang/monitor>      :putUrl "http://bang:9095/monitor"; :zeroValue "off" .
-#<http://bigasterisk.com/host/dash/monitor>      :putUrl "http://dash:9095/monitor" .
-<http://bigasterisk.com/host/frontdoor/monitor> :putUrl "http://frontdoor:9095/monitor"; :matchPredicate :powerState .
-reasoning:defaultOutput reasoning:default [
-  :subject <http://bigasterisk.com/host/frontdoor/monitor>;
-  :predicate :powerState;
-  :defaultObject "off"
-] .
-
-:storageCeilingLedCross :putUrl <http://bang:9059/output>; :putPredicate :brightness .
-reasoning:defaultOutput reasoning:default [
-  :subject :storageCeilingLedCross;
-  :predicate :brightness;
-  :defaultObject 0.0
-] .
-
-:storageCeilingLedLong :putUrl <http://bang:9059/output>; :putPredicate :brightness .
-reasoning:defaultOutput reasoning:default [
-  :subject :storageCeilingLedLong;
-  :predicate :brightness;
-  :defaultObject 0.0
-] .
-
-:garageOverhead :putUrl <http://garage.vpn-home.bigasterisk.com:9059/output>; :putPredicate :brightness .
-reasoning:defaultOutput reasoning:default [
-  :subject :garageOverhead;
-  :predicate :brightness;
-  :defaultObject 0.0
-] .
-
-:headboardWhite :putUrl <http://bed.vpn-home.bigasterisk.com:9059/output>; :putPredicate :brightness .
-# no default, follows switch (which should be moved to edit /store)
-
-:bedLedStrip :putUrl <http://bed.vpn-home.bigasterisk.com:9059/output>; :putPredicate :color .
-reasoning:defaultOutput reasoning:default [
-  :subject :bedLedStrip;
-  :predicate :color;
-  :defaultObject "#000000"
-] .
-
-:starTrekLight :putUrl <http://frontbed:9059/output>; :putPredicate :brightness .
-
-:kitchenLight :putUrl <http://bang:10008/output>; :putPredicate :brightness .
-# no default, follows switch
-
-:kitchenCounterLight :putUrl <http://bang:10008/output>; :putPredicate :brightness .
-# no default, follows switch
-
-:changingWhite :putUrl <http://changing:9059/output>; :putPredicate :brightness .
-reasoning:defaultOutput reasoning:default [
-  :subject :changingWhite;
-  :predicate :brightness;
-  :defaultObject 0.0
-] .
-
-:changingCamPost a :OneShotPost; :subject :changingCam; :predicate :grab .
-bang: a :OneShotPost; :subject bang:; :predicate :postAction .
-
-:livingRoomLamp1 :putUrl <http://living:9059/output>; :putPredicate :brightness .
-# no default, follows switch
-
-:loftDeskStrip :putUrl <http://frontbed:9059/output>; :putPredicate :x .
-# no default, follows switch
-
-:frontDoorLock
-  :matchPredicate :putState;
-  :putUrl <http://bang:10011/output>;
-  :refreshPutValue "2s";
-  :putPredicate :state .
-reasoning:defaultOutput reasoning:default [
-  :subject :frontDoorLock;
-  :predicate :putState;
-  :defaultObject :locked
-] .
-
-:frontDoorOled :putUrl <http://frontdoor:10013/output>; :putPredicate :state .
-:frontWindow :putPredicate :line1, :line2, :line3, :line4; :putUrl <http://bang:10008/output> .
+# #<http://bigasterisk.com/host/bang/monitor>      :putUrl "http://bang:9095/monitor"; :zeroValue "off" .
+# #<http://bigasterisk.com/host/dash/monitor>      :putUrl "http://dash:9095/monitor" .
+# <http://bigasterisk.com/host/frontdoor/monitor> :putUrl "http://frontdoor:9095/monitor"; :matchPredicate :powerState .
+# reasoning:defaultOutput reasoning:default [
+#   :subject <http://bigasterisk.com/host/frontdoor/monitor>;
+#   :predicate :powerState;
+#   :defaultObject "off"
+# ] .
+# 
+# :storageCeilingLedCross :putUrl <http://bang:9059/output>; :putPredicate :brightness .
+# reasoning:defaultOutput reasoning:default [
+#   :subject :storageCeilingLedCross;
+#   :predicate :brightness;
+#   :defaultObject 0.0
+# ] .
+# 
+# :storageCeilingLedLong :putUrl <http://bang:9059/output>; :putPredicate :brightness .
+# reasoning:defaultOutput reasoning:default [
+#   :subject :storageCeilingLedLong;
+#   :predicate :brightness;
+#   :defaultObject 0.0
+# ] .
+# 
+# :garageOverhead :putUrl <http://bang5:10314/output>; :putPredicate :brightness .
+# reasoning:defaultOutput reasoning:default [
+#   :subject :garageOverhead;
+#   :predicate :brightness;
+#   :defaultObject 0.0
+# ] .
+# 
+# :headboardWhite :putUrl <http://bang5:10315/output>; :putPredicate :brightness .
+# # no default, follows switch (which should be moved to edit /store)
+# 
+# :bedLedStrip :putUrl <http://bang5:10315/output>; :putPredicate :color .
+# reasoning:defaultOutput reasoning:default [
+#   :subject :bedLedStrip;
+#   :predicate :color;
+#   :defaultObject "#000000"
+# ] .
+# 
+# :starTrekLight :putUrl <http://bang5:10317/output>; :putPredicate :brightness .
+# 
+# :kitchenLight :putUrl <http://bang:10008/output>; :putPredicate :brightness .
+# # no default, follows switch
+# 
+# :kitchenCounterLight :putUrl <http://bang:10008/output>; :putPredicate :brightness .
+# # no default, follows switch
+# 
+# :changingWhite :putUrl <http://bang5:10316/output>; :putPredicate :brightness .
+# reasoning:defaultOutput reasoning:default [
+#   :subject :changingWhite;
+#   :predicate :brightness;
+#   :defaultObject 0.0
+# ] .
+# 
+# :changingCamPost a :OneShotPost; :subject :changingCam; :predicate :grab .
+# bang:            a :OneShotPost; :subject bang:; :predicate :postAction .
+# 
+# :livingRoomLamp1       :putUrl <http://bang5:10311/output>; :putPredicate :brightness .
+# :livingRoomLamp2       :putUrl <http://bang5:10311/output>; :putPredicate :brightness .
+# :livingRoomLamp3       :putUrl <http://bang5:10311/output>; :putPredicate :brightness .
+# :livingLampShelf       :putUrl <http://bang:10008/output>; :putPredicate :brightness .
+# :livingLampShelf       :putUrl <http://bang:10008/output>; :putPredicate :brightness .
+# :livingLampMantleEntry :putUrl <http://bang:10008/output>; :putPredicate :brightness .
+# :livingLampMantleChair :putUrl <http://bang:10008/output>; :putPredicate :brightness .
+# :livingLampToyShelf    :putUrl <http://bang:10008/output>; :putPredicate :brightness .
+# :livingLampPiano       :putUrl <http://bang:10008/output>; :putPredicate :brightness .
+# 
+# # no default, follows switch
+# 
+# :loftDeskStrip :putUrl <http://bang5:10317/output>; :putPredicate :x .
+# # no default, follows switch
+# 
+# :frontDoorLock
+#   :matchPredicate :putState;
+#   :putUrl <http://bang:10011/output>;
+#   :refreshPutValue "2s";
+#   :putPredicate :state .
+# reasoning:defaultOutput reasoning:default [
+#   :subject :frontDoorLock;
+#   :predicate :putState;
+#   :defaultObject :locked
+# ] .
+# 
+# :frontDoorOled :putUrl <http://frontdoor:10013/output>; :putPredicate :state .
+# :frontWindow :putPredicate :line1, :line2, :line3, :line4; :putUrl <http://bang:10008/output> .
--- a/service/reasoning/rules.n3	Mon Sep 27 23:17:29 2021 -0700
+++ b/service/reasoning/rules.n3	Mon Sep 27 23:16:46 2021 -0700
@@ -17,22 +17,22 @@
 # { ?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 } .
+# { 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 } .
 
 #{
 #  # this won't update right, currently, since I don't let the exact
@@ -65,18 +65,20 @@
 
 { sensor:bedGreenButton :buttonState :press } => {
   :headboardWhite :brightness 0.0 .
+  :bedHeadboard :color "#000000" .
   :anim1 :position :end .
 } .
 
 { sensor:bedRedButton :buttonState :press . :headboardWhite :brightness 0.0 . } => {
-  :headboardWhite :brightness 0.2 . 
+  :headboardWhite :brightness 0.2 .
+  :bedHeadboard :color "#333333" .
 } .
 
 { sensor:bedRedButton :buttonState :press . :headboardWhite :brightness 0.2 . } => {
   :headboardWhite :brightness 1.0 .
+  :bedHeadboard :color "#ffffff" .
 } .
 
-@prefix sensor:   <http://bigasterisk.com/homeauto/sensor/> .
 { sensor:buttonAriBed :buttonState :press } => {
   :starTrekLight :brightness 0.0 .
 } .
@@ -90,22 +92,33 @@
 } .
 
 { sensor:motionChanging :sees :motionStart90 . dev:calendar :twilight :daytime .} => {
-  :changingCam :grab <http://bang:9057/changing-day.jpg> .
+  :changingCam :grab <http://bang:9057/snapshot/changing-day.jpg> .
   } .
 
 { sensor:motionChanging :sees :motionStart90 . dev:calendar :twilight :withinTwilight .} => {
-  :changingCam :grab <http://bang:9057/changing-night.jpg> .
+  :changingCam :grab <http://bang:9057/snapshot/changing-night.jpg> .
   } .
 
-{ :bookSwitch :buttonState :press . :livingRoomLamp1 :brightness 0.0 . } => {
-  :livingRoomLamp1 :brightness 1.0 .
-  :livingRoomLamp2 :brightness 1.0 .
-  :livingRoomLamp3 :brightness 1.0 .
+{ :bookSwitch :buttonState :press . :livingRoomLamp3 :brightness 0.0 . } => {
+  :livingRoomLamp1       :brightness 1.0 .
+  :livingRoomLamp2       :brightness 1.0 .
+  :livingRoomLamp3       :brightness 1.0 .
+  :livingLampShelf       :brightness 1.0 .
+  :livingLampMantleEntry :brightness 1.0 .
+  :livingLampMantleChair :brightness 1.0 .
+  :livingLampToyShelf    :brightness 1.0 .
+  :livingLampPiano       :brightness 1.0 .
+                  
 } .
-{ :bookSwitch :buttonState :press . :livingRoomLamp1 :brightness 1.0 . } => {
-  :livingRoomLamp1 :brightness 0.0 .
-  :livingRoomLamp2 :brightness 0.0 .
-  :livingRoomLamp3 :brightness 0.0 .
+{ :bookSwitch :buttonState :press . :livingRoomLamp3 :brightness 1.0 . } => {
+  :livingRoomLamp1       :brightness 0.0 .
+  :livingRoomLamp2       :brightness 0.0 .
+  :livingRoomLamp3       :brightness 0.0 .
+  :livingLampShelf       :brightness 0.0 .
+  :livingLampMantleEntry :brightness 0.0 .
+  :livingLampMantleChair :brightness 0.0 .
+  :livingLampToyShelf    :brightness 0.0 .
+  :livingLampPiano       :brightness 0.0 .
 } .
 
 # { :frontBedPostSwitch1 :buttonState :press . :starTrekLight :brightness 0.0 . } => {
@@ -141,7 +154,7 @@
 } .
 
 
-{ <http://bigasterisk.com/homeauto/sensor/motionGarageDoorInside> :seesRecently :motion . } => {
+{ sensor:motionGarageDoorInside :seesRecently :motion . } => {
   :garageOverhead :brightness 1.0 .
 } .
 
@@ -201,3 +214,7 @@
   :frontWindow :line3 "Open" .
 } .
 
+{  :wallButton1 :state :pressed } => { :yay :button :b1 }.
+{  :wallButton2 :state :pressed } => { :yay :button :b2 }.
+{  :wallButton3 :state :pressed } => { :yay :button :b3 }.
+{  :wallButton4 :state :pressed } => { :yay :button :b4 }.
\ No newline at end of file