Spots

MLH Hack At Home 2020: Hearth

This is a submission for the MLH x DEV Writing Challenge

Hearth is a voice-controlled smart home agent built

Hearth is a voice-controlled smart home agent built for the moment we were all in: stuck at home, working from the same room we slept in, and slowly losing track of what day it was.

The theme for Hack at Home was "help

The theme for Hack at Home was "help folks stay happy at home." In May 2020, the problem in my apartment wasn't a lack of smart devices. It was that home had turned into office, gym, classroom, and bedroom at once, with nothing separating them. So Hearth does three things:

Voice control that knows your devices. "Turn off

Voice control that knows your devices. "Turn off the desk lamp" works because Hearth syncs the real device names from Home Assistant into its language model, instead of relying on generic "light" commands.

Modes for a life that happens in one

Modes for a life that happens in one room. "Work mode" brightens the desk light, sets the room to 71°F, and turns on an "on a call" LED outside the door. "Done for the day" shuts the work lights off, switches to warm lighting, and reminds you to step outside.

Pattern suggestions from sensor history. A small Python

Pattern suggestions from sensor history. A small Python job looks at a week of Home Assistant state history and suggests automations you keep doing by hand, like "You turn on the kitchen light around 7:40 AM every weekday. Want me to do that for you?"

Wake word: Picovoice Porcupine runs on a Raspberry

Wake word: Picovoice Porcupine runs on a Raspberry Pi 4 with a USB mic. It's fully offline, and nothing is sent to the cloud until the wake word fires. Speech-to-text: Google Cloud Speech-to-Text (streaming) transcribes the command after the wake word.

Intent understanding: Dialogflow ES maps the transcript to

Intent understanding: Dialogflow ES maps the transcript to intents like device.set, mode.activate, and history.ask. Device names come from a custom entity type that we sync from Home Assistant's entity registry through the Dialogflow API. When a light is renamed in HA, Hearth picks up the new name within a minute. Fulfillment: A Python Flask webhook on Google Cloud Run turns intents into Home Assistant REST API calls.

Safety: Locks and the garage never actuate from

Safety: Locks and the garage never actuate from voice alone. The webhook sends a Firebase Cloud Messaging push to the Android app, and nothing happens until someone taps Approve.

Pattern mining: A nightly job pulls history from

Pattern mining: A nightly job pulls history from Home Assistant's recorder, buckets it into 15-minute windows with pandas, and finds repeated manual actions. It also runs scikit-learn's Isolation Forest to flag oddities, like the garage being open at 2 AM.

News

MLH Hack At Home 2020: Hearth

This is a submission for the MLH x DEV Writing Challenge

@spots #dev
Source: Dev.to
See more like this