Page 1 of 1

tts

Posted: Tuesday 16 July 2019 21:13
by pvklink
hi, i made a script for playing tts commands.
When i execute the url in a browser it works!
But in dzvents when i activate switch test i get:

2019-07-16 21:12:33.752 Error: dzVents: Error: (2.4.26) speak: response: 0 ==>>
2019-07-16 21:12:33.802 Error: Error opening url: http://api.voicerss.org/?key=<i removed this api key>8&hl=nl-nl&src=hallo iedereen!



Code: Select all

local response = "sound_response"

return {
    on =        {       
                	    devices         =   {'test'},    
                        httpResponses   =   {  response } 
                },                         
              
    logging =   {       level   =   domoticz.LOG_ERROR,      
                        marker  =   "speak" },                                           

    execute = function(dz, item,info)

            local url = "http://api.voicerss.org/?key=<i removed this api key>8&hl=nl-nl&src=hallo iedereen!"               
            dz.openURL({url = url,method = "GET",callback = response})
    end
}

Re: tts

Posted: Tuesday 16 July 2019 21:25
by pvklink
Alo tried this script...
2019-07-16 21:24:14.266 Error: Error opening url: http://api.voicerss.org/?key=<apikey>&h ... &src=hallo iedereen


return {
on = {
devices = {'test'},
},

logging = { level = domoticz.LOG_ERROR,
marker = "speak" },

execute = function(dz, item,info)

dz.openURL('http://api.voicerss.org/?key=<apikey>8& ... &src=hallo iedereen!')

end
}

Re: tts

Posted: Tuesday 16 July 2019 23:13
by waaren
pvklink wrote: Tuesday 16 July 2019 21:25 Also tried this script...
can you try

Code: Select all

return {
    on =        {       
                	    devices         =   {'test'},    
                },                         
              
    logging =   {       level   =   domoticz.LOG_ERROR,      
                        marker  =   "speak" },                                           

    execute = function(dz)
            local text = dz.utils.urlEncode('hallo iedereen!')
            dz.openURL('http://api.voicerss.org/?key=<apikey>8&hl=nl-nl&src=' .. text)            
    end
}


Re: tts  [Solved]

Posted: Wednesday 17 July 2019 10:02
by pvklink
yes, no errors. But i have to find another solution to let my rpi speak..
This solution works in an active webbrowser, but not from the commandline..
i installed tts and espeak but then my google assistant does not work anymore on the rpi...
going to google