Difference between revisions of "Sonos Integration"

From Hubitat Documentation
Jump to: navigation, search
(correct typos and revise image)
(Replaced content with " <big>'''We're moving!''' Please visit http://docs2.hubitat.com for the latest documentation.</big> <big> This document is available at: http://docs2.hubitat.com/en/apps/...")
(Tag: Replaced)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Connecting your Hubitat Elevation<sup>®</sup> to your Sonos device is an easy way to add audio and text to speech voice notifications to your home automations. Using the Hubitat Sonos Integration, you can control the volume and playback functions of your Sonos speakers, plus send voice notifications using the built-in Text to Speech (TTS) capabilities of your Hubitat Elevation<sup>®</sup> hub.
 
  
===Installing the Hubitat Sonos Integration===
+
<big>'''We're moving!''' Please visit http://docs2.hubitat.com for the latest documentation.</big>
  
#From the Hubitat Web Interface select '''Apps'''.[[File:Install Built-In App 2.0.png|none|thumb|600x600px]]
+
<big>
#Choose Sonos Integration from the list of Built-In Apps.[[File:Install Sonos Integration.png|none|thumb|600x600px]]
+
This document is available at: http://docs2.hubitat.com/en/apps/sonos-integration
#Wait for your Hubitat Elevation<sup>®</sup> hub to search for Sonos devices. This can take 5 minutes or more, but typically Sonos devices are found with 30 seconds from installation the Sonos Integration app.[[File:Sonos Integration - Search begins.png|none|thumb|600x600px]]
+
</big>
#Once your Sonos device is found, press the '''Next''' button.[[File:Sonos Integration Discovery.png|none|thumb|600x600px]]
 
#Make your selection by checking the box next to the name of the found device you want to use. To add additional devices not discovered during the Sonos Integration installation, press the '''Continue Search''' button.[[File:Sonos Integration set found.png|none|thumb|600x600px]]
 
#Press the '''Done''' button to finish.[[File:Sonos Integration complete.png|none|thumb|600x600px]]
 
 
 
===Test your Sonos Integration===
 
 
 
#In the list of [[Devices]], find the name of your Sonos device you are testing. In the example above, it is named '''Dining Room Sonos'''.
 
#Scroll down and find the '''Speak''' command.
 
#*'''NOTE''': There will be some duplicate commands shown, since the same command is part of two separate capabilities of the integration. You will notice for example, one of the '''Speak''' commands also has a field for ''Volume level'', while the other only has a single field for testing the TTS message you want to hear from the Sonos device.
 
#Type your test word or phrase into the ''Text'' box below the '''Speak''' command and press the '''Speak''' button. You should hear your word or phrase from your Sonos device.[[File:Test Sonos Integration driver.png|none|thumb|600x600px]]
 
 
 
===Using the Hubitat Notifications app for Text to Speech (TTS) messages===
 
The Notifications app can be used to send TTS messages to your Sonos device. This is the simplest way to play TTS announcements on your Sonos. For detail on how to use the Notifications app, please see the [[Notifications]] document.
 
 
 
===Controlling your Sonos Integration with Rule Machine<sup>®</sup>===
 
There are several ways to control your Sonos device with Rule Machine<sup>®</sup> and send Text to Speech (TTS) messages. While it's possible to simply use the Notifications app to play TTS messages on your Sonos device, it is helpful to understand how to build Rule Machine<sup>®</sup> rules, since you can combine multiple actions, control multiple devices, and trigger all actions within a single rule by way of one or multiple triggers. This is substantially more powerful than a single TTS Notification and will help you Elevate your home automation to new levels. For our basic example below however, the Sonos device will simply play the TTS message at volume 50, anytime the front door contact sensor is opened. 
 
 
 
#If you have not already done so, install '''Rule-4.0''' with the same method used to install the Sonos Integration at the beginning of this document.
 
#From the Apps page of the Hubitat Web Interface, select '''Rule Machine'''
 
#Give your rule a name. For this simple example, we will announce the via TTS, the message "Front Door" anytime the front door contact sensor is open, so it therefore makes sense to name our example rule "Announce Front Door".[[File:RM4 TTS speech example.png|none|thumb|600x600px]]
 
#For our example rule, we need to specify something to trigger the actions of the rule. We want the rule actions run when the front door is opened, so the trigger device we will select will be our Front Door contact sensor.[[File:RM4 select trigger - TTS example.png|none|thumb|600x600px]][[File:RM4 TTS example - contact as trigger.png|none|thumb|600x600px]][[File:RM4 TTS example Front Door contact.png|none|thumb|600x600px]]
 
#You can of course have multiple triggers in Rule Machine<sup>®</sup>, but for our simple example we only want to use a single trigger. Press the button '''Done with Trigger Events'''.[[File:RM4 TTS example Finish trigger event.png|none|thumb|600x600px]]
 
#We will now specify the '''Action''' for our example rule to Speak a message on our Sonos device. Press the '''Select Actions to Run''' button.[[File:RM 4 TTS example Select Action.png|none|thumb|600x600px]]
 
#From the drop-down menu, choose the Action '''Send, Speak or Log a Message, Send HTTP Request''' and then choose '''Send or Speak a Message'''.[[File:RM 4 TTS example choose action category.png|none|thumb|600x600px]][[File:RM 4 TTS example choose action.png|none|thumb|600x600px]]
 
#For our example rule, we want our announcement to be "Front Door", so type this into the '''Message to Send''' field, then scroll down and activate the option '''Speak this message'''. For a Sonos device, there are two places where you can select the device to use. If you choose '''On this speech device''', the TTS message will be spoken at the current volume level of the speaker. For our example, we will choose '''On this music device''', since it will allow us to also specify the volume at the same time.
 
#*[[File:RM 4 TTS Example setup speech.png|none|thumb|1102x1102px]]
 
#Press '''Done with this action''', and since we will only be adding a single action from our trigger device (the Front Door contact sensor), you should now select '''Done with Actions'''.[[File:RM4 TTS example finalize action.png|none|thumb|640x640px]]
 
#Press '''Done''' to finish and test your rule by activating the trigger device.[[File:RM4 TTS example finish rule.png|none|thumb|835x835px]]
 
#As you become more familiar with building rules, you can explore using Rule Machine<sup>®</sup> Actions called Custom Commands. These allow you to specify actions such as '''Pause''', '''nextTrack''', '''previousTrack''', '''Mute''', etc. These may be independent actions, or they can follow, or proceed the TTS action.[[File:RM4 Sonos example of custom commands 2.png|none|thumb|960x960px]]
 
 
 
As you can see from the above examples, the power of Rule Machine<sup>®</sup> can be leveraged to specify criteria that must be met before a rule action is run. In the example rule, the TTS message will be at a specified volume level. Once you are more familiar with building Rule Machine<sup>®</sup> rules and '''[https://docs.hubitat.com/index.php?title=Rule-4.0#Rule-4.0_Conditional_Actions_and_Logical_Expressions Conditional Actions]''' , TTS announcements at different volumes, occurring at different times of the day, only in specified [[Modes]], etc., becomes very simple to achieve.
 

Latest revision as of 20:20, 25 September 2022

We're moving! Please visit http://docs2.hubitat.com for the latest documentation.

This document is available at: http://docs2.hubitat.com/en/apps/sonos-integration