Error when calling media service

hi
any ideas on the following issue i am having.
when I enter the following in my configuration.yaml

service: media_player.play_media
entity_id: media_player.soundtouch_living_room
data:
media_content_id: “http://192.168.1.103:8123/local/siren.mp3
media_content_type: “audio/mp3”

I get a green tick on yamel but it fails the “check configuration” with the following error
i have confirmed the entity and service on the developer tool tab, no sure where to look for the integration’data’ error .

just for context all I am trying to do is to play the siren .mp3 when movement is detected on a pir.

Component error: entity_id - Integration ‘entity_id’ not found.
Component error: service - Integration ‘service’ not found.
Component error: data - Integration ‘data’ not found.

Is your media_content_type wrong, the doc’s have this:

image

Hi Michael,
your code is totaly out of context. Normaly it should be part of an automation.
Did you try to set it up via Configuration -> Automations?
Something like ‘when pir triggers motion then play music … on mediaplayer …’?

hi
yes it could be , that’s why i put some context in it, my thinking was try and get the audio working then setup the trigger and action, can you advice on the steps required, or what needs to be setup first in order to get the media player to play in the event of movement detection
thanks

no i have not used automation , because i could not find a suitable template

I suggest to read the documentation for automation. Then a good starting point, I think, would be https://www.home-assistant.io/cookbook/turn_on_light_for_10_minutes_when_motion_detected/
First set up the motion part as descriped there and then start trying to get the action part amended to your needs.

Here’s a script from my system that is working, you should be able to adapt this to get yours working:

media_test:
  alias: Media Test
  sequence:
  - service: media_player.play_media
    data:
      media_content_id: http://192.168.1.17:8123/local/doorbell-2.mp3
      media_content_type: music
    entity_id: media_player.study
  mode: single

hi
i just read the link above , and now realize that i have been putting the above configuration in “configuration.yaml” but i see that it needs to be in automation .yaml.
now that is cleared up ill give that a go, just one other thing, with the above config is there a way to check if its working without the automation trigger , say by calling the service ?

Should go via Developer Tools -> service tab

under the service tab i selected " media_player.play_media" service and below i added
entity_id: media_player.soundtouch_living_room
media_content_id: ‘https://192.168.1.103:8123/local/siren.mp3
media_content_type: music
i press call service, the colour of “call service” changes to green for a second but no sound from soundtouch.
i was at least expecting the soundtouch to power on
any ideas
cheers

Please please read this and format your code properly. How to help us help you - or How to ask a good question

Perhaps you need to turn the media_player on first?

hi its all working now , it turned out to be a typo HTTPS , somewhere along the lines of cutting and pasting it got changed to https
cheers

Really? Don’t think so.

working as required , and it turns the soundtouch media player on , but after playing the sound it does not turn it self off , that’s next on the list
cheers