Remote TTS to RPI3

I have to RPI3 that I use in my house. THe one running HASS is downstairs on a wired network, dedicated to HASS , Mosquito and MQTT bridge so that I can use it with Smartthings as the hub for my Zwave devices.

In kitchen I built a RPI3 connected to a TV and some button that displays google calendars , with the ability to move through the calendar. Pretty good for my family of 6 to see what is going on. I got the idea of indestructible if anyone is interested.

I would like to use google tss component to stream tts to the RPI in the kitchen, but I am strugging with figuring what “sound player” to run on that RPI that will act as a HASS media player to receive the TTS. Any ideas.

Thanks

Maybe use the mpd component?

~Cheers

I have mopidy installed and HASS connected to it, when I send it the TTS url I get gstreamer error on the RPI that is supposed play it.

I get this error in the Mopidy log. I plan on rebuilding this PI over the weekend to start clean. ANy idea on what the Gstreamer error could be. I have googled and no luck so far.

2017-03-30 18:46:07,835 INFO [13925:StreamBackend-3] urllib3.connectionpool: Starting new HTTP connection (1): 192.168.7.19
2017-03-30 18:46:07,854 WARNING [13925:StreamBackend-3] mopidy.stream.actor: Problem looking up http://REDACTED:8123/api/tts_proxy/e4dd1680937fe1ad17d68dc60567e4b79fa886f7_en_-_google.mp3
2017-03-30 18:46:08,366 ERROR [13925:MainThread] mopidy.audio.gst: GStreamer error: gst-stream-error-quark: GStreamer encountered a general stream error. (1)

I use an ugly solution which one HA creates and copies the TTS file to the www directory and then the other HA plays the audio file on omxplayer.

Hi, i have same problem as @faspina. Did you find any solution?

Yes I did , MPD.

sorry but i didnt understand, you reinstall MPD ?
thank you

The error above was from MOPIDY install which should work like MPD with HA but it doesn’t as you can see in the log up there it say mopidy . I uninstalled mopidy and install MPD and it started working.

Hi faspina,

For a project I’m trying to do exactly the same. I want my TTS spoken on another pi. I installed MPD on this second pi, but I’m a bit lost on the next step.

Do you need to change anything in the config file of MPD, or is the standard file enough?
Do I need to change some settings for the speakers? (USB power, and jack)

Any help would be appreciated.

thanks!

Firstly, I put mqtt state stream to help communication between different HA instances. It is very easy, it just publishes all the state changes in HA. I also create a input text and put that on the front end.

input_text:
  saythis:
    name: Speaker Voice
    initial: home assistant available
    max: 500

mqtt_statestream:
  base_topic: mac 

On the TTS pi, I make a mqtt sensor that reads the state change of the input text. I then create an automation that TTS when that sensor changes. Like this

sensor:
  - platform: mqtt
    name: saythis
    state_topic: "mac/input_text/saythis/state"
    retain: "true"



automation rpi1_talk:
  alias: rpi1_Talk
  trigger:
    - platform: state
      entity_id: sensor.saythis
  action:
    - service: tts.amazon_polly_say
      entity_id: media_player.speaker
      data_template:
        message: >
                 {{states('sensor.saythis')}}
        cache: true

On the first HA instance, put if you want to automate speech, then you can do this

automation mudopenspeech:
  alias: mud door open speech
  trigger:
    platform: state
    entity_id: binary_sensor.mud_room_door
    to: 'on'
    for:
      minutes: 2
  action:
    - service: input_text.set_value
      data_template:
        entity_id: input_text.saythis
        value: "the mud room door is open"
1 Like

Wow thanks, means I need to run another instance of Home assistance on a second Pi. Have to find out how to do that. I run Hassio on a pi3, and have second pi B+ on which I wanted to do this project.

Is a second HA instance just as simple as changing the port number of this second HA. Or is there more to it?

This is about it, I get my pi to run relays, TTS and also run openvpn (not HA related) for my home network while let my mac HA do all network based stuff, front end / automations, mysql for both HA’s (shared database), Mosquitto (mqtt).