Brighton and Hove has the highest rate of bus journeys per head in the UK, (excluding London), more than three times the national average. But navigating across the city can be a tricky and time-consuming task, with 70 bus lines servicing over 1700 Sussex stops.
As a proud resident, I wanted to create a skill that would utilise Brighton & Hove Bus and Coach company's own information in a clear and accessible way to help my fellow Brightonians find their way across our city.
As with all cities, traffic in Brighton and Hove can be unpredictable and with this in mind I decided to use the Transport API in order to retrieve live timetables, allowing greater accuracy.
Although the API enables easy access to this data, developers need to know the ATCO code of a bus stop in advance to get the information required. So in order to use the Transport API I had to first find a way to let Echo users select the bus stop they want to get details for in real time. As Echo is a home assistant, I decided, for this first version, to allow users to select one bus stop, their home stop.
To start with, I tried to find a vocal way for users to set up their home bus stop, either by: saying the name of the street the stop is on; dictating the ATCO code; or giving the postcode of their chosen bus stop. However, as user experience is paramount when using a skill, and because these solutions were not thoroughly effective, I decided to change the way users set up their home stop by creating a new use for the Link Account card.
When the user asks the skill to set up his home stop, Alexa sends a Link Account card to the Alexa app. The user is then redirected to a website where they can select their bus stop on an interactive map displaying every stop in Brighton and Hove. This is a far more accurate and user-friendly solution that enables users to quickly and easily set their home stop. At any time, they can ask the skill to reset their home stop.
The main challenge I faced was creating the map. I used the NaPTAN public dataset to get the geolocation of each bus stop served by Brighton & Hove Bus and Coach company. Once filtered, I stored these in a DynamoDB and served this data via a simple REST server using a Lambda function and AWS API Gateway.
Once the user has chosen their home stop, the ATCO code is linked to their Alexa account so that every time they ask for the next bus, the skill fetches the live timetable from the Transport API. Alexa communicates this by stating the line number, destination and departure time of up to five services.
To further augment the user experience, I have identified the following features for development:
- The ability to set up multiple stops per user (e.g. work, gym, school)
- The ability to ask for a specific service number at a stop
- The capability to plan a journey between two locations (not necessarily bus stops) within the city and including changes
Have fun!
Comments