WebCoRE asks a question, my voice response determines the action

text-to-speech
answer
query
voice
alexa

#178

From the abbreviated log, it looks like you did not respond with either Yes or No…
so the final block (lines 54-62) was executed.

According to the log, Echo should have said, “Sorry to bug you”…

pic

If that did not happen, I would first check the volume on that Echo. If the volume was already turned up, then I would test a simple “Speak” test in a new piston. Echo Speaks is notorious for loosing connection to your SmartHome.

After testing a new (single block) piston, if Echo Speaks is currently not working for you, please consult a previous thread or create your own… There are a ton of “Speech-to-text” threads out there already, and I would prefer to keep this page focused on the logic I have above.

Thank you.


#179

If your issue is not speech related, please turn on Trace to show more information in a new green snapshot… Plus, as @Terminal mentioned, we’d need to see a FULL log… (pure text is OK) showing the first event, the wait, and the final actions.


#180

So the reason I didn’t respond with yes or no is because the question doesn’t get asked so I have no idea when to say anything - all I get is the spoken text at the end indicating I didn’t answer. Copying the logs here:

3/6/2020, 9:04:20 AM +112ms
+0ms ╔Received event [Home].time = 1583503461959 with a delay of -1848ms
+120ms ║RunTime Analysis CS > 33ms > PS > 63ms > PE > 25ms > CE
+124ms ║Runtime (40416 bytes) successfully initialized in 63ms (v0.3.110.20191009) (122ms)
+125ms ║╔Execution stage started
+146ms ║║Comparison (enum) off is (string) on = false (1ms)
+147ms ║║Condition #7 evaluated false (9ms)
+149ms ║║Condition group #6 evaluated false (state did not change) (12ms)
+159ms ║║Comparison (enum) off is (string) on = false (1ms)
+161ms ║║Condition #11 evaluated false (9ms)
+163ms ║║Condition group #10 evaluated false (state did not change) (10ms)
+176ms ║║Comparison (enum) off is (string) off = true (2ms)
+179ms ║║Comparison (enum) off is (string) off = true (2ms)
+181ms ║║Condition #15 evaluated true (15ms)
+182ms ║║Condition group #14 evaluated true (state did not change) (17ms)
+186ms ║║Cancelling statement #16's schedules...
+689ms ║║Executed physical command [Echo - Mancave Echo Dot].playTextAndResume([Sorry to bug you]) (494ms)
+690ms ║║Executed [Echo - Mancave Echo Dot].playTextAndResume (497ms)
+693ms ║╚Execution stage complete. (568ms)
+695ms ╚Event processed successfully (694ms)
3/6/2020, 9:04:06 AM +760ms
+1ms ╔Received event [Mancave Occupied].switch = on with a delay of 484ms
+94ms ║RunTime Analysis CS > 17ms > PS > 56ms > PE > 21ms > CE
+97ms ║Runtime (40419 bytes) successfully initialized in 56ms (v0.3.110.20191009) (94ms)
+97ms ║╔Execution stage started
+104ms ║║Comparison (enum) on changes_to (string) on = true (1ms)
+105ms ║║Cancelling condition #2's schedules...
+106ms ║║Condition #2 evaluated true (5ms)
+107ms ║║Cancelling condition #1's schedules...
+107ms ║║Condition group #1 evaluated true (state changed) (6ms)
+109ms ║║Cancelling statement #3's schedules...
+192ms ║║Executed physical command [Echo - Mancave Echo Dot].playText([Do you want to turn on the TV?, 80]) (76ms)
+193ms ║║Executed [Echo - Mancave Echo Dot].playText (78ms)
+197ms ║║Executed virtual command [Echo - Mancave Echo Dot].wait (1ms)
+198ms ║║Requesting a wake up for Fri, Mar 6 2020 @ 9:04:21 AM EST (in 15.0s)
+202ms ║╚Execution stage complete. (104ms)
+203ms ║Setting up scheduled job for Fri, Mar 6 2020 @ 9:04:21 AM EST (in 14.997s)
+210ms ╚Event processed successfully (209ms)
3/5/2020, 11:21:05 PM +505ms
+2ms ╔Received event [Mancave Occupied].switch = off with a delay of 1506ms
+112ms ║RunTime Analysis CS > 27ms > PS > 64ms > PE > 20ms > CE
+114ms ║Runtime (40421 bytes) successfully initialized in 64ms (v0.3.110.20191009) (111ms)
+115ms ║╔Execution stage started
+121ms ║║Comparison (enum) off changes_to (string) on = false (1ms)
+122ms ║║Condition #2 evaluated false (4ms)
+123ms ║║Condition group #1 evaluated false (state did not change) (5ms)
+124ms ║╚Execution stage complete. (9ms)
+125ms ╚Event processed successfully (125ms)
3/5/2020, 11:05:37 PM +229ms
+2ms ╔Received event [Mancave Occupied].switch = on with a delay of 162ms
+85ms ║RunTime Analysis CS > 18ms > PS > 49ms > PE > 18ms > CE
+88ms ║Runtime (40418 bytes) successfully initialized in 49ms (v0.3.110.20191009) (85ms)
+88ms ║╔Execution stage started
+94ms ║║Comparison (enum) on changes_to (string) on = false (1ms)
+95ms ║║Condition #2 evaluated false (4ms)
+96ms ║║Condition group #1 evaluated false (state did not change) (4ms)
+97ms ║╚Execution stage complete. (9ms)
+98ms ╚Event processed successfully (98ms)

#181

Thanks for the logs and clarification. It looks like your current log does not match the piston you posted. (probably because you are making changes). It appears that you used different “speak” commands for the question (playText, which failed) and the spoken text at the end (playTextAndResume, which worked).

Perhaps make them both the same


3/6/2020, 9:04:06 AM =  (failed command)
[Mancave Occupied].switch = on
Condition group #1 evaluated true
Executed physical command [Echo - Mancave Echo Dot].playText([Do you want to turn on the TV?, 80])
Setting up scheduled job for Fri, Mar 6 2020 @ 9:04:21 AM EST (in 14.997s)

3/6/2020, 9:04:20 AM =  (working command)
Received event [Home].time = 1583503461959
Comparison (enum) off is (string) off = true  (Yes is off)
Comparison (enum) off is (string) off = true  (No is off)
Condition #15 evaluated true
Executed physical command [Echo - Mancave Echo Dot].playTextAndResume([Sorry to bug you])

#182

Okay we are making progress! I’m getting the question asked now but when I respond with “echo yes” (echo is my trigger word), she responds “sorry I don’t know that one”. Here is the log:

3/6/2020, 1:42:23 PM +778ms
+1ms ╔Received event [Home].execute = 35.199.11.29 with a delay of 91ms
+93ms ║RunTime Analysis CS > 17ms > PS > 49ms > PE > 27ms > CE
+95ms ║Runtime (40423 bytes) successfully initialized in 49ms (v0.3.110.20191009) (94ms)
+96ms ║╔Execution stage started
+105ms ║║Cancelling condition #2's schedules...
+106ms ║║Condition #2 evaluated false (5ms)
+107ms ║║Cancelling condition #1's schedules...
+108ms ║║Condition group #1 evaluated false (state changed) (9ms)
+110ms ║╚Execution stage complete. (13ms)
+110ms ╚Event processed successfully (110ms)
3/6/2020, 1:42:09 PM +284ms
+1ms ╔Received event [Home].time = 1583520130265 with a delay of -981ms
+96ms ║RunTime Analysis CS > 18ms > PS > 51ms > PE > 27ms > CE
+99ms ║Runtime (40423 bytes) successfully initialized in 51ms (v0.3.110.20191009) (98ms)
+100ms ║╔Execution stage started
+116ms ║║Comparison (enum) off is (string) on = false (1ms)
+118ms ║║Condition #7 evaluated false (9ms)
+119ms ║║Condition group #6 evaluated false (state did not change) (9ms)
+127ms ║║Comparison (enum) off is (string) on = false (2ms)
+128ms ║║Condition #11 evaluated false (7ms)
+129ms ║║Condition group #10 evaluated false (state did not change) (8ms)
+140ms ║║Comparison (enum) off is (string) off = true (1ms)
+143ms ║║Comparison (enum) off is (string) off = true (1ms)
+144ms ║║Condition #15 evaluated true (13ms)
+145ms ║║Condition group #14 evaluated true (state did not change) (14ms)
+147ms ║║Cancelling statement #16's schedules...
+591ms ║║Executed physical command [Echo - Mancave Echo Dot].playTextAndResume([Sorry to bug you]) (438ms)
+592ms ║║Executed [Echo - Mancave Echo Dot].playTextAndResume (440ms)
+595ms ║╚Execution stage complete. (495ms)
+596ms ╚Event processed successfully (595ms)
3/6/2020, 1:41:54 PM +710ms
+1ms ╔Received event [Mancave Occupied].switch = on with a delay of 123ms
+71ms ║RunTime Analysis CS > 15ms > PS > 34ms > PE > 22ms > CE
+74ms ║Runtime (40428 bytes) successfully initialized in 34ms (v0.3.110.20191009) (71ms)
+74ms ║╔Execution stage started
+81ms ║║Comparison (enum) on changes_to (string) on = true (1ms)
+82ms ║║Cancelling condition #2's schedules...
+83ms ║║Condition #2 evaluated true (5ms)
+84ms ║║Cancelling condition #1's schedules...
+85ms ║║Condition group #1 evaluated true (state changed) (6ms)
+86ms ║║Cancelling statement #3's schedules...
+549ms ║║Executed physical command [Echo - Mancave Echo Dot].playTextAndResume([Do you want to turn on the TV?, 80]) (455ms)
+549ms ║║Executed [Echo - Mancave Echo Dot].playTextAndResume (457ms)
+553ms ║║Executed virtual command [Echo - Mancave Echo Dot].wait (0ms)
+555ms ║║Requesting a wake up for Fri, Mar 6 2020 @ 1:42:10 PM EST (in 15.0s)
+558ms ║╚Execution stage complete. (484ms)
+559ms ║Setting up scheduled job for Fri, Mar 6 2020 @ 1:42:10 PM EST (in 14.996s)
+567ms ╚Event processed successfully (567ms)
3/6/2020, 1:41:15 PM +751ms
+1ms ╔Received event [Mancave Occupied].switch = off with a delay of 142ms
+108ms ║RunTime Analysis CS > 16ms > PS > 50ms > PE > 41ms > CE
+111ms ║Runtime (40427 bytes) successfully initialized in 50ms (v0.3.110.20191009) (109ms)
+112ms ║╔Execution stage started
+120ms ║║Comparison (enum) off changes_to (string) on = false (1ms)
+122ms ║║Cancelling condition #2's schedules...
+123ms ║║Condition #2 evaluated false (6ms)
+124ms ║║Cancelling condition #1's schedules...
+125ms ║║Condition group #1 evaluated false (state changed) (9ms)
+127ms ║╚Execution stage complete. (16ms)
+129ms ╚Event processed successfully (129ms)
3/6/2020, 1:39:50 PM +394ms
+1ms ╔Received event [Home].time = 1583519991505 with a delay of -1111ms
+153ms ║RunTime Analysis CS > 29ms > PS > 94ms > PE > 30ms > CE
+156ms ║Runtime (40425 bytes) successfully initialized in 94ms (v0.3.110.20191009) (153ms)
+157ms ║╔Execution stage started
+172ms ║║Comparison (enum) off is (string) on = false (2ms)
+173ms ║║Condition #7 evaluated false (7ms)
+174ms ║║Condition group #6 evaluated false (state did not change) (8ms)
+182ms ║║Comparison (enum) off is (string) on = false (1ms)
+183ms ║║Condition #11 evaluated false (7ms)
+184ms ║║Condition group #10 evaluated false (state did not change) (8ms)
+194ms ║║Comparison (enum) off is (string) off = true (1ms)
+196ms ║║Comparison (enum) off is (string) off = true (1ms)
+198ms ║║Condition #15 evaluated true (10ms)
+199ms ║║Condition group #14 evaluated true (state did not change) (11ms)
+201ms ║║Cancelling statement #16's schedules...
+707ms ║║Executed physical command [Echo - Mancave Echo Dot].playTextAndResume([Sorry to bug you]) (500ms)
+708ms ║║Executed [Echo - Mancave Echo Dot].playTextAndResume (502ms)
+711ms ║╚Execution stage complete. (555ms)
+712ms ╚Event processed successfully (712ms)
3/6/2020, 1:39:33 PM +349ms
+1ms ╔Received event [Mancave Occupied].switch = on with a delay of 150ms
+134ms ║RunTime Analysis CS > 43ms > PS > 66ms > PE > 25ms > CE
+137ms ║Runtime (40429 bytes) successfully initialized in 66ms (v0.3.110.20191009) (134ms)
+137ms ║╔Execution stage started
+143ms ║║Comparison (enum) on changes_to (string) on = true (0ms)
+145ms ║║Cancelling condition #2's schedules...
+146ms ║║Condition #2 evaluated true (4ms)
+146ms ║║Cancelling condition #1's schedules...
+147ms ║║Condition group #1 evaluated true (state changed) (6ms)
+149ms ║║Cancelling statement #3's schedules...
+3148ms ║║Executed physical command [Echo - Mancave Echo Dot].playTextAndResume([Do you want to turn on the TV?, 80]) (2992ms)
+3150ms ║║Executed [Echo - Mancave Echo Dot].playTextAndResume (2994ms)
+3154ms ║║Executed virtual command [Echo - Mancave Echo Dot].wait (1ms)
+3155ms ║║Requesting a wake up for Fri, Mar 6 2020 @ 1:39:51 PM EST (in 15.0s)
+3159ms ║╚Execution stage complete. (3022ms)
+3160ms ║Setting up scheduled job for Fri, Mar 6 2020 @ 1:39:51 PM EST (in 14.997s)
+3168ms ╚Event processed successfully (3168ms)
3/6/2020, 1:39:25 PM +517ms
+1ms ╔Received event [Mancave Occupied].switch = off with a delay of 110ms
+79ms ║RunTime Analysis CS > 17ms > PS > 40ms > PE > 21ms > CE
+81ms ║Runtime (40428 bytes) successfully initialized in 40ms (v0.3.110.20191009) (79ms)
+82ms ║╔Execution stage started
+88ms ║║Comparison (enum) off changes_to (string) on = false (1ms)
+89ms ║║Condition #2 evaluated false (3ms)
+90ms ║║Condition group #1 evaluated false (state did not change) (5ms)
+92ms ║╚Execution stage complete. (10ms)
+93ms ╚Event processed successfully (93ms)
3/6/2020, 1:39:05 PM +230ms
+1ms ╔Received event [Mancave Occupied].switch = on with a delay of 491ms
+76ms ║RunTime Analysis CS > 17ms > PS > 38ms > PE > 21ms > CE
+174ms ║Runtime (40425 bytes) successfully initialized in 38ms (v0.3.110.20191009) (172ms)
+175ms ║╔Execution stage started
+182ms ║║Comparison (enum) on changes_to (string) on = false (0ms)
+184ms ║║Cancelling condition #2's schedules...
+185ms ║║Condition #2 evaluated false (5ms)
+186ms ║║Cancelling condition #1's schedules...
+187ms ║║Condition group #1 evaluated false (state changed) (8ms)
+189ms ║╚Execution stage complete. (13ms)
+190ms ╚Event processed successfully (190ms)
3/6/2020, 1:38:52 PM +236ms
+0ms ╔Received event [Home].time = 1583519933196 with a delay of -961ms
+113ms ║RunTime Analysis CS > 22ms > PS > 64ms > PE > 28ms > CE
+115ms ║Runtime (40424 bytes) successfully initialized in 64ms (v0.3.110.20191009) (114ms)
+116ms ║╔Execution stage started
+134ms ║║Comparison (enum) off is (string) on = false (2ms)
+135ms ║║Condition #7 evaluated false (8ms)
+136ms ║║Condition group #6 evaluated false (state did not change) (9ms)
+147ms ║║Comparison (enum) off is (string) on = false (2ms)
+148ms ║║Condition #11 evaluated false (8ms)
+149ms ║║Condition group #10 evaluated false (state did not change) (9ms)
+160ms ║║Comparison (enum) off is (string) off = true (1ms)
+162ms ║║Comparison (enum) off is (string) off = true (2ms)
+164ms ║║Condition #15 evaluated true (11ms)
+164ms ║║Condition group #14 evaluated true (state did not change) (13ms)
+167ms ║║Cancelling statement #16's schedules...
+722ms ║║Executed physical command [Echo - Mancave Echo Dot].playTextAndResume([Sorry to bug you]) (547ms)
+723ms ║║Executed [Echo - Mancave Echo Dot].playTextAndResume (549ms)
+725ms ║╚Execution stage complete. (609ms)
+726ms ╚Event processed successfully (726ms)
3/6/2020, 1:38:26 PM +248ms
+2ms ╔Received event [Mancave Occupied].switch = on with a delay of 1329ms
+782ms ║RunTime Analysis CS > 179ms > PS > 211ms > PE > 392ms > CE
+785ms ║Runtime (40434 bytes) successfully initialized in 211ms (v0.3.110.20191009) (782ms)
+786ms ║╔Execution stage started
+794ms ║║Comparison (enum) on changes_to (string) on = true (1ms)
+796ms ║║Cancelling condition #2's schedules...
+797ms ║║Condition #2 evaluated true (6ms)
+799ms ║║Cancelling condition #1's schedules...
+800ms ║║Condition group #1 evaluated true (state changed) (9ms)
+802ms ║║Cancelling statement #3's schedules...
+11941ms ║║Executed physical command [Echo - Mancave Echo Dot].playTextAndResume([Do you want to turn on the TV?, 80]) (11128ms)
+11942ms ║║Executed [Echo - Mancave Echo Dot].playTextAndResume (11130ms)
+11946ms ║║Executed virtual command [Echo - Mancave Echo Dot].wait (1ms)
+11948ms ║║Requesting a wake up for Fri, Mar 6 2020 @ 1:38:53 PM EST (in 15.0s)
+11951ms ║╚Execution stage complete. (11165ms)
+11953ms ║Setting up scheduled job for Fri, Mar 6 2020 @ 1:38:53 PM EST (in 14.996s)
+11961ms ╚Event processed successfully (11961ms)

#183

If you named the SimSwitches as recommended, then this works right out of the box:

  • “Echo, turn on Answer Yes” … or…
  • “Echo, turn on Answer No”

Now there is a trick in Alexa to use a more “friendly phrase”. Originally, I suggested creating Alexa Routines to do that using Yes and No. Since then, Amazon has “reserved” those words. The advice now is to use an alternative word or phrase. (Such as “Yes please” and “No thank you”)


If you are unfamiliar with Alexa Routines, I have more details in my first post above. Look for this section:

pic


#184

Ya beat me to it! I had mine originally built with the simple yes/no responses. But, as you said, since then, Alexa reserved “yes” and “no” for their use. - making those no longer function properly. Now I use “Yes please” and “No thank you” as appropriate. Works just like the original intent.


#185

Ahhh okay - I missed that part so my apologies and thank you for pointing it out. I’ve got it working now! Time to start adding more of them!


#186

While I am thinking of it, I’d like to make a call out to the community:

If anyone can suggest a one syllable word to represent “Yes” and “No”, I would love some ideas and feedback here. My goal is to keep the phrase as short as possible, yet somewhat natural.


I am debating using “True” and “False”. I could reword my questions a bit to match.

IE:
webCoRE asks, “The trash is already at the street… True or false?”
I respond, “Alexa, False”
webCoRE speaks, “Don’t wait too long… There’s a 45% chance of rain in an hour”


Any other mono-syllabic ideas besides “True” and “False”…??


#187

For the record, we can make duplicate Routines in Alexa, that all do the same thing, using a different phrase. It takes a tiny bit extra time to make those extra Routines, but it allows for anyone in the family to use an answer that fits them.

So, for example, let’s say the household has Proper Patricia, Binary Billy, Military Michelle and Surfer Stanley… The following four phrases (Routines) can all turn on “Answer Yes”

  • Alexa, Yes please
  • Alexa, True
  • Alexa, Affirmative
  • Alexa, Far out!

Along the same lines, I could make four Routines to turn on “Answer No”

  • Alexa, No thanks
  • Alexa, False
  • Alexa, Negative
  • Alexa, Gnarly

If we are creative here, the same two SimSwitches can handle many types of questions…
(even beyond the typical Yes/No variety).


If you already have the Routines created (as my first post), then the quickest way to do this is:
Phone > Alexa App > Hamburger menu > Routines > “Alexa, yes please” > Three dot menu >
pic

Then, all you have to do is use a different phrase. I just tested half of these phrases, and they properly turned on the correct SimSwitch. Many other words or phrases will also work, which means that our questions can actually get much more complex. (as long as we keep in mind the 3 possible outcomes)


I’d still love to hear some alternative short phrases, if anyone thinks of any…


#188

My phrases are kind of long but they seem to work. I just tell the person what to say.

I just add the command that needs to be said. My wife can never remember what I tell here to say, so Alexa tells us after the question is asked.

Plus I always make the more common response as the default so you don’t have to say anything.

True and False seems ok to.


#189

Now that I am using Echo Speaks and can determine which Echo device I am talking to, and which device should respond, this opens up a whole new world of possibilities. @WCmore, thank you sir!


#190

I had installed Echo Speaks on my Hubitat hub awhile back but since I am still running my ST hub as a remote to my HE hub, I left most of the Echo speaks stuff on it.

Yesterday I finally moved over the pistons from ST to Hubitat that determine which device you speak to. My ceiling fan routine which generally took about 15 to 20 seconds to respond in ST takes 5 seconds on a Hubitat hub.


#191

Weird…my piston works in about 5 seconds. What does your piston look like?


#192

I thought that delay was because Alexa does not report that info in a timely manner.
(meaning, I thought it was entirely outside of webCoRE’s influence)


#193

There’s a trick to it. If you use getDeviceActivity, it cuts down the time significantly.


#194

Oh right… Different command… Different delay…
(which should be the same in Hubitat, I imagine)


#195

I think we already had this discussion. As I said in the other thread, I call a common piston with getDeviceActivity, then have a global set that the calling piston uses to determine which device. The biggest delay was getting the global updated between pistons. That seems much faster in HE.


#196

This is AWESOME, just what I was looking for for a long while.

I made it work with google home… does anyone know if it is possible to have google listens after it speaks. so i dont have to say the words “hey google”
in webcore i can only see “speak”, if only there was a “listen” option

Thanks alot


#197

I had fun creating this one… Glad you got some use out of it too!


Not that I know of. (although it is always listening for the “wake words”)