[DOCKER] [RELEASE] Versatile TTS service for any Docker environment and Sonoff iHost smart hub

:speaker_high_volume: Clean TTS for Sonoff iHost & Smart Home

Studio-Grade Neural Voice Announcements for Your Home Automations

Give your Sonoff iHost and smart home a natural, human-like voice. Clean TTS brings lifelike neural text-to-speech directly to the iHost’s built-in speaker and to any smart media player on your local network.


:glowing_star: What Clean TTS Does

  • :studio_microphone: Natural Neural Speech: Sounds like a real person talking in your room, with natural intonation, breathing rhythm, and clear pronunciation across multiple languages (English, Romanian, German, French, Italian, Spanish, Catalan, etc.).
  • :speaker_high_volume: Speaks on iHost Internal Speaker: Plays announcements directly out of your Sonoff iHost built-in speaker — zero extra cables, amplifiers, or audio accessories needed.
  • :vertical_traffic_light: Never Cuts Off Announcements: If multiple sensors trigger at the exact same moment (e.g. front door opens while a motion alert sounds), Clean TTS speaks every announcement clearly one after another instead of cutting words off or playing noisy overlapping sound.
  • :bell: Pleasant Wake-Up Chime: Softly alerts household members that an announcement is coming before speaking.
  • :open_book: Smart Pronunciation Dictionary: Correctly pronounces smart home brand names and units instead of awkwardly spelling them out (e.g., “Zigbee” sounds like “zig-bi”, “Shelly” sounds like “she-lee”, “kWh” is read as “kilowatt hours”). Includes a live :play_button: Play button to test words before saving.
  • :control_knobs: Live Web Studio: Friendly dashboard at http://ihost.local:8123 to test voices, adjust defaults, and test speech right from your browser.
  • :robot: AI Assistant Ready (MCP): Connects natively with AI assistants (Claude Desktop, Hermes Agent, Antigravity) so your AI agents can speak out loud on your iHost.

:rocket: Quick 1-Minute Setup on Sonoff iHost

  1. In the eWeLink CUBE web interface, navigate to Docker → Images → Search: tmalex/clean-tts
  2. Download the latest image.
  3. Run the container with:
  • Network Mode: Select host (do NOT use bridge mode; bridge causes connection errors with the internal speaker API). In host mode, the port is fixed to 8123.
  • Volume Mount: Create a dedicated partition / folder specifically for Clean TTS (e.g. clean-tts) and map it to /data. Do NOT mount it to another container’s directory (like Node-RED). This dedicated folder keeps your custom words, generated voices, and settings permanently safe across container updates.
  1. Open your browser at: :backhand_index_pointing_right: http://ihost.local:8123
  2. On your first visit, click “Request Access Token” and confirm Allow on your iHost screen to authorize physical speaker playback.

:control_knobs: How Parameters Work (Override on the Fly)

In Clean TTS, you can configure your favorite default voice, volume, and speed in the web dashboard.

Whenever you send an announcement from Node-RED, Home Assistant, or an HTTP request, you can simply send the text, or you can optionally override any setting for that specific announcement:

Parameter Type Example What it does
text string "Front door opened" Required. The message to speak.
lang string "en", "ro", "de", "fr", "ca" Language code. Automatically picks the best native voice.
voice string "en-US-JennyNeural" Select a specific male or female voice.
volume string "+20%", "-15%" Volume boost or reduction for this specific alert (e.g. louder for alarms, quieter at night).
rate string "+10%", "-10%" Speech speed (faster or slower).
pitch string "+5Hz", "-5Hz" Voice pitch adjustment.
bell boolean true / false Enable or disable the notification chime before speaking.
nocache boolean true / false Set true for spontaneous one-off alerts (current time, live sensor readings) to skip disk cache.

:light_bulb: Tip: Any parameter you omit automatically falls back to your saved settings from the web dashboard!

:high_voltage: Caches vs. No-Cache: Fixed alerts (“Front door opened”) are cached on disk for instant (0ms) replay. Spontaneous alerts (“It is 12:45 PM, 21.5°C”) can be sent with "nocache": true so 0 bytes are wasted on your storage drive. You can also run the container with -e NOCACHE=true to enforce streaming mode by default.


:red_circle: Node-RED Integration (Step-by-Step)

Method A: Speak on the Sonoff iHost Speaker (Recommended)

To make your Sonoff iHost speak an announcement out loud:

  1. Add an http request node to your flow.
  2. Configure the node:
  • Method: POST
  • URL: http://ihost.local:8123/api/tts
  • Return: a parsed JSON object
  1. In a change or function node just before the request, set msg.payload:
msg.payload = {
    "text": "Motion detected in the backyard garden.",
    "bell": true,
    "volume": "+20%"
};
return msg;

When triggered, your iHost speaker chimes and speaks the message clearly!


Method B: Play Night-Time Gentle Alert (Node-RED Example)

Speak quietly without a wake-up chime:

msg.payload = {
    "text": "Living room lights turned off. Good night!",
    "bell": false,
    "volume": "-20%",
    "rate": "-5%"
};
return msg;

Method C: Stream to External Speakers or Home Assistant

If you want to play announcements on external DLNA speakers, Sonos, or through Home Assistant’s media_player.play_media service, use a simple GET request:

http://ihost.local:8123/api/tts?text=Welcome+home&lang=en&bell=true

In Home Assistant:

service: media_player.play_media
target:
  entity_id: media_player.living_room_speaker
data:
  media_content_id: "http://ihost.local:8123/api/tts?text=Front+door+opened&bell=true"
  media_content_type: "music"

:house: Home Assistant Integration (Plug-and-Play MaryTTS)

Clean TTS emulates the native Home Assistant MaryTTS protocol out of the box. No HACS or custom integrations required!

1. Add to configuration.yaml:

tts:
  - platform: marytts
    host: "<clean-tts-host>" # IP or hostname of your Clean TTS server or Sonoff iHost
    port: 8123
    voice: "en-US-JennyNeural" # Alt: en-US-GuyNeural, en-US-AriaNeural, en-GB-SoniaNeural, en-GB-RyanNeural
    codec: "WAVE_FILE" # Or "MP3"
    cache: false # Optional: set false to prevent Home Assistant from caching dynamic speech locally

Restart Home Assistant to apply the configuration.

2. Use in Automations or Developer Tools:

action: tts.speak
target:
  entity_id: tts.marytts
data:
  media_player_entity_id: media_player.living_room_speaker
  message: "Living room temperature is 22 degrees."

Or using the legacy tts.marytts_say service:

action: tts.marytts_say
target:
  entity_id: media_player.living_room_speaker
data:
  message: "Attention, the front door has been opened."

Clean TTS applies your phonetic dictionary corrections, loudness normalization, and chime bell automatically!


:laptop: Quick cURL Examples for Testing

Speak on iHost Speaker:

curl -X POST http://ihost.local:8123/api/tts \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Washing machine cycle finished.",
    "bell": true,
    "volume": "+10%"
  }'

Urgent Alert (Louder & Faster):

curl -X POST http://ihost.local:8123/api/tts \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Warning! Water leak detected in the bathroom.",
    "bell": true,
    "volume": "+40%",
    "rate": "+15%"
  }'

:mobile_phone: Web Dashboard Overview

Access http://ihost.local:8123 from any browser on your network:

  • :control_knobs: Studio (/): Test any text, preview voices, and adjust global volume and speed sliders.
  • :open_book: Phonetic Dictionary (/dict): Teach Clean TTS how to pronounce tricky local words or smart home brands with instant audio preview.
  • :package: Backup & Restore (/backup): Download a full ZIP backup of your dictionaries and settings with 1 click.
  • :globe_with_meridians: Languages (/languages): Switch between English, Romanian, French, German, Spanish, Italian, and Catalan.
  • :robot: AI Agent Hub (/mcp): Connect AI assistants like Claude Desktop to control speech hands-free.

Salve a tutti, ho provato, ho aggiunto il token, tutto sembra funzionale sul browser di prova del PC ma quando metto l’altoparlante del ihost non esce alcun audio ed esce una scritta in basso a destra che dice *audio accodato e in riproduzione sul dispositivo host" ma, ripeto, dal ihost non esce alcun suono neanche quello della campana

### :envelope: Răspuns în Italiană:

Ciao!

Il messaggio “audio accodato…” indica semplicemente che Clean TTS ha generato l’audio ed è in attesa che l’iHost lo riproduca.

Per far funzionare l’altoparlante, segui questi semplici passaggi:

──────

### 1. Come verificare e rigenerare il Token su Clean TTS:

1. Nella pagina principale di Clean TTS (Studio), scorri in basso fino alla scheda “Sonoff iHost - Physical Speaker”.

2. Controlla il badge di stato:

  • Se vedi ⚠️ Token Missing (arancione), significa che Clean TTS non ha un token valido registrato.                                                                                                   

  • Se vedi ✓ Authorized (Speaker Active) (verde), clicca sul pulsante **🗑️ "Delete"** per cancellare il vecchio token e ripartire da zero.                                                                

3. Genera un nuovo token:

  • Clicca sul pulsante **🔑 "Request from iHost"** (Richiedi da iHost).                                                                                                                                   

  • Vedrai il messaggio *"Waiting for ALLOW..."*.                                                                                                                                                        

  • **Premi il pulsante fisico frontale del Sonoff iHost** (o conferma il pop-up nella dashboard CUBE di iHost) entro 60 secondi.                                                                          

  • Lo stato diventerà verde: ✓ Authorized (Speaker Active).                                                                                                                                           

──────

### 2. Controlla il Volume fisico dell’iHost:

• Accedi alla dashboard principale di Sonoff iHost (CUBE OS).

• Vai su Impostazioni (Settings) ➔ Volume / Altoparlante e assicurati che il volume del dispositivo fisico non sia a 0% o su Muto.

Dopo aver generato il token con il pulsante e verificato il volume, seleziona “Host Device” e premi “Synthesize & Play”: l’altoparlante integrato suonerà subito! :speaker_high_volume:

Ho fatto la procedura che mi hai suggerito, ho controllato tutti i parametri e le impostazioni sul ihost ma non è cambiato niente:
Non esce alcun audio dal altoparlante (sul browser del PC si) e esce sempre la solita scritta sulla destra.


Non smettere mai di capire

If the volume in iHost is set to 20%, the messages are very quiet. Adjusting the volume in the message doesn’t help.

{
“text”: “TEST”,
“bell”: true,
“volume”: “+100%”,
“rate”: “+15%”,
“nocache”: “true”
}

Aggiorna all’ultima versione (v1.3.0). Ora troverai direttamente nella schermata principale (sotto il cursore del volume audio) un nuovo slider dedicato al volume hardware dell’altoparlante iHost con salvataggio automatico.

Assicurati inoltre che il Token iHost sia generato correttamente per permettere all’add-on di sbloccare e controllare l’altoparlante.

Update to the latest version (v1.3.0). There was a distinction needed between audio generation volume and hardware amplifier volume:

• “volume” (+100%) controls only the loudness of the generated MP3 file. • We have added a new hardware volume slider directly on the main UI, plus an optional API parameter “ih_volume”: 80 (0–100) to control the physical iHost speaker volume directly in the payload:

{
“text”: “TEST”,
“bell”: true,
“ih_volume”: 100,
“volume”: “+0%”,
“rate”: “+15%”
}

Ciao,
Ho aggiornato l’app, ho eliminato il vecchio token del ihost e ne ho generato uno nuovo, ho messo i volumi come puoi vedere, sull’altoparlante del PC tramite browser si sente il messaggio, sull’altoparlante della ihost no
Esce sempre la solita scritta che vedi in basso a destra

Allegro screenshot


Non smettere mai di capire

Il problema è quasi sicuramente la modalità di rete del container Docker su iHost. Se il container è stato creato in modalità bridge, l’altoparlante integrato di iHost non può comunicare con il container audio. Per risolvere:

  1. Ferma ed elimina il container Clean TTS attuale da Docker su iHost (tranquillo, i tuoi file e dizionari rimarranno intatti se hai mappato la cartella /data).
  2. Crea/avvia nuovamente il container assicurandoti di selezionare Network Mode: host (NON bridge). In modalità host, la porta è automaticamente la 8123.
  3. Riapri http://ihost.local:8123 e fai una prova di riproduzione.

Ciao, l’ho già creato in modalità HOST sin da subito


Non smettere mai di capire

Ora funziona!

Ho scaricato la nuova versione questa mattina e ho disattivato il pulsantino con la nota sopra l’ihost fisico :+1:

Hello tmalex!

Until now, the files playable on the i-HOST—for instance, in automated scenes—were in WAV format and were selected from a drop-down list on the TTS2CUBE-Pico platform.

However, it appears that Clean TTS Studio generates files in MP3 format.

If I want to use a file generated by Clean TTS Studio in an automated scene, how should I proceed? I cannot find a quick and easy way to select any of the generated files for use in an i-HOST automated scene.

The only method I can think of is: 1. Export the MP3 file, 2. Convert it to WAV, and 3. Upload it to the i-HOST using the Docker add-on named “erdidd/ewelink-ed-download-sounds”.

Is there another way?

Thanks.
Regards.

Update to the latest version (1.3.1). You don’t need to worry about audio files at all, handling files is internal work done automatically in the background. Unlike pico-tts which is very rigid, this service dynamically generates and plays both static and live dynamic speech on the fly. You don’t even need to copy-paste the flow manually anymore. Just open the Help page on your iHost (http://ihost.local:8123/help), scroll to the Node-RED section, and click “1-Click Import to Node-RED”. It will automatically install the Clean TTS Speaker subflow and test flow directly into your Node-RED. Everything is documented right there. I also recommend using the built-in MCP server with a local AI desktop agent for effortless setup and control. You can also give the Docker Hub link to any online AI (like ChatGPT or Claude) if you need extra guidance, as everything is thoroughly documented.