Play sound returns invalid call_service

I am trying to get appdaemon to play a sound when our alarm goes off.

For testing purpose I have tried the following:

import appdaemon.plugins.hass.hassapi as hass
#import datetime

class test(hass.Hass):

   def initialize(self):

    self.listen_state(self.test, "input_boolean.dvd_mode")


       
   def test (self, entity, attribute, old, new, kwargs):
       self.call_service("media_player.play_media", entity_id = "media_player.kkken", media_content_id = "/local/alarm_sound.mp3", media_content_type = "music")

That returns an error “ValueError: Invalid Service Name: media_player.play_media”. So I suppose my call service name is incorrect, but according to the docs it seems okay?

Ahh I solved it, it “/” instead of “.” that separates the call service, and then I needed to add some more to the adress of the mp3:

import appdaemon.plugins.hass.hassapi as hass
#import datetime

class test(hass.Hass):

   def initialize(self):

    self.listen_state(self.test, "input_boolean.dvd_mode")


       
   def test (self, entity, attribute, old, new, kwargs):
       self.call_service("media_player/play_media", entity_id = "media_player.kkken", media_content_id = "http://192.168.86.26:8123/local/alarm_sound.mp3", media_content_type = "music")