Automation error : Error executing script

Hello, I have an error in automation but I can’t find it:

alias: "doorbell_automation"
trigger:
 - platform: state
   entity_id: binary_sensor.doorbell_contact
   to: 'off'
action:
 - service: media_player.turn_on
   entity_id: media_player.desktop_pc_thierry
   
 - service: media_player.turn_on
   entity_id: media_player.xbr_49x800e
   
 - service: media_player.volume_set
   data:
      entity_id: media_player.sony_xbr_55x800h
      volume_level: 0.6
      
 - service: media_player.volume_set
   data:
      entity_id: media_player.desktop_pc_thierry 
      volume_level: 0.6
      
 - service: media_player.volume_set
   data:
      entity_id: media_player..xbr_49x800e 
      volume_level: 0.6
      
 - service: media_player.play_media   
   entity_id: media_player.desktop_pc_thierry
   data:
       media_content_id: 'http://192.168.1.106:8123/local/mp3/doorbell.mp3'
       media_content_type: audio/mp4
   
 - service: media_player.play_media   
   entity_id: media_player.sony_xbr_55x800h
   data:
       media_content_id: 'http://192.168.1.106:8123/local/mp3/doorbell.mp3'
       media_content_type: audio/mp4
       
 - service: media_player.play_media
   entity_id: media_player.xbr_49x800e
   data:
      media_content_id: http://192.168.1.106:8123/local/mp3/doorbell.mp3
      media_content_type: 'audio/mp4'
      
 - service: notify.pushbullet
   data:
        title: 'Home assistant warning'
        message: 'On sonne à la porte !'

 - service: notify.email
   data:
       title: "Home assistant warning"
       message: "On sonne à la porte"        

The error in the log is:
doorbell_automation: Error executing script. Invalid data for call_service at pos 6: not a valid value for dictionary value @ data[‘entity_id’]

what does pos 6 means ?

Many thanks for your help, very apreciated.

Best regards

Is that from the Check Configuration button or the actual log?
Syntax error I think tho usually the Check Configuration tells you which line and everything not simply position 6.
Also from your code ‘audio/mp4’ is escaped once but not other places which seems inconsistent
as well as the mp3 url all of which could lead to weird syntax issues.
Check for tabs or misaligned spacing…for just pure yaml issues.
some of the sub lines align w/ the a in data: and others with the colon. others past the : (not sure if thats just what it looks like here in forum) but if so you have a lot of inconsistency in your yaml if I’m not mistaken but all my automations are in NR.

Also reminds me why I went NodeRed a long time ago.

media_player..xbr_49x800e

You’ve got two periods in the entity ID in the fifth service call.

1 Like