Hi All
Not sure if anyone has encountered this and knows the fix. I have a number of spotify connect devices in the home, what I find is that the wife will on her iphone choose her device with headphones and things work nicely but when I just want to use a spotify_action ‘play’ to play music it will do this on her device because I’ve not selected that I want the music to come from the stereo.
Is there a way in the rules using a ‘sendCommand’ to specify which device you want the play to occur on?
If i query the current device list:
penhab> smarthome:status spotify_device_list
[{"name": "Music Room Dot", "volume_percent": 50, "is_private_session": false, "is_active": false, "is_restricted": false, "type": "Speaker", "id": "135e7483675e72c1f1ae91eb1986250e1dbdf03b"}, {"name": "Galaxy Tab A", "volume_percent": 100, "is_private_session": false, "is_active": false, "is_restricted": false, "type": "Tablet", "id": "59843b9a5191652d680355dc2be3be0c5da92c7e"}, {"name": "Living Room Dot", "volume_percent": 50, "is_private_session": false, "is_active": false, "is_restricted": false, "type": "Speaker", "id": "7a16637316a11e964510af0e18c6e0b5be634c4a"}, {"name": "Garage Dot", "volume_percent": 50, "is_private_session": false, "is_active": false, "is_restricted": false, "type": "Speaker", "id": "d140c3a16e0bdfe15062f88de9c821cd0d111564"}, {"name": "Living Room", "volume_percent": 59, "is_private_session": false, "is_active": false, "is_restricted": false, "type": "AVR", "id": "f48564e5be42c184009e18b2d771af1a225d22c4"}]
I want ‘Living Room’ type is AVR.
If in a rule I use something like below, it won’t work
if (LivingRoom_Zrc_Remote.state == 6.0 && Main_Zone_Power.state == ON) {
Zone_1_Input.sendCommand('Spotify')
spotify_current_device_id.sendCommand("f48564e5be42c184009e18b2d771af1a225d22c4")
Any suggestions to send the audio to a specific Spotify connect device? I see it change the device id but it changes back in the log.
Regards
EDIT Solution:
}
if (LivingRoom_Zrc_Remote.state == 6.0 && Main_Zone_Power.state == OFF) {
Main_Zone_Power.sendCommand('ON')
Zone_1_Input.sendCommand('Spotify')
spotify_current_device_id.sendCommand("f48564e5be42c184009e18b2d771af1a225d22c4")
spotify_action.sendCommand('play')
}
if (LivingRoom_Zrc_Remote.state == 6.0 && Main_Zone_Power.state == ON) {
Zone_1_Input.sendCommand('Spotify')
spotify_current_device_id.sendCommand("f48564e5be42c184009e18b2d771af1a225d22c4")
spotify_action.sendCommand('transfer_playback')
}
if (LivingRoom_Zrc_Remote.state == 6.3) {
Main_Zone_Power.sendCommand('OFF')
}