view service/piNode/config/main.n3 @ 1128:c06b631479af

frontbed config Ignore-this: 615b26b5f518db98d2f53f7777755bf2 darcs-hash:ab860ebf636e22e91f095cd6f25886c39789333b
author drewp <drewp@bigasterisk.com>
date Mon, 15 Jan 2018 02:59:52 -0800
parents 77f6117e002f
children 4f89d130a3fe
line wrap: on
line source

@prefix rdfs:     <http://www.w3.org/2000/01/rdf-schema#> .
@prefix :         <http://projects.bigasterisk.com/room/> .
@prefix order:    <http://projects.bigasterisk.com/room/ledColorOrder/> .
@prefix ha:       <http://bigasterisk.com/homeauto/> .
@prefix sensor:   <http://bigasterisk.com/homeauto/sensor/> .
@prefix houseLoc: <http://bigasterisk.com/homeauto/houseLoc/> .

@prefix board2pin: <http://bigasterisk.com/homeauto/board2/pin/> .
@prefix board2ow:  <http://bigasterisk.com/homeauto/board2/oneWire/> .
@prefix bed:       <http://bigasterisk.com/homeauto/sensor/bed/> .
ha:node2 a :PiBoard;
  :hostname "bed";
  :onboardDevice ha:bedroomPiTemp;
  :hasPin
    board2pin:GPIO2,
    board2pin:GPIO3,
    board2pin:GPIO4,
    board2pin:GPIO17,
    board2pin:GPIO27,
    board2pin:GPIO18,
    board2pin:GPIO23 
    .

ha:bedroomPiTemp a :OnboardTemperature;
 :influxMeasurement [
    :measurement "temperatureF";
    :predicate :temperatureF;
    :tag [:key "host"; :value "bed"], [:key "location"; :value "bedPi"]] .

board2pin:GPIO2 :gpioNumber 2 .
board2pin:GPIO3 :gpioNumber 3 .
board2pin:GPIO4 :gpioNumber 4 .
board2pin:GPIO17 :gpioNumber 17 .
board2pin:GPIO27 :gpioNumber 27 .
board2pin:GPIO18 :gpioNumber 18 .
board2pin:GPIO23 :gpioNumber 23 .

board2pin:GPIO18 :connectedTo bed:greenButton .
board2pin:GPIO23 :connectedTo bed:redButton .
bed:greenButton a :Pushbutton .
bed:redButton a :Pushbutton .

board2pin:GPIO17 :connectedTo sensor:motionBed .
sensor:motionBed a :MotionSensor;
  :influxMeasurement [
    :measurement "presence";
    :predicate :sees;
    :tag [:key "host"; :value "bed"],
      [:key "sensor"; :value "motion"],
      [:key "location"; :value "bed"]];
  :sees houseLoc:bed .

:bedLedStrip a :RgbStrip;
  :redChannel board2pin:GPIO2;
  :greenChannel board2pin:GPIO3;
  :blueChannel board2pin:GPIO4 .
    
board2pin:GPIO27 :connectedTo :headboardWhite .
:headboardWhite a :LedOutput ; :gamma 2; :fade "yes" .
  
#board2pin:b29 :connectedTo board2ow: .
#board2ow: a :OneWire;
#  :connectedTo board2ow:temperatureSensor .
#board2ow:temperatureSensor a :TemperatureSensor;
#  :position :bed .

@prefix board3pin: <http://bigasterisk.com/homeauto/board3/pin/> .
@prefix board3ow: <http://bigasterisk.com/homeauto/board3/oneWire/> .

ha:node3 a :PiBoard;
  :hostname "kitchen";
  :onboardDevice ha:kitchenPiTemp;
  :hasPin
    board3pin:GPIO4,
    board3pin:GPIO17
    .
    
ha:kitchenPiTemp a :OnboardTemperature;
   :influxMeasurement [
    :measurement "temperatureF";
    :predicate :temperatureF;
    :tag [:key "host"; :value "kitchen"], [:key "location"; :value "kitchenPi"]] .

board3pin:GPIO4 :gpioNumber 4; :connectedTo sensor:tempHumidKitchen .
sensor:tempHumidKitchen a :TempHumidSensor;
  :sees houseLoc:kitchenCounter;
  :influxMeasurement [
    :measurement "temperatureF";
    :predicate :temperatureF;
    :tag [:key "host"; :value "kitchen"], [:key "location"; :value "kitchenCounter"]] .

board3pin:GPIO17 :gpioNumber 17; :connectedTo board3ow: .
board3ow: a :OneWire; :connectedTo board3ow:dev-000003a5a94c .
board3ow:dev-000003a5a94c a :TemperatureSensor;
  :position houseLoc:kitchenCounter;
  :influxMeasurement [
    :measurement "temperatureF";
    :predicate :temperatureF;
    :tag [:key "host"; :value "kitchen"], [:key "location"; :value "kitchenCounter_ds_test"]] .

@prefix board4pin: <http://bigasterisk.com/homeauto/board4/pin/> .

# pinout: https://www.raspberrypi.org/documentation/usage/gpio-plus-and-raspi2/
ha:node4 a :PiBoard;
  :hostname "living";
  :onboardDevice ha:livingPiTemp;
  :hasPin
    board4pin:GPIO17,
    board4pin:GPIO18,
    board4pin:GPIO4,
    board4pin:GPIO27,
    board4pin:GPIO22 .

board4pin:GPIO17 :gpioNumber 17; :connectedTo sensor:tempHumidLivingRoomCeiling .
board4pin:GPIO4 :gpioNumber 4; :connectedTo :livingRoomLamp1 .
board4pin:GPIO27 :gpioNumber 27; :connectedTo :livingRoomLamp2 .
board4pin:GPIO22 :gpioNumber 22; :connectedTo :bookSwitch .


board4pin:GPIO18 :gpioNumber 18; :connectedTo :livingRgb .
:livingRgb a :RgbPixels;
  :colorOrder order:GRB;
  :pixels (:livingRgb0 :livingRgb1 :livingRgb2 :livingRgb3) .


ha:livingPiTemp a :OnboardTemperature;
  :influxMeasurement [
    :measurement "temperatureF";
    :predicate :temperatureF;
    :tag [:key "host"; :value "living"], [:key "location"; :value "livingPi"]] .


sensor:tempHumidLivingRoomCeiling a :TempHumidSensor;
  :sees houseLoc:livingRoomCeiling;
  :influxMeasurement [
    :measurement "temperatureF";
    :predicate :temperatureF;
    :tag [:key "host"; :value "living"], [:key "location"; :value "livingRoomCeiling"]], [
    :measurement "humidity";
    :predicate :humidity;
    :tag [:key "host"; :value "living"], [:key "location"; :value "livingRoomCeiling"]] .

:livingRoomLamp1 a :LedOutput .
:livingRoomLamp2 a :LedOutput .
:bookSwitch a :Pushbutton; :style :inverted .

@prefix board5: <http://bigasterisk.com/homeauto/board5/> .
@prefix board5pin: <http://bigasterisk.com/homeauto/board5/pin/> .

ha:node5 a :PiBoard;
  :hostname "changing";
  :onboardDevice ha:changingPiTemp;
  :hasPin
    board5pin:GPIO4,
    board5pin:GPIO17,
    board5pin:GPIO18 .

ha:changingPiTemp a :OnboardTemperature;
  :influxMeasurement [
    :measurement "temperatureF";
    :predicate :temperatureF;
    :tag [:key "host"; :value "changing"], [:key "location"; :value "changingPi"]] .

board5pin:GPIO4 :gpioNumber 4 .
board5pin:GPIO17 :gpioNumber 17 .
board5pin:GPIO18 :gpioNumber 18 .

board5pin:GPIO4 :connectedTo :changingWhite .
:changingWhite a :LedOutput; :fade "yes" .

board5pin:GPIO17 :connectedTo sensor:motionChanging .
sensor:motionChanging a :MotionSensor;
  :influxMeasurement [
    :measurement "presence";
    :predicate :sees;
    :tag [:key "host"; :value "changing"],
      [:key "sensor"; :value "motion"],
      [:key "location"; :value "changing"]];
  :sees :changing .

board5pin:GPIO18 :connectedTo :changingRgb .
:changingRgb a :RgbPixels;
  :colorOrder order:GRB;
  :pixels (
  board5:rgb0
  board5:rgb1
  board5:rgb2
  board5:rgb3
  board5:rgb4
  board5:rgb5 ) .

board5:rgb0 rdfs:label "rgb0" .
board5:rgb1 rdfs:label "rgb1" .
board5:rgb2 rdfs:label "rgb2" .
board5:rgb3 rdfs:label "rgb3" .
board5:rgb4 rdfs:label "rgb4" .
board5:rgb5 rdfs:label "rgb5" .



@prefix board6pin: <http://bigasterisk.com/homeauto/board6/pin/> .
@prefix board6ow: <http://bigasterisk.com/homeauto/board6/oneWire/> .

ha:node6 a :PiBoard;
  :hostname "garage";
  :onboardDevice ha:garagePiTemp;
  :hasPin
    board6pin:GPIO4,
    board6pin:GPIO17,
    board6pin:GPIO7,
    board6pin:GPIO8,
    board6pin:GPIO15,
    board6pin:GPIO18,
    board6pin:GPIO24,
    board6pin:GPIO25 .
ha:garagePiTemp a :OnboardTemperature;
  :influxMeasurement [
    :measurement "temperatureF";
    :predicate :temperatureF;
    :tag [:key "host"; :value "garage"], [:key "location"; :value "garagePi"]] .

board6pin:GPIO4 :gpioNumber 4; :connectedTo sensor:motionGarageDoorInside .
sensor:motionGarageDoorInside a :MotionSensor;
  :influxMeasurement [
    :measurement "presence";
    :predicate :sees;
    :tag [:key "host"; :value "garage"],
      [:key "sensor"; :value "motion"],
      [:key "location"; :value "garageDoorInside"]];
  :sees :garage .

board6pin:GPIO17 :gpioNumber 17; :connectedTo board6ow: .
board6ow: a :OneWire; :connectedTo board6ow:dev-000003a5c0fb .
board6ow:dev-000003a5c0fb a :TemperatureSensor;
  :position houseLoc:garage;
  :influxMeasurement [
    :measurement "temperatureF";
    :predicate :temperatureF;
    :tag [:key "host"; :value "garage"], [:key "location"; :value "garage"]] .

board6pin:GPIO15 :gpioNumber 15; :connectedTo :garageOverhead .
:garageOverhead a :LedOutput .

board6pin:GPIO18 :gpioNumber 18; :connectedTo :garageRgb .
:garageRgb a :RgbPixels;
  :colorOrder order:GRB;
  :pixels (:garageRgb0 :garageRgb1 :garageRgb2 :garageRgb3) .


board6pin:GPIO25 :gpioNumber 25 .
board6pin:GPIO24 :gpioNumber 24 .
board6pin:GPIO8 :gpioNumber 8 .
board6pin:GPIO7 :gpioNumber 7 .

:garageLcd a :Lcd8544;
  :din board6pin:GPIO25;
  :clk board6pin:GPIO24;
  :dc board6pin:GPIO8;
  :rst board6pin:GPIO7 .
  
    




@prefix board7pin: <http://bigasterisk.com/homeauto/board7/pin/> .

ha:node7 a :PiBoard;
  :hostname "downbath";
  :onboardDevice ha:downbathPiTemp;
  :hasPin
    board7pin:GPIO17,
    board7pin:GPIO4,
    board7pin:GPIO27,
    board7pin:GPIO22 .

ha:downbathPiTemp a :OnboardTemperature;
  :influxMeasurement "temperatureF";
  :influxTag [:key "location"; :value "downBathPi"] .



@prefix board8pin: <http://bigasterisk.com/homeauto/board8/pin/> .

ha:node8 a :PiBoard;
  :hostname "frontdoor";
  :onboardDevice ha:frontdoorPiTemp;
  :hasPin
    board8pin:GPIO4, # open
    board8pin:GPIO11, # motion
    board8pin:GPIO17, # OW temp
    board8pin:GPIO18 .   # rgb

ha:frontdoorPiTemp a :OnboardTemperature;
  :influxMeasurement "temperatureF";
  :influxTag [:key "location"; :value "frontdoorPi"] .

board8pin:GPIO4 :gpioNumber 4; :connectedTo :frontdoorOpenSwitch .
:frontdoorOpenSwitch a :Pushbutton; :style :inverted;
:influxMeasurement [
    :measurement "state";
    :predicate :buttonState;
    :tag [:key "host"; :value "frontdoor"],
      [:key "sensor"; :value "open"],
      [:key "location"; :value "frontDoor"]];.


board8pin:GPIO11 :gpioNumber 11; :connectedTo sensor:motionFrontdoorInside .
sensor:motionFrontdoorInside a :MotionSensor;
  :influxMeasurement [
    :measurement "presence";
    :predicate :sees;
    :tag [:key "host"; :value "frontdoor"],
      [:key "sensor"; :value "motion"],
      [:key "location"; :value "frontdoorInside"]];
  :sees :entryway .
# 17 5V
# 23 GPIO11 through 100R, and signal->220R->LED->gnd
# 25 gnd

board8pin:GPIO18 :gpioNumber 18; :connectedTo :frontdoorRgb .
:frontdoorRgb a :RgbPixels;
  :colorOrder order:GRB;
  :pixels (:frontdoorRgb0 :frontdoorRgb1 :frontdoorRgb2) .



@prefix board9pin: <http://bigasterisk.com/homeauto/board9/pin/> .
@prefix board9ow: <http://bigasterisk.com/homeauto/board9/oneWire/> .

ha:node9 a :PiBoard;
  :hostname "frontbed";
  :onboardDevice ha:frontbedPiTemp;
  :hasPin
    board9pin:GPIO17,
    board9pin:GPIO18,
    board9pin:GPIO19,
    board9pin:GPIO23,
    board9pin:GPIO26
    .

ha:frontbedPiTemp a :OnboardTemperature;
  :influxMeasurement "temperatureF";
  :influxTag [:key "location"; :value "downBathPi"] .

# pin number ignored; see /boot/config.txt
board9pin:GPIO17 :gpioNumber 17; :connectedTo board9ow: .
board9ow: a :OneWire; :connectedTo board9ow:dev-000003a5be13 .
board9ow:dev-000003a5be13 a :TemperatureSensor;
  :position houseLoc:frontbed;
  :influxMeasurement [
    :measurement "temperatureF";
    :predicate :temperatureF;
    :tag [:key "host"; :value "frontbed"], [:key "location"; :value "frontbedUnderDesk"]] .


board9pin:GPIO4 :gpioNumber 4; :connectedTo :frontbedOpenSwitch ;
:influxMeasurement [
    :measurement "state";
    :predicate :buttonState;
    :tag [:key "host"; :value "frontbed"],
      [:key "sensor"; :value "open"],
      [:key "location"; :value "frontbed"]].

board9pin:GPIO23 :gpioNumber 23; :connectedTo :starTrekLight .
:starTrekLight a :LedOutput .

board9pin:GPIO26 :gpioNumber 26; :connectedTo sensor:motionLoftDesk .
sensor:motionLoftDesk a :MotionSensor;
  :xxinfluxMeasurement [
    :measurement "presence";
    :predicate :sees;
    :tag [:key "host"; :value "frontbed"],
      [:key "sensor"; :value "motion"],
      [:key "location"; :value "loftbed"]];
  :sees :loftDesk .

board9pin:GPIO19 :gpioNumber 19; :connectedTo sensor:motionLoftbed .
sensor:motionLoftbed a :MotionSensor;
  :xxinfluxMeasurement [
    :measurement "presence";
    :predicate :sees;
    :tag [:key "host"; :value "frontbed"],
      [:key "sensor"; :value "motion"],
      [:key "location"; :value "loftbed"]];
  :sees :loftbed .

board9pin:GPIO18 :gpioNumber 18; :connectedTo :frontbedRgb .
:frontbedRgb a :RgbPixels;
  :colorOrder order:GRB;
  :pixels (:frontbedRgb0 :frontbedRgb1 :frontbedRgb2
  :frontbedRgb3
:frontbedRgb4) .