Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
117 lines (82 sloc) 2.69 KB
/****************************************************************
BUILDING MGMT - AZURE IOT - CHAT
****************************************************************/
PubNub Channels Used:
1.publish_device_status
2.pubsub_device_status_chat
Building Simulation :
===========================
Messages send from device to chatbot in case of a status change in the device
Request Message Format (Pubnub & Azure):
channel : publish_device_status
bulb status :
1. ON
2. OFF
3. Malfunction
device names :
1. bulb1
2. bulb2
request format : {
deviceId: < DEVICE NAME >,
lightstatus: < BULB STATUS >
}
example : {
deviceId: 'bulb1',
lightstatus: 'ON'
}
Chat UI page :
===========================
1.Message Format when device sends a message to chat (via Azure):
channel : pubsub_device_status_chat
bulb status :
1. ON
2. OFF
3. Malfunction
device names :
1. bulb1
2. bulb2
request format : {
"command":"message",
"user": < DEVICE NAME >,
"role":"device",
"userMessage": < BULB STATUS >
}
example : {
"command":"message",
"user":"bulb1",
"role":"device",
"userMessage": "ON"
}
2.Message Format when user (Facility mgmt staff) sends a chat :
Request Format : {
"command": < COMMAND >,
"user": < USER NAME >,
"role": < USER NAME >,
"userMessage": < USER MESSAGE >
}
Commands Used :
1. join
2. message
3. leave
1. New user join :
channel : pubsub_device_status_chat
example : {
"command":"join",
"user":"John",
"role":"Facility Mgmt Team"
}
2. User sends chat message :
channel : pubsub_device_status_chat
example : {
"command":"message",
"user":"John",
"role":"Facility Mgmt Team",
"userMessage": "Hi there"
}
3. User Leaving Chat :
channel : pubsub_device_status_chat
example : {
"command":"leave",
"user":"John",
"role":"Facility Mgmt Team"
}
You can’t perform that action at this time.