lower the volume around me if there is a phone call notify me
problems about moving around priority of actions
How noisy is Gates lounge? How long is HCII's coffee line? Where is Andrew?
Challenges: how to address the problem
Notify me when Anind's meeting is done Let me know when someone enter the lab
Challenges: how to notify when facts changes
Turn the lights on when there are people near \ turn off when there is no people Turn the lights on when motion is detected \ turn off when there is no motion Turn the room's light on when at least on people is in the room
Challenges: addressing the the facts related
Change the room temperature according to my activities
Challenges: Only little actions is belong to this kind
Each device require a bluetooth scanner and beacon (proximity) Each device require a Internet connection (control)
base module: IOT
mode: end-user and virtual device
IOT.getThingByUUID(UUID)
get a thing using UUID
IOT.getThingByLocation(location, types)
get a thing using location type
IOT.Thing
very important type in IOT
module
IOT.Thing.init = func(self)
append function to the init script of a thing
IOT.Thing.set("var", value)
set value of a thing
IOT.Thing.subscribe("var", func(self, var))
subscribe a variable value
IOT.Thing.var
sync version of subscribe a variable
IOT.Thing.(function name) = func(self, ...)
add a function to the thing
IOT.Thing.func(...)
call a certain function
IOT.Thing.nest(obj)
let this thing nested in obj
IOT.Thing.nested
ThingsList
of all the nested devices
IOT.Thing.nesting
ThingsList
of all the devices the current device is nesting
IOT.Thing.near
ThingsList
of all near device, discovered by bluewave
IOT.Room
a room in IOT environment
IOT.Area
a area in IOT environment
IOT.Building
a building in IOT environment
IOT.Person
a person in IOT environment
IOT.findPerson(str)
using str
to find a person
IOT.findBuilding(str)
using str
to find building
IOT.ThingsList.func
let all thingslist item receive func call
IOT.ThingsList.select(cond, type)
select things based on condition cond
and type type
How noisy is Gates lounge?
# get Gate's center's location by Google API
gates = IOT.findBuilding("Gate's Center")
gates_lounge = gates.nested.select(Name("lounge"), "Room")
return gates_lounge.sound_volume
How long is HCII's coffee line?
# get NSH's location by Google API
nsh = IOT.findBuilding("Newell Simon Hall")
nsh_coffeeroom = nsh.nested.select("coffee", "room")
return nsh_coffeeroom.people_count()
Where is Andrew?
# programmer should know andrew's uuid
andrew = IOT.findPerson("Andrew")
return andrew.location()
Notify me when Anind's meeting is done
# programmer should know Anind's uuid
anind = IOT.findPerson("Anind")
anind.subscribe("current_event") = func(self, event):
if(event == "free"):
notify()
Let me know when someone enter the lab
# assume we already konws about the room
lastObj
room.subscribe("nested") = func(self, obj):
newObj = obj.select("people")
if compare(newObj, lastObj):
notify()
Turn the lights on when there are people near \ turn off when there is no people
# assume we are dealing with lights in a room
lights = room.nested.select("lights")
lights.init = func(lightsSelf){
self.near.select(Nearest, "motion").subscribe("near", func(motionSelf, var):
if len(var.select("people")) > 0:
lightsSelf.on()
else:
lightsSelf.off()
)
}
Turn the lights on when motion is detected \ turn off when there is no motion
# assume we are dealing with lights in a room
lights = room.nested.select("lights")
lights.init = func(lightsSelf){
self.near.select(Nearest, "motion").subscribe("people", func(motionSelf, var):
if var == True:
lightsSelf.on()
else:
lightsSelf.off()
)
}
Turn the room's light on when at least on people is in the room
# assume we are dealing with lights in a room
lights = room.nested.select("lights")
lights.init = func(lightsSelf){
self.nesting.select("room").subscribe("near", func(roomSelf, var):
if len(var.select("people")) > 0:
lightsSelf.on()
else:
lightsSelf.off()
)
}
Challenges: addressing the the facts related
Change the room temperature according to my activities
Challenges: Only little actions is belong to this kind