Announcement

Collapse
No announcement yet.

Alexa TTS that works better (IMHO) than the solution for Home Assistant.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • LeeIII
    replied
    Originally posted by mr.Magoo View Post
    OK, so there's many ways to skin a cat and I personally find this better than the solution for HomeAssistant and better than the ChromeCast Plugin ( it is for me, not here to start a debate). While I got HomeAssistant kind of, sort of working semi well I had issues with cookies and the interface (or lack there of) was limiting.
    Chromecast works beautifully on a Google Home, but I'm stuck in the Amazon echo-system and using it for announcements having both in a box kind of works but the sound quality is poor and there's a long delay, so...

    This solution requires Node-Red
    Maybe you can port it, but then again, a PI Zero W is $5 so it's hardly worth the hassle even if you'd only run this application.
    I find myself using it as a DB Writer between Homeseer and InfluxDB, I use it to pull weather from DarkSky, I have one as a 1W interface, etc. etc. so there's a lot of usages for it.
    ...


    CELEBRATION! I've been able to successfully get this up and running after about half a day of poking around and learning a LOT!

    My Observations:
    1. Installation of node.js / installing node-red and the related alexa remote packages were pretty straight forward but the overall concept was not very well explained. Guess that's how we all learn - by trial and error.
    2. The step by step was helpful - especially for the process of saving the authentication cookie.
    3. MQTT is serious overkill if all you want to do is simply get TTS to work over Alexa devices. it requires an HS3 plugin for mcsMQTT and also would require a MQTT broker (mosquittto) which again is a lot of churn for little gain. Maybe I'll see a use for that if I expand out IoT more significantly in the future.
    4. An easier way to implement without MQTT is to setup a set some HTTP IN nodes in node-red that do the same and simply direct what you need into speech routines - this can be done elegantly and simply inside HS3 also with basic URL calls.
    5. Alexa SSML and the Polly (Ivona voices) that they acquired are really fun to play with. Joey used to be my HomeSeer voice and now he is back to complement Alexa for around the house.
    6. Last observation after experimenting is that I am 100% confident that code could be implemented as a HS4 plugin that would expose the same functions and would eliminate a lot of complexity and overhead of setting up node.js / node-red / and the other packages to extend what people have been asking for from HS regarding Alexa integrations. (Wonder if HomeSeer is considering this for the next wave?).

    Good stuff overall though, and many thanks to Mr. Magoo and everyone else that has contributed pieces to make this work. My house is talking to me again after several of the speaker clients and remote media PC's had been deprecated by the use of FireTV and AppleTV devices and a dozen Amazon Echo's scattered throughout the house.

    ---Lee III

    Leave a comment:


  • Furious
    replied
    What do you need to know?

    Leave a comment:


  • thomauto@aol.com
    replied
    Originally posted by Furious View Post
    Ok, so I've started putting in flows in node-red as homeseer PI replacements as some of the PIs do tend to hit the cpu.


    Notifications for fire TV - bit "fun" that one - tried to natively construct a multipart HTTP post with file in node-red, but couldn't - it seems the "filename" form name conflicts with the internal processing of the http request module, so stops the post from working.
    So, after failing with JS, I decided to leverage the notify python used by home assistant. Using pynodered, created a function and now its a node within node-red. Hey presto, near instant notifications with a jpg from the front door cam if needed.
    How can I get more info on notifications to fire Tv?

    Leave a comment:


  • Furious
    replied
    Ok, so I've started putting in flows in node-red as homeseer PI replacements as some of the PIs do tend to hit the cpu.

    BLLAN - uninstalled and created a flow that sets virtual devices - even having logic to alert based on if the latency is too high. This saved around 5-10% cpu, as its very cpu intensive especially if you want to ping often.
    HA bridge - completely replaced using the alexa nodes.
    Notifications for fire TV - bit "fun" that one - tried to natively construct a multipart HTTP post with file in node-red, but couldn't - it seems the "filename" form name conflicts with the internal processing of the http request module, so stops the post from working.
    So, after failing with JS, I decided to leverage the notify python used by home assistant. Using pynodered, created a function and now its a node within node-red. Hey presto, near instant notifications with a jpg from the front door cam if needed.

    Now that I've got pynodered, this opens up way more doors as I can leverage homeassistant stuff. Next on the agenda is ADB control which doesn't rely on shelling and taking 5 seconds to spin up.

    Leave a comment:


  • Furious
    replied
    Wow. I was looking into other things to do and that looks like something I can tinker with.

    Any more nuggets you care to share?

    Leave a comment:


  • mr.Magoo
    replied
    Thanks - glad you like it !


    SSML is pretty fun to play with and the ability to trigger things based of the "Alexa Event" node is pretty neat.

    For other that are not convinced yet and just reading... Alexa Event is a trigger that get's fired on any type of Alexa activity and you can use data such as what was said, when, which device, etc. to trigger additional actions.

    Another Node that you may want to look into is "Alexa Local" - https://flows.nodered.org/node/node-...ib-alexa-local
    This allows you to set up a "virtual" device in Node Red that is recognized by Alexa as a smart home device and you can either have it trigger things directly - or - when you combine the two (Alexa Local and Alexa Event) you can use it to make the triggering room sensitive in a way not too different from Alexa's own Group/Lights function (but more powerful / flexible).

    i.e. you combine the room from Events with the device from Local and let that control whatever it is you'd like to control

    Leave a comment:


  • Furious
    replied
    Just a thank you for introducing me to node red. Took the plunge and just installed node.js and node red on my windows HS server, and boy is it quick and barely uses any resources.

    The Alexa TTS is way quicker than running a batch file, and it was a bit awkward getting it to work for the UK - the settings I had to use were:
    Service host: layla.amazon.co.uk
    Page: alexa.amazon.co.uk
    Language: en-GB

    Loving the way node red works - I've converted a few scripts to flows, and made it run a MQTT server that speaks or sends notifications near instantly.
    It even allows control of harmony stuff with the pallette package, which I'm now playing with

    Leave a comment:


  • thomauto@aol.com
    replied
    Thanks, I will import your flow again and do some trials.

    mr.Magoo
    EDIT: I didn't have the first flow loaded in Node-Red! After I did that I was able to send a TTS message to one of my echos! Now the fun begins. Thank you.

    Leave a comment:


  • mr.Magoo
    replied
    Which flow are you using ?
    Mine or something else?

    Which MQTT method in HomeSeer are you using ?


    [EDIT]

    OK, so, the alexa nodes in node-red does not read MQTT by default, so you can't just pass the MQTT data directly into one of them and expect it to work.

    You have to parse/split the message up into a friendlier format which is what my flow does (1st post).
    Copy it from that post and paste it into a new flow, add your account info and modify the MQTT listener and you should be good to go.

    Click image for larger version

Name:	Untitled.png
Views:	1627
Size:	23.6 KB
ID:	1325977
    Click image for larger version

Name:	Capture2.PNG
Views:	1567
Size:	16.5 KB
ID:	1325978

    Leave a comment:


  • thomauto@aol.com
    replied
    Originally posted by thomauto@aol.com View Post
    I got to this to work! Have you messed with the SSML modes any? I would like to use the the whisper mode but haven't had any luck.

    Mike
    I'm able to have alexa speak by manual triggering it in node-red but not having any luck through mqtt. I setup a mqtt input and i can see it in the debug messages but i cant pass or trigger tts. Any advice?

    new to node-red and somewhat new to mqtt.

    Leave a comment:


  • mr.Magoo
    replied
    Just tested it and it works fine...

    I you do anything by volume and get an "unexpected response while getting volume:" then that's thrown me off in the past.

    What the code does is that it will first read the current volume, then set the desired volume, do whatever it is you're asking it to do (speak, announce, whisper...) and then restore the volume back to the original setting.

    However, the part where it is reading the current volume is reading a section of the media handling and if you haven't played any media in a while it's "forgotten" and everything is blank and as a result the Node gets a bit upset... the quick and dirty way to remedy this is to simply have Alexa play some tunes for a second or two so that her memory gets restored.

    Leave a comment:


  • mr.Magoo
    replied
    Yes I'm using it, my flow (posted in the first post) should work with Whisper if you send it as:
    Alexa/Whisper/Office=Good Morning

    Or - if you're using some other method, just use a function to alter the message:


    msg.texttospeak = '<speak><amazon:effect name="whispered">' + msg.texttospeak + '</amazon:effect></speak>';

    return msg;


    The only thing that doesn't work right now (sadly) is to play stored media, i.e. sound effects etc. Theoretically you should be able to do that with SSML too, but it doesn't work just yet. Playing regular music as normal with Alexa works just fine.

    Leave a comment:


  • thomauto@aol.com
    replied
    I got to this to work! Have you messed with the SSML modes any? I would like to use the the whisper mode but haven't had any luck.

    Mike

    Leave a comment:


  • mr.Magoo
    replied
    Click image for larger version

Name:	Capture.PNG
Views:	5184
Size:	7.5 KB
ID:	1322541

    I've used Lens for debugging a few times so I'm familiar with it - using this setting works for me.
    If you enable the debug flags in NodeRed it should hopefully tell you what's going on.

    Leave a comment:


  • BeePee
    replied
    I use the MQTT Lens software, its a Chrome plugin. Using "ALL" in the Announce. also tried using MQTT from HS3 still no difference. Really puzzling, but not a show stopper.

    Leave a comment:

Working...
X