How can I design an AI that knows when its being spoken to?
Phrase detection instead of text-to-speech

It's worth noting that detection of particular phrases or commands is considered a distinct problem, different from text to speech / text transcription.

While you can simply convert everything it hears to text and then look up keywords there, a specialized detector that directly tries to match incoming audio to a small subset of commands can be done with better accuracy and less processing power required. For this reason, this would generally be the preferred approach in commercial products.

However, for beginner experiments with home automation, you should probably start with choosing an existing speech analysis API where all the audio and natural language parts are appropriately implemented by someone else. Building a good speech command analysis system from scratch is a major undertaking by itself, and you will have your hands full with developing an "artificial intelligent agent"; as a rule, you don't want a project where you have to tackle two major open-ended problems, pick one of them and then you'll have a chance to achieve something interesting there.