For our system there will be two types of inputs that will control the system. First, the input provided by the sensors in the room, followed by the input by the user through a touch screen device located at the entrance of the room. These inputs will be used together to determine the amount, location, and quality delivered to the user.
ID | Name | Description | Entities involved | Data input | Data output |
1 | Book work station | ||||
1.1 | Choose place click | The user touches the screen on a specific image button in order to choose the WS | User -> Tablet | click | |
1.2 | Request reservation | the app asks the server to reserve a WS | Tablet -> Server | int position | status "Ok" - the request was successful "No" - the request failed |
1.3 | Timer | The timer starts when the server turns on the WS | Server | int postazione | |
2 | Power | ||||
2.1 | Check power | the server checks the power consumption of the plug | server -> Dog gate way | int plug_id | int power |
2.2 | Start work station with power status ["Ok" - the request was successful "No" - the request failed] and start bulb as ID 2.1 | if the level of power is more than 5 the server turn on the WS | server | int power | status ["Ok" - the request was successful "No" - the request failed] and start bulb as ID 3.1 |
2.3 | End WS | If the level of the power is less than 5 the server turn off the WS | Server -> bridge | int power | request to turn off to the hue bulb of the work station and getting back status |
3 | Prepare Work Station | ||||
3,1 | Turn on Hue lamp | ||||
3.1.1 | Ask bridge to turn on the bulb | The server asks the bridge to turn on the light on with the default characteristic | Server -> Bridge | int position, int light, int colour, int brightness | status "Ok" - the request was successful, "No" - the request failed |
3.1.2 | Ask hue to turn on | Bridge -> Hue | int position, int light, int colour, int brightness | status "Ok" - the request was successful, "No" - the request failed | |
4 | Look | ||||
4.1 | Ask status/position | the app asks the server the status of each position | tablet -> server | int position | status position "0" - the WS is free "-1" -the WS is not working, otherwise the WS is used |
4.2 | Update GUI | the app listen the status the update the GUI | tablet -> user | status position "0" - the WS is free "-1" -the WS is not working, otherwise the WS is used | change color of each WS if the WS's status is different |
5 | Manage work station | ||||
5.1 | Login | the user can write the Staff password using the GUI in order to change staff information (Working/not working WS) | User -> Tablet | ID staff | start the staff activity |
5.2 | Change working WS | With a click the user is able to change a WS's status from not working to working or viceversa | User-> Tablet | Click | int position |
5.3 | Request change | The tablet asks the server to change status | Tablet -> Server | Int position | status "Ok" change successful, "no" change failed |
5.4 | Logout | The user ask to logout | user -> Tablet | Click | start the normal activity |
6 | Check light | the server checks the lighting of the room by the sensor reading the Dog Gate Way | server -> Dog gate way | int sensor_id | int lighting |
7 | Change light by desktop | ||||
7.1 | User change lighting properties | User->PC | int light, int colour, int brightness | ||
7.2 | PC asks the bridge to change | PC -> Bridge | int light, int colour, int brightness | status "Ok" - the request was successful, "No" - the request failed | |
8 | Turn on led | When the lab is open the bridge will keep turn on the led strip | Server -> bridg | int light, int colour, int brightness | status "Ok" - the request was successful, "No" - the request failed |
ID | Description |
1 | The system should turn off the station after 1 minute if the user has not turned on the computer. |
2 | The system should turn off the station after the user has been away from the computer long enough such that the monitor turns off. |
3 | The system should set the initial light of the station to be the "ideal" light calculated by adding the light from the bulb to the light already present in the room (detected by the sensors). |
hue bridge
hue lights – at each individual station
led strip – located centrally in the room
zig-bee plugs – between the powerstrip that the computer is plugged into and the central power
multi-sensor – located centrally in the room
tablet or touch screen device – located at the entrance to the room
workstation
1 Get all desks
URL - /workstations
Method - GET
1.1 Description
Gets a list of instances of all the workstations in the lab.
1.2 Response
Returns a list of instances of all workstations in the lab. Each workstation instance has its own properties (id, status, bulb, plug, and time).
1.3 Response example
[
{
"id": "1",
"status": "0",
"bulb": "3",
"plug": "MeteringPowerOutlet_21",
"timer": "No current timer"
},
{
"id": "2",
"status": "0",
"bulb": "1",
"plug": "MeteringPowerOutlet_22",
"timer": "No current timer"
}
]
2 Get desk
URL - /workstations/id/
Method - GET
2.1 Description
Gets an instance of the specified workstation.
2.2 Response
Returns a dictionary of values held by the workstation.
2.3 Response example
{
"id": "1",
"status": "0",
"bulb": "3",
"plug": "MeteringPowerOutlet_21",
"timer": "No current timer"
}
3 Get status
URL - /workstations/status/
Method - GET
3.1 Description
Gets the status of the specified workstation.
3.2 Response
Returns a dictionary containing only the status value held by the workstation.
3.3 Response example
{
"status": "0"
}
4 Get timer
URL - /workstations/time/
Method - GET
4.1 Description
Gets the timer of the specified workstation.
4.2 Response
Returns a dictionary containing only the timer value held by the workstation.
4.3 Response example
{
"timer": "No current timer"
}
5 Set timer
URL - /workstations/time/
Method - PUT
5.1 Description
Used to set the timer to the current local time.
5.2 Body arguments
None
5.3 Response
Returns a dictionary containing only the time value held by the workstation.
5.4 Response example
{
"timer": "1112356"
}
6 Workstation on
URL - /workstations/on/
Method - PUT
6.1 Description
Used to set the workstation to state 1. This also starts the timer.
6.2 Body arguments
None
6.3 Response
Returns a dictionary of values held by the workstation.
6.4 Response example
{
"id": "1",
"status": "1",
"bulb": "3",
"plug": "MeteringPowerOutlet_21",
"timer": "1112356"
}
7 Workstation off
URL - /workstations/off/
Method - PUT
7.1 Description
Used to set the workstation to state 0. This also stops the timer.
7.2 Body arguments
None
7.3 Response
Returns a dictionary of values held by the workstation.
7.4 Response example
{
"id": "1",
"status": "0",
"bulb": "3",
"plug": "MeteringPowerOutlet_21",
"timer": "No current timer"
}
8 Workstation steady
URL - /workstations/steady/
Method - PUT
8.1 Description
Used to set the workstation to state 2. This also stops the timer.
8.2 Body arguments
None
8.3 Response
Returns a dictionary of values held by the workstation.
8.4 Response example
{
"id": "1",
"status": "2",
"bulb": "3",
"plug": "MeteringPowerOutlet_21",
"timer": "No current timer"
}
9 Workstation warn
URL - /workstations/warn/
Method - PUT
9.1 Description
Used to set the workstation to state 3. This also starts the timer.
9.2 Body arguments
None
9.3 Response
Returns a dictionary of values held by the workstation.
9.4 Response example
{
"id": "1",
"status": "3",
"bulb": "3",
"plug": "MeteringPowerOutlet_21",
"timer": "1112356"
}
10 Update workstation
URL - /workstations/testupdate/
Method - GET
10.1 Description
Used to update the status of the workstation from state 0 to 1. This method is only used by the app.
10.2 Response
Returns a dictionary of values held by the workstation.
10.3 Response example
{
"id": "1",
"status": "1",
"bulb": "3",
"plug": "MeteringPowerOutlet_21",
"timer": "No current timer"
}