Problem with media_player.play_media in Core-2021.4.0

My media_player.play_media seems to have broken after upgrading to core-2021.4.0. I have a second Pi running Kodi as a media player, and everything (tts.google_say and media_player.play_media), works correctly when I revert to core-2021.3.4, but as soon as I upgrade to core-2021.4.0 it breaks with the following errors:

(-32602, ‘Invalid params.’, {‘error’: {‘code’: -32602, ‘data’: {‘method’: ‘Player.Open’, ‘stack’: {‘message’: ‘Received value does not match any of the union type definitions’, ‘name’: ‘item’, ‘type’: ‘object’}}, ‘message’: ‘Invalid params.’}, ‘id’: 6792423075333964854, ‘jsonrpc’: ‘2.0’})

The same thing happens in Node Red when I call it with a call service node:

{
    "media_content_id": "http://192.168.0.115:8123/local/sounds/ding.mp3",
    "media_content_type": "audio/mp3"
}

If I try to set the volume level it throws an error:
“Failed to call service media_player/volume_set.expected float for dictionary value @ data[‘volume_level’]”, which also works when I revert to core-2021.3.4

My automation is:

  alias: Play MP3
  description: ''
  trigger: []
  condition: []
  action:
  - data:
      media_content_id: http://192.168.0.115:8123/local/sounds/ding.mp3
      media_content_type: audio/mp3
    entity_id: media_player.rpi4
    service: media_player.play_media
  mode: single

I’m running Home Assistant OS Home Assistant OS 5.13 on a RPi4.

Any suggestions on what else to try to troubleshoot this?
Thanks

Other have reported similar issues. I have learned from personal experience to only upgrade HA when I have the time to debug any problems; so I pretty much only do it on the weekends.

99.999% of the time there are no issues, but it is that one issue when you need to rush somewhere else and you really would like your automations working is what got me. Also, usually by the time I get around to upgrading there is a point release to fix some of the initial bugs.

Continuing to troubleshoot…

I’ve uninstalled the Kodi Integration, restarted, and re-installed, and it re-discovered my Kodi installation, but still get the same errors when trying to play anything.

I don’t have any issues with playing .mp3’s or using TTS using the Modipy integration locally, so I’m assuming this is related to just Kodi. I’m running Kodi 18.7, which seems to be the latest version available for the Raspberry OS. There is one breaking change listed that mentions Kodi, but it doesn’t seem like it would be related as I’m not running Kodi on the Home Assistant pi, but on a second pi.

This is fixed and should does ship with 2021.4.2.

Just installed 2021.4.2 and it’s working again. Amazingly fast response from the dev!

1 Like