New Squeezebox plugin - Request For Comments

So what is the correct way to send TTS to a squeezebox? I checked the wiki and I have implemented http://wiki.micasaverde.com/index.php/Squeezebox#SAD_-_Squeezebox_Server_Announcement_Device but looking at the wiki and different forum posts I see a handful of different ways. I think is this is correct but different from wikie

LMS_Say( '192.168.1.60'               , 
                  9090                           , 
                  '44:8a:5b:25:ff:89'            , 
                  'This%20Is%20A%20Vera'           , 
                  'Announcement'           , 
                  5                              , 
                  'playlist play http://translate.google.com/translate_tts?tl=en&q=Just+a+test',
                  5 )

I go to Apps → Dev Apps → Test and paste it in there and it says “Message set successful” but I get nothing on the squeeze box. I verified it outside of Vera with telnet to 192.168.1.60 9090 and pasting the below and it works.

44:8a:5b:25:ff:89 playlist play http://translate.google.com/translate_tts?tl=en&q=Just+a+test

The wiki says SBS_announcement but the pre-req to it shows LMS_Say.

Also with telnet you can use friendly name of the player or the MAC, I take it the plugin should work that way too?

Not sure what is wrong with my above code, but I changed it just this and it works:

local socket = require( 'socket' )
local client = socket.connect( '192.168.1.60', '9090' )
client:send( 'desktop03_always_on' .. ' ' .. 'playlist play http://translate.google.com/translate_tts?tl=en&q=Welcome+home+chris' .. '\n' )
local res = client:receive()
client:close()
return res

Now to make it work with the VeraAlerts so the voice can be more dynamic and so could the player.

I’ve uploaded the files to my UI5. Do I need to create a device now? What settings do I use in the device then?
I can’t seem to get this plugin working.

@mthomas Yes you have to create the device thirst. Read this thread.

I have created the device. But I get “Device is not ready” on the squeeze player device if I click on any button.
What I 'am doing wrong?
There is a connection a you can see in the screenshot.
Do I have to change something on de squeezebox server of install a plugin on the squeezebox server?

Hey guys,

Just got the app installed an it’s working wonderfully. I have multiple methods to control my Squeezebox, one method is using TCP commands via the CLI using an OpenRemote client. OpenRemote has native support for VeraLite making it easy to implement commands and retrieve data. I have been trying for quite some time to retrieve the next 5-10 tracks in a playlist do display on my user interface on my iOS devices but can’t get it working in OpenRemote. This plugin for the VeraLite could be the trick I need. A couple of questions…

  1. does the app use the CLI subscribe feature?
  2. If so, I assume that when the next track starts it will automatically update the track/artist info, correct?

For a new feature request, I would like to have the app retrieve the nest xx (5-10, or user settable) number of upcoming track info (artist - song) is what I am mainly interested in.

I know a command exists in the CLI to get this data. Would that be possible?

Thanks,
Erik

Guess I missed that part. I’ve read through this thread twice just to make sure I didn’t miss anything before I posted the question. I know it would be geared more toward newbies like me, but it would be nice to have a step by step all included in one post.

I can create the controller, but no players are found.
Maybe my problem is that my LMS has a username and password. How can I add username and pass to the controller?

When i want to use squeezebox player action on scene, it doesn’t work. For example i select “play” button i select “confirm changes” then “save” but when i edit scene, button stay grey. Other devices work great.

Hi,

I have installed this plugin, and it works great. Thanks for the good work! I have searched on the forum, and it seems that it is possible to have TTS on the squeezebox. Is there any plan to have this feature on a future release of the plugin?

On another matter, I’d like to use my squeezebox as an alarm clock that would slowly turn the volume up (I am not a morning person, and that would ease my wake up! ;D). I can do that manually, but I have noticed that there is a “ramptovolume” fonction in the plugin, but I cannot make it work. Do you know how it works?

Thank you for the maintenance. Looking forward to trying the TTS!

Regarding TTS, I started to extract the Sonos code relative to TTS to put it in a lua library.
My idea was to share it between the Sonos and the DLNA plugins. Of course, this library could be used by other plugins too. Mainly, the library produces an audio file from an input text and call an external play function specific to each plugin.
This library will include 2 TTS engines, but adding another engine would consist mainly in defining a new function in the library.
The library is not yet finished (80% done) and I have to document how to use it.

[quote=“mthomas, post:107, topic:170505”]I can create the controller, but no players are found.
Maybe my problem is that my LMS has a username and password. How can I add username and pass to the controller?[/quote]

Make sure that you have the correct ip address entered in the plugin. Also make sure that you use port 9090 and not 9000. Port 9090 is the telnet interface that the plugin uses for communication.

  • Garrett

Not sure I understand the issue, can you provide a screen capture?

  • Garrett

[quote=“veuch, post:109, topic:170505”]Hi,

I have installed this plugin, and it works great. Thanks for the good work! I have searched on the forum, and it seems that it is possible to have TTS on the squeezebox. Is there any plan to have this feature on a future release of the plugin?

On another matter, I’d like to use my squeezebox as an alarm clock that would slowly turn the volume up (I am not a morning person, and that would ease my wake up! ;D). I can do that manually, but I have noticed that there is a “ramptovolume” fonction in the plugin, but I cannot make it work. Do you know how it works?[/quote]

I do not have any direct plans to support TTS at the moment. There have been some users who got it to work with the current state of the plugin.

The plugin uses services like MediaNavigation1, Volume1, AVTransport, and RendingerControl. They contain many functions in the service files that may not be integrated in the plugin. One of them being the ramptovolume option. I could simply remove these un-used functions, however this will have an affect on other plugins that may use those same service files. Vera’s current design does not allow for using different service files for the same service. It will simply clash with one another and Vera will randomly pick one of those files which could cause one of the plugins to not fuction properly.

  • Garrett

[quote=“lolodomo, post:111, topic:170505”]Regarding TTS, I started to extract the Sonos code relative to TTS to put it in a lua library.
My idea was to share it between the Sonos and the DLNA plugins. Of course, this library could be used by other plugins too. Mainly, the library produces an audio file from an input text and call an external play function specific to each plugin.
This library will include 2 TTS engines, but adding another engine would consist mainly in defining a new function in the library.
The library is not yet finished (80% done) and I have to document how to use it.[/quote]

Lolodomo,

Any way of this plugin to provide a url type stream? Not sure if LMS will allow for playing of files that are not scanned into it’s library.

  • Garrett

[quote=“garrettwp, post:112, topic:170505”][quote=“mthomas, post:107, topic:170505”]I can create the controller, but no players are found.
Maybe my problem is that my LMS has a username and password. How can I add username and pass to the controller?[/quote]

Make sure that you have the correct ip address entered in the plugin. Also make sure that you use port 9090 and not 9000. Port 9090 is the telnet interface that the plugin uses for communication.

  • Garrett[/quote]

Thanks for the response. Yes, I have the correct IP address of my LMS and am using port 9090. LMS is running on my synology diskstation.
I have external access (WAN) to the synology open and thus to the LMS so I have it pass protected. Accessing the LMS via Android, Apple or web browser I enter user name and pass. All works well on that end with various devices and apps.
For your plugin however, do I need to get the username and pass in to the telnet connection for this to work? There is no prompt for it. Are there connection parameters somewhere that I need to add this to? Or am I heading down the wrong path troubleshooting this?
Thanks again.

I do have squeezebox TTS working for some select scenes. Thank you for the posts and guidence on the forums. However, I was really craving for dynamic TTS based on weather conditions. I don’t have sonos and I wasn’t able to do it with luup and squeezebox. Nevertheless, I took a different approach and I’m sharing it for those who want to try. I resorted to VBscript. The code below was modified from a public post demonstrating (and teaching) scripting on TTS and weather.

Step 1: Install “SoundIt” by winkoppp [url=http://forum.micasaverde.com/index.php/topic,13029.msg96249.html#msg96249]http://forum.micasaverde.com/index.php/topic,13029.msg96249.html#msg96249[/url]

Step 2: Link the VBscript file to SoundIt. The following VBscript will get weather data from Yahoo and “speak it” (TTS) on the computer were SoundIt is installed (I have an XP box).

Step 3: Create a scene as desired to trigger the weather broadcast. (I trigger the “broadcast” via a light switch in my kitchen to hear the current weather. I have speakers over the Kitchen cabinet that are connected to the PC in the basement where SoundIt is installed).

You can modify the script to accommodate the weather location of your choice.

[code]Option Explicit

’ VBScript to retrieve current Internet weather from Yahoo and read it out

’ To find the appropriate RSS feed for your city,
’ use Weather Location Codes/IDs for Apple iPhone, Android Tablet, Linux Ubuntu to find the location code for your desired weather.
’ Replace the code in the URL below with your weather location code.

’ (CAXX0343 is Yahoo’s code for Ottawa; u=c means units are Celsius rather than Fahrenheit)

Dim WeatherRSS
WeatherRSS = “http://weather.yahooapis.com/forecastrss?p=CAXX0343&u=c


’ Other variables

Dim WinHttpReq, XMLData, objXML, weatherCity, weatherCondition, currTemp, highTemp, lowTemp, WindChill, vHumidity, vVisibility, vSunrise, vSunset, vConditionTime
Dim Response


’ Fetch the RSS feed

Set WinHttpReq = CreateObject(“WinHttp.WinHttpRequest.5.1”)

’ Use the URL of the text file you wish to retrieve:
WinHttpReq.Open “GET”, WeatherRSS, False
WinHttpReq.Send

If (WinHttpReq.Status = 200) Then
XMLData = WinHttpReq.ResponseText

Set objXML = CreateObject("Microsoft.XMLDOM")
objXML.async = "False"
objXML.loadXML(XMLData)

weatherCity      = objXML.getElementsByTagName("yweather:location").item(0).attributes.getNamedItem("city").value
vConditionTime    = objXML.getElementsByTagName("yweather:condition").item(0).attributes.getNamedItem("date").value
weatherCondition = objXML.getElementsByTagName("yweather:condition").item(0).attributes.getNamedItem("text").value
currTemp         = objXML.getElementsByTagName("yweather:condition").item(0).attributes.getNamedItem("temp").value
highTemp         = objXML.getElementsByTagName("yweather:forecast").item(0).attributes.getNamedItem("high").value
lowTemp          = objXML.getElementsByTagName("yweather:forecast").item(0).attributes.getNamedItem("low").value
WindChill        = objXML.getElementsByTagName("yweather:wind").item(0).attributes.getNamedItem("chill").value
vHumidity         = objXML.getElementsByTagName("yweather:atmosphere").item(0).attributes.getNamedItem("humidity").value
vVisibility       = objXML.getElementsByTagName("yweather:atmosphere").item(0).attributes.getNamedItem("visibility").value
vSunrise          = objXML.getElementsByTagName("yweather:astronomy").item(0).attributes.getNamedItem("sunrise").value
vSunset           = objXML.getElementsByTagName("yweather:astronomy").item(0).attributes.getNamedItem("sunset").value

' Edit this to suit your needs. Note that whenever you have 'in' immediately after a number,
' Microsoft.Speech expands it to "inches", so we put a comma before it.

Response = "You have trigged an automated weather announcement.   Let me retrieve the current weather.    This " & weatherCity & " weather information was obtained on   " & vConditionTime & ".   I'm reporting   " & weatherCondition & "  and with current temperature of   " & currTemp & " degrees celsius.    The reported windy chill today is   " & WindChill & " degrees celsius.   The reported humidity today is  " & vHumidity & " percent.    The reported visibility today is  " & vVisibility & ".   The expected high temperature is   " & highTemp & " degrees celsius and the expected low temperature will be   " & lowTemp & " degrees celsius.   The sunrise for today is   " & vSunrise & " and the sunset is   " & vSunset & ".  Have a nice day!"

else
’ Problem reading weather from the server
Response = “Sorry, I can’t predict the weather today.”
end if

’ Uncomment the next line to see a message box with the response
’ WScript.Echo Response

’ Now send the response to Windows TTS
Dim objVoice
Set objVoice = CreateObject(“SAPI.SpVoice”)
objVoice.Speak Response[/code]

[quote=“mthomas, post:116, topic:170505”][quote=“garrettwp, post:112, topic:170505”][quote=“mthomas, post:107, topic:170505”]I can create the controller, but no players are found.
Maybe my problem is that my LMS has a username and password. How can I add username and pass to the controller?[/quote]

Make sure that you have the correct ip address entered in the plugin. Also make sure that you use port 9090 and not 9000. Port 9090 is the telnet interface that the plugin uses for communication.

  • Garrett[/quote]

Thanks for the response. Yes, I have the correct IP address of my LMS and am using port 9090. LMS is running on my synology diskstation.
I have external access (WAN) to the synology open and thus to the LMS so I have it pass protected. Accessing the LMS via Android, Apple or web browser I enter user name and pass. All works well on that end with various devices and apps.
For your plugin however, do I need to get the username and pass in to the telnet connection for this to work? There is no prompt for it. Are there connection parameters somewhere that I need to add this to? Or am I heading down the wrong path troubleshooting this?
Thanks again.[/quote]

I never tried it with LMS being user / password protected. If you can issue commands via the telnet service of the LMS, than the plugin should work.

  • Garrett
I never tried it with LMS being user / password protected. If you can issue commands via the telnet service of the LMS, than the plugin should work.
  • Garrett

Hi,
Same problem here : telnet don’t work without Login/Pass…

Hey Garrett,

Is there a way the plugin could keep the name of the squeezebox player if the name has been previously found?

Since I power of my players when they’re not in use (physically at the socket) the players revert back to a ? for their names (presumably following a LUA restart).

So in my case, I frequently get a whole bunch of my 20 odd players reverting to ? in the UI. This makes it tough to see which one is which ;D

The other problem is that I use the room/device name in notifications and a few other plugins, so with the name keep changing to ? it has some weird effects!

Hopefully that’s an easy fix?