Input, control and automation

Monday 7 March 2016

Building a Home AI, Part 4: Calendars

07:01 Posted by Roxton , No comments
Another month, another update. That up above is the very basic Mervyn UI. User input is shown on the right; Mervyn's response is on the left. The speech recognition is still push-to-talk as I haven't got keyword spotting worked out yet (I'm hoping to start looking seriously at hardware in the next month or so).

Implementing calendars has taken longer than I would have liked. I decided that Mervyn ought to support iCalendar because it's the closest thing there is to a universal digital calendar format, and, while user calendars are stored locally by default, I need to be able to pull data from Outlook/Gmail/Apple Calendar and so on, and all of these use iCalendar.

Frustratingly, the only C# library for iCalendar I could find is DDay.iCal. It's nicely made but incomplete and untested, with more bugs than I'm comfortable including in Mervyn (knowingly including, that is). Consequently, most of February has been spent writing an iCalendar library from scratch. It's been fun but time-consuming; I've been writing the library with a mind to making it open source at a later date, and as I've never written anything under that level of (perceived) scrutiny before I've spent a lot more time on it than I do on my normal code.

All of this back-room work hasn't really translated into much progress for Mervyn - the only calendar functionality it has at the moment is to retrieve event information from specified times. I am quite pleased at how responsive it is to natural language requests, though - you can ask it pretty much any grammatically correct variant of "what am I doing tomorrow/next month/in the three weeks after Christmas" and it will handle it.

So, what next? There are a few tweaks I still need to make to the event retrieval code, but once that's done I can get started on creating events. After that, I think I want to do the same for to-do lists (iCalendar supports them so I'll probably just use that again). At this point, Mervyn should be helpful enough that I'll actually want to use it, so I'll have to start work on hardware. Using a Raspberry Pi (as have Jasper and Mycroft) is definitely the path of least resistance here, and I'll admit that I can't easily think of a better alternative.

On the subject of hardware, it's interesting to note that none of the big players in this field - not even Amazon Echo - have managed to get a solution that covers multiple rooms without having to buy about a hundred dollars of hardware per room (if Amazon cuts the cost of Dot this may change, of course). Of course, this may be intentional, but as I'm not particularly interested in turning Mervyn into a business I need to find a less expensive way of doing it. A Bluetooth mic/speaker combo like this could be an answer, if the range/mic quality is up to scratch. The hope is that if the software is good enough you'd be able to use pretty much any hardware you happen to have, but this is a point against the Pi, which isn't particularly well-known for its audio compatibility. Who knows - maybe there'll be some use for Windows 10 on the Pi after all...