Yesterday, 10:08
If you have this script working then first try basic play/pause
Create a bit object and then event script on it. use this script and change Bedroom to your group name, you can see it in Sonos app on the bottom.
https://app.screencast.com/zJSLrszerduNH
Create a bit object and then event script on it. use this script and change Bedroom to your group name, you can see it in Sonos app on the bottom.
Code:
require('custom.sonos.lib')
groupName='Bedroom'
-------------------------------------------------------------
groupID=sonos_app.GetStoragePlayerGroups()
for k, v in pairs(sonos_app.GetStoragePlayerGroups()) do
if groupID[k].groupName == groupName then
groupID=k
break
end
end
-------------------------------------------------------------
value = event.getvalue()
if value then
sonos_app.SendApiActionCommand(groupID, 'play')
else
sonos_app.SendApiActionCommand(groupID, 'pause')
end
------------------------------
Ctrl+F5
Ctrl+F5