www.homeseer.com    
 

Go Back   HomeSeer Message Board > Ultilities (Plug-ins) > Utilities Discussion > Tasker Plugin (3P)

Tasker Plugin (3P) Discussions related to the Tasker plugin by Tonlof.

Reply
 
Thread Tools Display Modes
  #1  
Old December 11th, 2016, 12:03 AM
fcol's Avatar
fcol fcol is offline
Seer
 
Join Date: Dec 2016
Location: CA
Posts: 29
Tasker TTS with sound

I'm brand new to Tasker (and HS). I somehow managed to get Tasker to speak text on an old Android phone. However, I can't figure out how to get it play any sounds using the HS3 SAY task. My understanding is that adding <alarm> or <system> should play a sound that is built into the phone (see photo 1). I don't know how to select those sound files. When I go into Task Edit (see photo 2), I see red vertical bars which I am guessing means that something needs to be defined. But when I go into Action Edit, I don't see anything that would allow me to define a sound file.

I was able to create a test Task with Action-Notify Sound. This let me pick a Sound File and plays that sound.

I'm totally missing something
Attached Images
  
Reply With Quote
  #2  
Old December 11th, 2016, 04:46 AM
tonlof's Avatar
tonlof tonlof is offline
Seer Master
 
Join Date: Apr 2001
Location: Nordic
Posts: 1,429
Hi Fcol, welcome aboard.

SAY task can only be used for Text to speech. The different tags is used to direct the speech to the android mixer. Ex. if you at night have multimedia volume down you can still send alarm message to sound at night etc.
To play a soundfile you need to store it under Tasker/soundfiles and trigger the command by custom command.
Ex. play=yoursoundfile.mp3
or
play=http://static1.grsites.com/archive/sounds/cartoon/cartoon180.wav
When using url it will also save the souldfile under Tasker/soundfiles
__________________
Please excuse any spelling and grammatical errors I may make.
--
Tasker Plugin / Speech Droid
Tonlof | Sweden
Reply With Quote
  #3  
Old December 11th, 2016, 05:30 AM
mastermixlee mastermixlee is offline
Seer
 
Join Date: Dec 2016
Location: United Kingdom
Posts: 9
Hi I have been trying to use the tts service etc and I have followed all the instructions for setting up tasker to connect to the plugin etc.
I can choose my device and the action of 'text to speech' but It doesn't load the extra box for 'set device string to' meaning I can't actually type anything in to send. It doesn't come up the device string box on any of the other commands either e.g. Send custom URL etc.

Am I doing something obviously wrong?

Sent from my ONEPLUS A3003 using Tapatalk
Reply With Quote
  #4  
Old December 11th, 2016, 05:39 AM
tonlof's Avatar
tonlof tonlof is offline
Seer Master
 
Join Date: Apr 2001
Location: Nordic
Posts: 1,429
Quote:
Originally Posted by mastermixlee View Post
Hi I have been trying to use the tts service etc and I have followed all the instructions for setting up tasker to connect to the plugin etc.
I can choose my device and the action of 'text to speech' but It doesn't load the extra box for 'set device string to' meaning I can't actually type anything in to send. It doesn't come up the device string box on any of the other commands either e.g. Send custom URL etc.

Am I doing something obviously wrong?

Sent from my ONEPLUS A3003 using Tapatalk
Hello mastermixlee, this is not related to Tasker plugin only it's a common HS3 advance settings. I guess you have the red icon with a airplane and if you hover it will say advance options. Just click on it and it will open the extra textfield.
Attached Images
 
Reply With Quote
  #5  
Old December 11th, 2016, 06:23 AM
mastermixlee mastermixlee is offline
Seer
 
Join Date: Dec 2016
Location: United Kingdom
Posts: 9
I did wonder what that was but didn't think it was a button lol. Thanks so much for the quick reply!!

Sent from my ONEPLUS A3003 using Tapatalk
Reply With Quote
  #6  
Old December 11th, 2016, 02:26 PM
fcol's Avatar
fcol fcol is offline
Seer
 
Join Date: Dec 2016
Location: CA
Posts: 29
Quote:
Originally Posted by tonlof View Post
To play a soundfile you need to store it under Tasker/soundfiles and trigger the command by custom command.
Ex. play=yoursoundfile.mp3
or
play=http://static1.grsites.com/archive/sounds/cartoon/cartoon180.wav
When using url it will also save the souldfile under Tasker/soundfiles
Thanks! I was able to get sound to play when I used your play=http example (and I see cartoon 180.wav get copied into Tasker/soundfiles). But I can't get it to play the file locally using play=cartoon180.wav. In fact, the test Task I made to play a Notify Sound stops working until I reboot the phone. But once I send the custom code play=cartoon180.wav, then I can't get Tasker to play sounds anymore. I'll find another tablet and see how that works.
Reply With Quote
  #7  
Old December 12th, 2016, 04:53 AM
tonlof's Avatar
tonlof tonlof is offline
Seer Master
 
Join Date: Apr 2001
Location: Nordic
Posts: 1,429
Quote:
Originally Posted by fcol View Post
Thanks! I was able to get sound to play when I used your play=http example (and I see cartoon 180.wav get copied into Tasker/soundfiles). But I can't get it to play the file locally using play=cartoon180.wav. In fact, the test Task I made to play a Notify Sound stops working until I reboot the phone. But once I send the custom code play=cartoon180.wav, then I can't get Tasker to play sounds anymore. I'll find another tablet and see how that works.
Could you check line 10 in tasker TASK PLAY if this line is disabled.
Try to enable it and see if it works better.
Reply With Quote
  #8  
Old December 12th, 2016, 11:09 AM
fcol's Avatar
fcol fcol is offline
Seer
 
Join Date: Dec 2016
Location: CA
Posts: 29
Quote:
Originally Posted by tonlof View Post
Could you check line 10 in tasker TASK PLAY if this line is disabled.
Try to enable it and see if it works better.
That worked - thanks!
Reply With Quote
  #9  
Old December 21st, 2016, 03:57 AM
fcol's Avatar
fcol fcol is offline
Seer
 
Join Date: Dec 2016
Location: CA
Posts: 29
Now I'm trying to script a sound (mp3) followed by TTS:
Code:
Public Sub Main(ByVal Parms As Object) 
hs.PluginFunction("Tasker Plugin", "", "CustomAPI", New Object() {"EvoAR", "PLAY", "meta.mp3"})
hs.waitsecs(2)
hs.PluginFunction("Tasker Plugin", "", "CustomAPI", New Object() {"EvoAR", "SAY ", "Hello this is a message"})
End Sub
I'm seeing this error pop up on the Android phone:
"Error. Music Play: file not found: /storage/sdcard0/Tasker/Soundfiles/%commands2."

I am guessing this means I placed "meta.mp3" in the wrong place (Sorry but I don't have a software background)? After this error pops up, the phone does successfully speak the text.


This may not be related but if I try to play a sound via an Event-Custom Code-play=meta.mp3, then it always gives this error in the HS3 log.

Dec-20 23:26:37 Tasker Plugin Error ----------------------------------------------------------------------
Dec-20 23:26:37 Tasker Plugin Error Connection Error
Dec-20 23:26:37 Tasker Plugin Error ----------------------------------------------------------------------
Dec-20 23:26:37 Tasker Plugin Error Sending local command failed: (192.168.254.122)

Sometimes it successfully plays the sound and sometimes it doesn't play the sound. But it always shows this connection error. If I use the Tasker plug-in Text-to-Speech field, then that seems to work fine (no connection errors). But playing the sound (via custom code play=) is very inconsistent. This is why I am trying the script since I don't see the connection error when running a script for the Tasker Plugin. I do have remote access for MyHS enabled (although I really would rather not since I prefer to keep all Home Automation traffic on my LAN).
Reply With Quote
  #10  
Old December 21st, 2016, 04:17 AM
tonlof's Avatar
tonlof tonlof is offline
Seer Master
 
Join Date: Apr 2001
Location: Nordic
Posts: 1,429
Hi, try
PHP Code:
hs.PluginFunction("Tasker Plugin""""CustomAPI", New Object() {"EvoAR""PLAY=meta.mp3"""})
and if 
you need both 
hs
.PluginFunction("Tasker Plugin""""CustomAPI", New Object() {"EvoAR""PLAY=meta.mp3 SAY""Hello this is a message"}) 
Your phone wifi may go to sleep and does not respond on wifi and thats why you get connection error. The plugin try to make several local connection if local ip is added to the android device, if no local connection it will send the command through cloud.
Reply With Quote
  #11  
Old December 21st, 2016, 05:18 AM
mikee123 mikee123 is offline
Seer Master
 
Join Date: May 2016
Location: London
Posts: 1,061
Quote:
Originally Posted by tonlof View Post
The plugin try to make several local connection if local ip is added to the android device, if no local connection it will send the command through cloud.
A little off topic, but I quite often have delayed TTS messages, sometimes by a few minutes.

I very often have errors similar to this in my log:


Dec-20 23:26:37 Tasker Plugin Error ----------------------------------------------------------------------
Dec-20 23:26:37 Tasker Plugin Error Connection Error
Dec-20 23:26:37 Tasker Plugin Error ----------------------------------------------------------------------
Dec-20 23:26:37 Tasker Plugin Error Sending local command failed: (192.168.254.122)


would that explain the delays, that tasker unsuccessfully tries to connect locally, then goes via the cloud ?
My tablets are wall mounted and connected to my wifi to permanently display cameras, and they never loose connection but tasker still shows this error in the HS3 logs
Reply With Quote
  #12  
Old December 21st, 2016, 12:09 PM
fcol's Avatar
fcol fcol is offline
Seer
 
Join Date: Dec 2016
Location: CA
Posts: 29
Quote:
Originally Posted by tonlof View Post
Hi, try
PHP Code:
hs.PluginFunction("Tasker Plugin""""CustomAPI", New Object() {"EvoAR""PLAY=meta.mp3"""})
and if 
you need both 
hs
.PluginFunction("Tasker Plugin""""CustomAPI", New Object() {"EvoAR""PLAY=meta.mp3 SAY""Hello this is a message"}) 
Your phone wifi may go to sleep and does not respond on wifi and thats why you get connection error. The plugin try to make several local connection if local ip is added to the android device, if no local connection it will send the command through cloud.
Thanks - this code does work. But there's something screwy with my setup. When I first tried the new script, it would only play the sound and not play the TTS. I tried the SAY command by itself (using script method and using Tasker plugin built-in Event Text-to-Speech) and it still wouldn't do TTS. I tried many combinations but it would only play sound. After opening Tasker on the phone, then it would play both sound and TTS.

The PLAY command always generates that Connection Error. If I change the script to only contain the SAY command, then there's no Connection Error. (Even when the phone wasn't playing the TTS, the HS3 log showed no Connection Error). I guess there's something going on with Tasker on the phone. I was having trouble with Pushover and using Tasker to convert Pushover notifications to TTS. The Pushover notifications always played their sound. But Tasker would only play the TTS sometimes.

I'm pretty sure my WiFi is not asleep since 1) it receives Pushover traffic 100% and 2) I have this same problem (with Tasker TTS) when using microUSB-to-ethernet. I've been using the app Phone Schedule to auto-launch Tasker and AutoRemote every hour and that seems to help but I think I need to auto-launch more often (every 15 min?). The HTC Evo phone is running Android 4.1.1. Perhaps it is aggressively shutting down Tasker or other background tasks? But that wouldn't explain why Pushover always works.
[Sorry if this is off-topic for the Tasker HS3 plugin - I suppose I could move to an Android Tasker forum? But perhaps other people are having trouble with TTS and HS3...]
Reply With Quote
  #13  
Old December 21st, 2016, 01:25 PM
fcol's Avatar
fcol fcol is offline
Seer
 
Join Date: Dec 2016
Location: CA
Posts: 29
Quote:
Originally Posted by fcol View Post
Perhaps it is aggressively shutting down Tasker or other background tasks? But that wouldn't explain why Pushover always works.
After some research, it seems like this phone (and many phones) might have power saving features that interfere with network connections. But Google Cloud Messaging (GCM) is exempt from these power saving features and therefore will allow services like Pushover to work. I don't think this explains why Android Tasker SAY command isn't speaking the Pushover messages half of the time (since I think the Android Tasker app should just be running locally on the phone and shouldn't care about a network connection).
Reply With Quote
  #14  
Old December 21st, 2016, 03:34 PM
tonlof's Avatar
tonlof tonlof is offline
Seer Master
 
Join Date: Apr 2001
Location: Nordic
Posts: 1,429
If you are using Android 6 or later, be sure that power saving is disabled for Tasker, Autoremote or any other 3rd part tts engine.
Reply With Quote
  #15  
Old December 21st, 2016, 03:39 PM
fcol's Avatar
fcol fcol is offline
Seer
 
Join Date: Dec 2016
Location: CA
Posts: 29
I'm using Ivona on Android 4.1.1 and 4.4.2. I don't see a way to turn off power saving for Ivona. But I'll switch to the built-in TTS voice. If Ivona is going to sleep, then this would explain why other non-TTS Tasker events are working but the TTS doesn't always work. Thanks!
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Tasker TTS cpd5899 Tasker Plugin (3P) 5 February 29th, 2016 03:42 PM
VR with Tasker cpd5899 Tasker Plugin (3P) 1 February 6th, 2016 06:10 PM
Tasker wljohnson05 Tasker Plugin (3P) 8 August 23rd, 2014 02:53 PM
Looking for a sound recognition device (not voice, sound) BootsC5 General Home Automation Hardware Discussion 13 March 4th, 2008 12:22 AM
Sound on ALL sound cards...?? drozwood90 HS2 / HSPRO 3 February 7th, 2007 08:28 PM


All times are GMT -4. The time now is 05:37 AM.


Copyright HomeSeer Technologies, LLC