Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


Using a Google Home (or any Chromecast device) to ear (text to speech) messages from Home Center


ilcato

Recommended Posts

If you want to generate an audio message from a scene or virtual device and ear it on a Google Home or a Chromcast device, just do this:

  • configure a server (e.g.: a Raspberry PI) with the following software:

    Please login or register to see this link.

    .
  • add a global variable in Home Center
  • create a simple Home Center scene activated by the variable

 

And then simply put a text string into the variable and ear it play on the audio device.

Expect between 3 to 6 seconds between the variable setting and the audio to play (depending on the various devices involved).

 

 

 

 

  • Thanks 1
Link to comment
Share on other sites

  • 2 months later...

Hi

 

Could you elaborate on this?

 

I've installed google-home-notifier successfully on my raspberry pi, but I can't get it to work with the example.js and I have no idea how to call it from my Home Centre!

Link to comment
Share on other sites

  • 1 month later...
  • Topic Author
  • On 28/7/2017 at 2:41 PM, qedes said:

    Hi

     

    Could you elaborate on this?

     

    I've installed google-home-notifier successfully on my raspberry pi, but I can't get it to work with the example.js and I have no idea how to call it from my Home Centre!

     

    In order to call the notifier I use this Lua scene triggered by a global variable (change the URL according to your configuration):

    Please login or register to see this code.

     

    • Thanks 1
    Link to comment
    Share on other sites

    • 3 months later...
    On 8/29/2017 at 2:04 PM, ilcato said:

     

    In order to call the notifier I use this Lua scene triggered by a global variable (change the URL according to your configuration):

    On 8/29/2017 at 2:04 PM, ilcato said:

    local url = "http://10.0.0.17:8080/google-home-notifier?text="..message:urlEncode() local http = net.HTTPClient()

     

    @ilcato this is exactly the LUA scene i have been looking for.  im curious know if this can be broadcasted onto more than just one google home (multiple) and also you mentioned that you must      "(change the URL according to your configuration)." are you implying that i must enter the IP address's of each google home i want the TTS broadcasted to?  im still quite new to LUA scenes..   

     

     

    Thanks,

     

    Matt

    Link to comment
    Share on other sites

  • Topic Author
  • 29 minutes ago, matt1981 said:

    @ilcato this is exactly the LUA scene i have been looking for.  im curious know if this can be broadcasted onto more than just one google home (multiple) and also you mentioned that you must      "(change the URL according to your configuration)." are you implying that i must enter the IP address's of each google home i want the TTS broadcasted to?  im still quite new to LUA scenes..   

     

     

    Thanks,

     

    Matt

    The URL is the one of your google-home-notifier server. From there you can send messages to all your devices.

     

    Link to comment
    Share on other sites

    @ilcato ive repurposed my Raspberry pi i had used for my ha-bridge.  Im running into some issues how install the first steps concerning the NPM install  "$ npm install google-home-notifier"

     

    Im very familiar when using the raspberry pi command lines, but ive never used NPM before.  you'd you mind telling how you went about setting up the first part of the google listener concerning NPM? 

     

     

    Thanks in advance!

     

    Matt

    Link to comment
    Share on other sites

  • Topic Author
  • 23 hours ago, matt1981 said:

    @ilcato ive repurposed my Raspberry pi i had used for my ha-bridge.  Im running into some issues how install the first steps concerning the NPM install  "$ npm install google-home-notifier"

     

    Im very familiar when using the raspberry pi command lines, but ive never used NPM before.  you'd you mind telling how you went about setting up the first part of the google listener concerning NPM? 

     

     

    Thanks in advance!

     

    Matt

    What's the log of your command?

    Link to comment
    Share on other sites

    i kept getting a few different errors, so i just wiped the micro-SD and started over with new image of raspbian..  less chance of an error popping up later during the install process.  

    Link to comment
    Share on other sites

    14 hours ago, matt1981 said:

    i kept getting a few different errors, so i just wiped the micro-SD and started over with new image of raspbian..  less chance of an error popping up later during the install process.  

    I also tried installing it on a raspberry pi 2.

     

    I got it working doing the following steps (trying to use npm/nodejs from debian packages was not working):

     

    1.) Getting latest version of nodejs (version 8) from here:

    Please login or register to see this link.

     (version 9 is not working)

     

    2.) Unpack it and copy bin/* to /usr/local/bin

     

    3.) sudo apt-get install git-core libnss-mdns libavahi-compat-libdnssd-dev

     

    4.)  (as described here 

    Please login or register to see this link.

    )

    git clone

    Please login or register to see this link.

    cd 

    Please login or register to see this link.

    npm install

     

    5.) Patch google-home-notifier/node_modules/mdns/lib/browser.js

     

    6.) I needed to run "npm rebuild" (but maybe because of all the tests before)

     

    7.) npm install google-home-notifier

     

    8.) Modify example.js

     

    This all worked perfect (hopefully, I am not at home right now and don't if there was any output...)

     

    Link to comment
    Share on other sites

    @Alex thanks for break down! this is exactly what i was looking for. the install directions on the github and also on the npm page, for me were a bit vague and ive also never installed a donejs or used npm prior to this.. 

    Link to comment
    Share on other sites

    @matt1981 I hope it will work for you.

    It does work for me.

     

    Link to comment
    Share on other sites

    @Alex do you have both running on the same RPi3? I have a Mac Mini that runs 24/7, but I hopefully can keep it dependent from the Google notifier... Also one last question. Is there anything special that I need to do if it restarts? I guess my question is if they are set to automatically start both services on boot or is there any special lines of code ill need? 

    Link to comment
    Share on other sites

    What do you mean with both? The google-home-notifier and ?

     

    For the restart: I did just add the command line to /etc/rc.local so that is starts after every reboot.

     

    Link to comment
    Share on other sites

    im running to some problems here. included the terminal log from the install and i was able to find the folder with with all the files the node.js installed, but i cant figure out which of the files i need to edit.. any help would be great.

     

     

     

    Last login: Mon Dec 18 18:42:39 on ttys001

    Matthews-Mac-mini:~ TanousFamily$ open afp://192.168.0.33

    Matthews-Mac-mini:~ TanousFamily$ npm install google-home-notifier

     

    > [email protected] install /Users/TanousFamily/node_modules/mdns

    > node-gyp rebuild

     

      CXX(target) Release/obj.target/dns_sd_bindings/src/dns_sd.o

      CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_browse.o

      CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_enumerate_domains.o

      CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_get_addr_info.o

      CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_process_result.o

      CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_ref.o

      CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_ref_deallocate.o

      CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_ref_sock_fd.o

      CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_register.o

      CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_resolve.o

      CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_update_record.o

      CXX(target) Release/obj.target/dns_sd_bindings/src/mdns_utils.o

      CXX(target) Release/obj.target/dns_sd_bindings/src/network_interface.o

      CXX(target) Release/obj.target/dns_sd_bindings/src/socket_watcher.o

      CXX(target) Release/obj.target/dns_sd_bindings/src/txt_record_ref.o

      CXX(target) Release/obj.target/dns_sd_bindings/src/txt_record_create.o

      CXX(target) Release/obj.target/dns_sd_bindings/src/txt_record_deallocate.o

      CXX(target) Release/obj.target/dns_sd_bindings/src/txt_record_set_value.o

      CXX(target) Release/obj.target/dns_sd_bindings/src/txt_record_get_length.o

      CXX(target) Release/obj.target/dns_sd_bindings/src/txt_record_buffer_to_object.o

      SOLINK_MODULE(target) Release/dns_sd_bindings.node

     

    > [email protected] postinstall /Users/TanousFamily/node_modules/ngrok

    > node ./postinstall.js

     

    ngrok - downloading binary

    Please login or register to see this link.

    ngrok - downloading progress: 5350881/5350881

    ngrok - binary downloaded to /Users/TanousFamily/.ngrok/aHR0cHM6Ly9iaW4uZXF1aW5veC5pby9jLzRWbUR6QTdpYUhiL25ncm9rLXN0YWJsZS1kYXJ3aW4tYW1kNjQuemlw.zip

    ngrok - unpacking binary

    ngrok - binary unpacked to /Users/TanousFamily/node_modules/ngrok/bin/ngrok

    npm WARN saveError ENOENT: no such file or directory, open '/Users/TanousFamily/package.json'

    npm notice created a lockfile as package-lock.json. You should commit this file.

    npm WARN enoent ENOENT: no such file or directory, open '/Users/TanousFamily/package.json'

    npm WARN TanousFamily No description

    npm WARN TanousFamily No repository field.

    npm WARN TanousFamily No README data

    npm WARN TanousFamily No license field.

     

    + [email protected]

    added 138 packages in 43.097s

    Matthews-Mac-mini:~ TanousFamily$ var googlehome = require('google-home-notifier')

    -bash: syntax error near unexpectedMatMatMatthewMatthMatthews-MacMattMatthewsMatMattheMaMattMatthewMaMattMaMMMaMMMMMMatthews-Mac-mini:~ TanousFamily$ 

    Please login or register to see this attachment.

    • Like 1
    Link to comment
    Share on other sites

    Edit example.js or make a copy of it and edit this copy (IP/URL, language).

    Run this file (e.g. : node example.js)

     

     

    This part you actually don't need:

    Please login or register to see this code.

    Just use the scene-code posted at the beginning.

     

    You can also test your setup by calling your raspberry pi with this URL ("node <js.file>" must be running at this time at your rasppi):

     curl -X POST -d "text=Hallo Google Home" http://<IP OF YOUR RASPPI>:8091/google-home-notifier

     

     

    Link to comment
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Reply to this topic...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...