User story: Who/what is raiding my vegetable patch

From Web of Things Community Group

A story about users and developers of a cloud-based Web of Things platform. This was written this as basis for discussion about functional requirements for the platform.

Sue goes to the mall and purchases the ACME home security camera as she wants to be able to monitor the wild animals that are eating the vegetables she has planted in her garden.

The camera has an infra red light, a motion sensor, and can be remotely panned and zoomed.

Sue goes online and logs into her account with the Web of Things platform. She searches for her model of camera and finds that secure-me.com are selling the service she needs. She clicks the button to confirm the purchase for the service (2 USD per month). She starts the secure-me service and is asked for some details in her browser. She opts to keep the data private so that only she can access the data, and to save 5 minutes of video when the camera's motion detector senses something moving in the field of view. She then taps a button to associate the camera with her service. This makes use of local discovery to find the camera, and prompts her to confirm that this is her camera. She does so.

Local discovery is through a discovery API exposed by the browser to trusted web page scripts. Associating a device with a service could involve establishing some form of secure mutual authentication between the device and service.

Sue's new home security service is hosted by a Web of Things cloud-based platform with which she has a user account. The service is an instance of the service class developed by secure-me.com. Secure-me.com created their service class with their account on the Web of Things platform developer portal. A service class has some meta-data that describe the service in a machine interpretable way, some scripts that define the behaviour, and some additional resources such as the icon to be used to depict the service.

The various scripts deal with: 1) associating the device with the service, 2) setting the user preferences, 3) communicating with the device and saving data in the Web of Things platform storage subsystem, and 4) implementing the run-time API that the service exposes to consumers on the Web of Things platform (i.e. apps and composite services). The roles of the scripts and the kinds of meta-data are specified by the Web of Things platform.

A few days later Sue logs back into Web of Things platform and looks at her services. She sees a brief summary for each service. Her security camera service shows that the camera has been activated 5 times. She taps on the service to find out more. It opens up into a display of the activity log. Each entry has the time the camera was activated and a 4 small representative photos from the video stream. She taps on one of entries to view the video and sees a badger busily digging up and eating her carrots.

The service includes an app to view the data it collects. It can allow users to be sent real-time alerts to their mobile phone.

Sue decides she wants the alerts. The next night, her phone chimes and she taps the notification to get live access to her security camera. She is curious to see where the badger goes after it has finished eating. She pans and zooms the camera to follow the badger as it disappears into a hole under her hedge.

Sue has registered her phone with the Web of Things platform so the service can make use of a platform API to send a notification to her phone. The notification is linked to an app, so that when Sue taps the notification, the app is launched in the phone's browser.

The app has access to the service API and this allows it to pan and zoom the camera.

This user story shows that service developers can include apps that can access the data logged by the service, and the live API exposed by the service. This relies on a means to bind the apps to the specific service, so that only Sue can view data from her camera, and likewise prevents her from viewing other cameras using the same service class.

This approach treats services as instances of classes defined by developers. Services are associated with user accounts. Each service is subject to access control policies. Sue chose to make her service private to her. John by contrast has positioned his camera to view his bird table and he has chosen to make the camera publicly accessible.

A given service could be bound (associated) to devices, it could consume data from other services, and it can expose data to yet other services. A service can also be associated with apps to provide a rich user interface as in the above use case.

The Web of Things platform needs to provide a way to execute services, either lazily upon demand when data is sought from a service, or eagerly when data becomes available, that the service consumes.