I gotta say, if we could not adapt (to changing technology), then our SmartHomes would become very dumb, LOL
WebCoRE asks a question, my voice response determines the action
THanks WCmore. I had an idea today that I wanted to add a yes no question to a piston and I had come to the conclusion that I should do it somehow with simulated switches, but had only a vague notion of how I would do it in my head. Just before starting to try and code something up I did a search and well this made things much simpler.
My litter box reminder piston now will ask if we cleaned it, if we say yes then it resets the reminder, if we answer no or donât say anything it tells us the last time it was cleaned.
If ST screws up webcore too bad when they switch over I am going to be .
I changed mine to âAlexa okayâ and âAlexa not nowâ, but I think yours are a bit more natural and memorable. Iâve struggled to ge the family to remember my new phrasing.
With 24 years of Army service, I was tempted to change them to Affirmative and Negative. However, my wife - although very supportive of my military time, was not actually IN the Army and therefor did not appreciate those choicesâŚ
Seems to be working but in my one piston I have setup so far the answer is âYes I didâ, or âNo I did notâ. Since No I did not works if you donât say anything I added the yes answer to my question. Alexa tells you what the yes response is, after the question. I was worried it might take to long but it seems to be working.
Question for the experiencedâŚ
I am trying to create a âmorningâ routine where I start with some music, then move into âGood Morningâ and then my flash briefing.
Unfortunately, Amazon limits music to being the last item on routines, but I want it to be the first, play for 10 mins, then move onto the good morning then flash briefing.
So⌠I tested it out this morning and it was hopping all over the place, what do I need to do to make this work in sequence (once one is over, the next thing happens?):
Do I need a wait between each, or perhaps use a different command?
P.S. Muting is a great tool for the kid that wonât get up with his alarm by saying âEcho, STOPâ. He has to get out of bed to physically turn it off, but by that time he is up (at least so far!).
The music and Flash briefing will just start playing and then move to the next item in the piston. I know that is the case with music and I would assume it is the same for the flash briefing. So You probably need some waits
Great questions Kevin, but it honestly deserves to be in a new topic, since it has absolutely nothing to do with this threadâŚ
Hello,
I just stumbled on this and Iâm really excited about the possibility of it. However, I tried to set up a simple piston to test with and I am having no luck with anything. Initially, it would speak the response for neither a ye sor no answer, but that doesnât even happen anymore. Iâm really not sure what I did wrong because I used the example piston and didnât change much.
You moved the critical WAIT in that piston.
(IE: the WAIT must be AFTER the speak text, to give you time to respond)
You can see the original in my first post here. (Import code: âtj6nv
â)
Side Note:
I am not sure that line 40-42 will do what you want. Normally, we cannot send a âTurn onâ command to a contact sensorâŚ
Thanks - I just adjusted it and will test again when I get home. Even with the wait in the wrong place, I should still hear the question asked, shouldnât I? Because I donât.
Re: line 40-42 - that is a virtual switch for a TV - not sure why it shows as a contact sensor when anonymized.
Well, if Switch 22 changed during the WAIT:
Afterwards, the statement will no longer be true. (the piston will cancel out)
If Switch 22 did not change during the WAIT:
then the âSpeakâ commands on line 34 and line 60 will fire within 10 milliseconds of each other.
Setting your logging level to Full will tell you more.
(both scenarios can be resolved with the WAIT positioned as in my original piston)
Just curious:
Have you been successful with the single command: âSpeak textâ in other pistons?
Iâve never had any problems with the âspeak textâ function in other pistons to answer your question - it always works. I just tested again and still nothing is happening. Here is the updated piston and logs:
I am still learning but your log seems to be showing what is happening after the 15 sec wait. The first line should be something like:
Received event [switch 22].switch = on with a delay of 68ms
The first line in your log is showing received event home.time which is a time event.
What happened after the trigger from switch 22 would seem to be something to look at, but maybe I am missing something
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ââŚ
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.
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.
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)
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])
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)
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: