From 0cbda0fd73e7e68a30187dedd3ac7f4364ee2888 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Wed, 2 Aug 2023 19:59:30 -0500 Subject: [PATCH] home-assistant: Deploy Piper and Whisper Piper is the new text-to-speech service for Home Assistant. Whisper is a speech-to-text service. Together, these services, which communicate with Home Assistant via the Wyoming protocol, provide the speech interface to the new Home Assistant Voice Assistant feature. --- home-assistant/README.md | 18 +++++++ home-assistant/hass-k8s.plantuml | 6 +++ home-assistant/hass-k8s.svg | 63 ++++++++++++---------- home-assistant/kustomization.yaml | 2 + home-assistant/piper.yaml | 90 +++++++++++++++++++++++++++++++ home-assistant/whisper.yaml | 85 +++++++++++++++++++++++++++++ 6 files changed, 237 insertions(+), 27 deletions(-) create mode 100644 home-assistant/piper.yaml create mode 100644 home-assistant/whisper.yaml diff --git a/home-assistant/README.md b/home-assistant/README.md index 856fbe2..53ef53e 100644 --- a/home-assistant/README.md +++ b/home-assistant/README.md @@ -27,6 +27,8 @@ The Home Assistant ecosystem consists of these components: * Mosquitto (MQTT server) * Zigbee2MQTT (Zigbee integration) * ZWaveJS2MQTT (ZWave integration) +* Piper (Text-to-speech) +* Whisper (Speech-to-text) Each of these components runs in a container in separate pods within the *home-assistant* namespace. @@ -121,6 +123,22 @@ StatefulSet with a PersistentVolume Claim. [ZWaveJS2MQTT]: https://github.com/zwave-js/zwavejs2mqtt/ +### Piper/Whisper + +[Piper] and [Whisper] provide the text-to-speech and speech-to-text +capabilities, respectively, for Home Assistant [Voice Control]. These +processes are designed to run as Add-Ons for Home Assistant OS, but work just +fine as Kubernetes containers as well. + +Piper and Whisper need mutable storage in order to download their machine +learning models. Since the model data are downloaded automatically when the +container starts, using ephemeral volumes is sufficient. + +[Piper]: https://github.com/rhasspy/piper +[Whisper]: https://github.com/guillaumekln/faster-whisper/ +[Voice Control]: https://www.home-assistant.io/voice_control/ + + ## Raspberry Pi Node While Home Assistant Core and Mosquitto can run on any node in the Kubernetes diff --git a/home-assistant/hass-k8s.plantuml b/home-assistant/hass-k8s.plantuml index 2785259..f2f01b9 100644 --- a/home-assistant/hass-k8s.plantuml +++ b/home-assistant/hass-k8s.plantuml @@ -1,3 +1,4 @@ +// vim: set sw=4 ts=4 sts=4 et : @startuml person User @@ -12,6 +13,8 @@ cloud Kubernetes { node "Main Node Cluster" { [Home Assistant] as hass queue Mosquitto as mqtt + [Piper] as piper + [Whisper] as whisper database PostgreSQL as postgres } @@ -37,6 +40,8 @@ cloud Kubernetes { ingress --[#purple]-> mqtt hass -[#teal]-> postgres hass -[#orange]-> zwavejs + hass -[#pink]--> piper + hass -[#pink]--> whisper hass -[#purple]> mqtt z2m -[#purple]-> mqtt @@ -51,5 +56,6 @@ legend right |<&arrow-right> | PostgreSQL | |<&arrow-right> | USB | |<&arrow-right> | ESPHome, etc. | + |<&arrow-right> | Wyoming | end legend @enduml diff --git a/home-assistant/hass-k8s.svg b/home-assistant/hass-k8s.svg index 177626e..8374159 100644 --- a/home-assistant/hass-k8s.svg +++ b/home-assistant/hass-k8s.svg @@ -1,30 +1,34 @@ -KubernetesIngressMain Node ClusterRaspberry Pi NodeHTTPSMQTTHome AssistantMosquittoPostgreSQLZWaveJS2MQTTZigbee2MQTTZigbee ControllerZWave ControllerUserSensors andDevicesLegend HTTP MQTT WebSocket PostgreSQL USB ESPHome, etc.KubernetesIngressMain Node ClusterRaspberry Pi NodeHTTPSMQTTHome AssistantMosquittoPiperWhisperPostgreSQLZWaveJS2MQTTZigbee2MQTTZigbee ControllerZWave ControllerUserSensors andDevicesLegend HTTP MQTT WebSocket PostgreSQL USB ESPHome, etc. Wyoming