Changes between Version 38 and Version 39 of WikiStart


Ignore:
Timestamp:
2014-02-17 23:39:24 (10 years ago)
Author:
lolodomo
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WikiStart

    v38 v39  
    155155 
    156156 
    157 === Making a Sonos "Say" something (outdated) === 
     157=== Making a Sonos "Say" something === 
    158158The Sonos plugin exposes Text to Speech capability through Google's service.  The functionality is exposed declaratively through the ''Say'' action under Advanced Scenes. 
    159 The functionality is also exposed programmatically via Lua code: 
    160 {{{ 
    161 luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say", 
    162                  {Text="Welcome Home", Language="en", Volume=50, GroupDevices="667,668"}, 
    163                  666) 
    164 }}} 
    165  
     159The functionality is also exposed programmatically via Lua code. 
     160 
     161Suppose you have 4 Sonos zones named Bedroom, Bathroom, Living-room and Kitchen. Your bedroom Sonos is linked to device 666 in your Vera. 
     162 
     163To play a message only in the bedroom, use this lua code: 
     164{{{ 
     165luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say", 
     166                 {Text="The sun shines outside", Language="en"}, 
     167                 666) 
     168}}} 
    166169This action will pause the current playback, say the text, and then the playback will be resumed. 
    167  
    168 By using the !GroupDevices parameter, it is even possible to activate the Text To Speech on several Sonos zones at the same time. This parameter represents a CSV list of deviceId's of other Sonos units that should be included during the save-say-restore model of the Say command. 
    169  
    170 Notes: 
    171  * This service may be removed at any time, as can happen with Google services. 
    172  * Parameters not specified will default internally. (''Language=en'', ''!GroupDevices=""'', ''Volume=nil'') By default, the volume is not set. 
     170Language is a string of 2 characters, like en, fr ... 
     171 
     172To play a message in the bedroom setting the volume for the message at level 60: 
     173{{{ 
     174luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say", 
     175                 {Text="The sun shines outside", Language="en", Volume=50}, 
     176                 666) 
     177}}} 
     178The volume will be adjusted to play the message, and finally restored to its previous level. 
     179When the Volume parameter is not used, the volume is not adjusted and the message is played with the current volume. 
     180 
     181To play a synchronized message in the bedroom, the bathroom and the kitchen: 
     182{{{ 
     183luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say", 
     184                 {Text="The sun shines outside", Language="en", GroupZones="Bathroom,Kitchen"}, 
     185                 666) 
     186}}} 
     187After the text is said, the playback will be resumed on the 3 zones. 
     188 
     189To play a synchronized message in all rooms setting the volume for the message at level 60 in all rooms: 
     190{{{ 
     191luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say", 
     192                 {Text="The sun shines outside", Language="en", GroupZones="ALL", 
     193                  Volume=60, SameVolumeForAll="true"}, 
     194                 666) 
     195}}} 
     196When the parameter !SameVolumeForAll is set to false or not set, the volume is adjusted only on the main zone, that is the bedroom in our example. 
     197 
     198To play a message in the bedroom using your personal OSX TTS server rather than using Google Internet service: 
     199{{{ 
     200luup.call_action("urn:micasaverde-com:serviceId:Sonos1", "Say", 
     201                 {Text="The sun shines outside", Language="en", Engine="OSX_TTS_SERVER"}, 
     202                 666) 
     203}}} 
     204Two accepted values for the engine: "GOOGLE" for the Google Internet service and "OSX_TTS_SERVER" for a personal OSX TTS server. 
     205 
     206Notes: 
     207 * Google service may be removed at any time 
     208 * For !GroupZones, you have to use room names (zone names defined with your Sonos application), not the name of your Vera device 
     209 * It is possible to use the parameter named !GroupDevices in place of !GroupZones. In this case, you must have a device in the Vera for all the Sonos zones you want to address. The value is a CSV list of device ids. For example, if your living-room and kitchen Sonos are linked respectively to devices 667 and 668 in your Vera, you will use !GroupDevices="667,668". The !GroupDevices has been kept for compatibility reasons with old versions but the use of !GroupZones is now recommended. 
     210 * Parameters not specified will default internally. (''Language=en'', ''Engine=GOOGLE'', ''!GroupDevices=""'', ''!GroupZones=""'', ''Volume=nil'', ''!SameVolumeForAll=false'') 
    173211 
    174212