JSON to tell Sonos player to play a favorite - WebSocket API - Media Player

Hi,

I’m communicating with HA through the Websocket API. I’m working on controlling a Sonos player using the media player entity. I have basic functions working such as play/pause. I also have retrieval of the Sonos favorites working using the sensor.sonos_favorites_2 entity.

What I am struggling with is what the JSON needs to look like to command the Sonos player to play one of the Sonos favorites. An example of what the JSON should look like would be greatly appreciated.

Thanks in advance for the help

I figured it out. Here is example JSON:

{
   "id":3,
   "type":"call_service",
   "domain":"media_player",
   "service":"play_media",
   "service_data":{
      "media_content_id":"FV:2/1",
      "media_content_type":"favorite_item_id"
   },
   "target":{
      "entity_id":"media_player.shop_sonos"
   },
   "return_response":false
}