Scipt could not be setup

With the latest update i have a failure in my notifications.
The following integrations and platforms could not be set up:

  • script

I checked my scripts. They all work so the scripts do load.
It happened since i updated to 0.115.2. 0.114 worked without a problem.

edit: One script failed. Why?

radio538:
  alias: play radio
  sequence:
  - service: media_player.volume_set
    data_template:
      entity_id: '{% if is_state("input_select.chromecast_radio", "Livingroom Shield")
        %} media_player.marantz_nr1608_1 {% elif is_state("input_select.chromecast_radio",
        "Livingroom Tv") %} media_player.kd_49x8005c {% elif is_state("input_select.chromecast_radio",
        "Livingroom Marantz") %} media_player.marantz_nr1608_1 {% elif is_state("input_select.chromecast_radio",
        "Bedroom") %} media_player.tv_in_slaapkamer {% elif is_state("input_select.chromecast_radio",
        "Everywhere") %} media_player.home_group {% endif %}

        '
      volume_level: '{{  states.input_number.volume_radio.state  }}'
  - service: tts.google_translate_say
    data_template:
      entity_id: '{% if is_state("input_select.chromecast_radio", "Livingroom Shield")
        %} media_player.shield {% elif is_state("input_select.chromecast_radio", "Livingroom
        Tv") %} media_player.kd_49x8005c {% elif is_state("input_select.chromecast_radio",
        "Livingroom Marantz") %} media_player.marantz_nr1608 {% elif is_state("input_select.chromecast_radio",
        "Bedroom") %} media_player.tv_in_slaapkamer {% elif is_state("input_select.chromecast_radio",
        "Everywhere") %} media_player.home_group {% endif %}

        '
      message: 'Volgende station: {{ states.input_select.radio_station.state  }}'
  - delay: 00:00:04
    service: media_player.play_media
    data_template:
      entity_id: '{% if is_state("input_select.chromecast_radio", "Livingroom Shield")
        %} media_player.shield {% elif is_state("input_select.chromecast_radio", "Livingroom
        Tv") %} media_player.kd_49x8005c {% elif is_state("input_select.chromecast_radio",
        "Livingroom Marantz") %} media_player.marantz_nr1608 {% elif is_state("input_select.chromecast_radio",
        "Bedroom") %} media_player.tv_in_slaapkamer {% elif is_state("input_select.chromecast_radio",
        "Everywhere") %} media_player.home_group {% endif %}

        '
      media_content_id: '{% if is_state("input_select.radio_station", "Radio 1") %}
        https://icecast.omroep.nl/radio1-bb-aac {% elif is_state("input_select.radio_station",
        "Radio 2") %} https://icecast.omroep.nl/radio2-bb-aac {% elif is_state("input_select.radio_station",
        "3FM") %} http://icecast.omroep.nl/3fm-bb-mp3 {% elif is_state("input_select.radio_station",
        "Radio 4 NL") %} https://icecast.omroep.nl/radio4-bb-aac {% elif is_state("input_select.radio_station",
        "Radio Fip") %} https://icecast.radiofrance.fr/fip-hifi.aac {% elif is_state("input_select.radio_station",
        "Omroep Brabant") %} http://av.omroepbrabant.nl/icecast/omroepbrabant/mp3 {% elif is_state("input_select.radio_station", 
        "Sky Radio") %} http://8623.live.streamtheworld.com:80/SKYRADIOAAC_SC {% elif is_state("input_select.radio_station", 
        "Arrow Classic Rock") %} http://91.221.151.155/listen.mp3 {% elif is_state("input_select.radio_station", 
        "Classic FM") %} http://19143.live.streamtheworld.com/CLASSICFM_SC {% elif is_state("input_select.radio_station", 
        "BNR Nieuwsradio") %} http://icecast-bnr.cdp.triple-it.nl/bnr_mp3_96_03 {% elif is_state("input_select.radio_station", 
        "Sleep Radio") %} http://37.59.28.208:8722/stream {% elif is_state("input_select.radio_station", 
        "Ambient Sleeping Pill") %} http://perseus.shoutca.st:8447/h {% elif is_state("input_select.radio_station",
        "Radio Art - Sleep") %} http://live.radioart.com/fSleep.mp3 {% elif is_state("input_select.radio_station",
        "Ambi Nature Radio") %} http://94.23.252.14:8067/stream {% elif is_state("input_select.radio_station",
        "Calm Radio - Sleep") %} http://streams.calmradio.com/api/39/128/stream {% elif is_state("input_select.radio_station", 
        "Dinamo.FM Sleep") %} http://channels.dinamo.fm/sleep-aac {% endif %}'
      media_content_type: audio/mp4

Please look in your log for the actual error.

In fact since your edit I can see the problem, half of your templates are missing.

Okay thanks. I don’t have any clue how to fix it. It has to do with incorrect spaces right?
Is the new update more picky about those spaces?

edit: New version:

playfiplivingroom:
  alias: play Living
  sequence:
  - data: {}
    entity_id: media_player.marantz_nr1608_2
    service: media_player.turn_on
  - delay: 00:00:10
    data:
      source: Media Player
    entity_id: media_player.marantz_nr1608_2
    service: media_player.select_source
  - data:
      media_content_id: https://icecast.radiofrance.fr/fip-hifi.aac
      media_content_type: audio/mp4
    entity_id: media_player.shield
    service: media_player.play_media
  - data:
      volume_level: '0.30'
    entity_id: media_player.marantz_nr1608_2
    service: media_player.volume_set
  - device_id: ''
    domain: ''
    entity_id: ''
radio538:
  alias: play radio
  sequence:
  - service: media_player.volume_set
    data_template:
      entity_id: '{% if is_state("input_select.chromecast_radio", "Livingroom Shield")
        %} media_player.marantz_nr1608_1 {% elif is_state("input_select.chromecast_radio",
        "Livingroom Tv") %} media_player.kd_49x8005c {% elif is_state("input_select.chromecast_radio",
        "Livingroom Marantz") %} media_player.marantz_nr1608_1 {% elif is_state("input_select.chromecast_radio",
        "Bedroom") %} media_player.tv_in_slaapkamer {% elif is_state("input_select.chromecast_radio",
        "Everywhere") %} media_player.home_group {% endif %}

        '
      volume_level: '{{  states.input_number.volume_radio.state  }}'
  - service: tts.google_translate_say
    data_template:
      entity_id: '{% if is_state("input_select.chromecast_radio", "Livingroom Shield")
        %} media_player.shield {% elif is_state("input_select.chromecast_radio", "Livingroom
        Tv") %} media_player.kd_49x8005c {% elif is_state("input_select.chromecast_radio",
        "Livingroom Marantz") %} media_player.marantz_nr1608 {% elif is_state("input_select.chromecast_radio",
        "Bedroom") %} media_player.tv_in_slaapkamer {% elif is_state("input_select.chromecast_radio",
        "Everywhere") %} media_player.home_group {% endif %}'
        
      message: 'Volgende station: {{ states.input_select.radio_station.state  }}'
  - delay: 00:00:04
    service: media_player.play_media
    data_template:
      entity_id: '{% if is_state("input_select.chromecast_radio", "Livingroom Shield")
        %} media_player.shield {% elif is_state("input_select.chromecast_radio", "Livingroom
        Tv") %} media_player.kd_49x8005c {% elif is_state("input_select.chromecast_radio",
        "Livingroom Marantz") %} media_player.marantz_nr1608 {% elif is_state("input_select.chromecast_radio",
        "Bedroom") %} media_player.tv_in_slaapkamer {% elif is_state("input_select.chromecast_radio",
        "Everywhere") %} media_player.home_group {% endif %}

        '
      media_content_id: '{% if is_state("input_select.radio_station", "Radio 1") %}
        https://icecast.omroep.nl/radio1-bb-aac {% elif is_state("input_select.radio_station",
        "Radio 2") %} https://icecast.omroep.nl/radio2-bb-aac {% elif is_state("input_select.radio_station",
        "3FM") %} http://icecast.omroep.nl/3fm-bb-mp3 {% elif is_state("input_select.radio_station",
        "Radio 4 NL") %} https://icecast.omroep.nl/radio4-bb-aac {% elif is_state("input_select.radio_station",
        "Radio Fip") %} https://icecast.radiofrance.fr/fip-hifi.aac {% elif is_state("input_select.radio_station",
        "Omroep Brabant") %} http://av.omroepbrabant.nl/icecast/omroepbrabant/mp3 {% elif is_state("input_select.radio_station", 
        "Sky Radio") %} http://8623.live.streamtheworld.com:80/SKYRADIOAAC_SC {% elif is_state("input_select.radio_station", 
        "Arrow Classic Rock") %} http://91.221.151.155/listen.mp3 {% elif is_state("input_select.radio_station", 
        "Classic FM") %} http://19143.live.streamtheworld.com/CLASSICFM_SC {% elif is_state("input_select.radio_station", 
        "BNR Nieuwsradio") %} http://icecast-bnr.cdp.triple-it.nl/bnr_mp3_96_03 {% elif is_state("input_select.radio_station", 
        "Sleep Radio") %} http://37.59.28.208:8722/stream {% elif is_state("input_select.radio_station", 
        "Ambient Sleeping Pill") %} http://perseus.shoutca.st:8447/h {% elif is_state("input_select.radio_station",
        "Radio Art - Sleep") %} http://live.radioart.com/fSleep.mp3 {% elif is_state("input_select.radio_station",
        "Ambi Nature Radio") %} http://94.23.252.14:8067/stream {% elif is_state("input_select.radio_station",
        "Calm Radio - Sleep") %} http://streams.calmradio.com/api/39/128/stream {% elif is_state("input_select.radio_station", 
        "Dinamo.FM Sleep") %} http://channels.dinamo.fm/sleep-aac {% endif %}'
      media_content_type: audio/mp4

No, your last template is literally missing massive chunks of text from the start of each line.

Ignore me, it’s the way the forum is rendering it.

Give me a minute I’ll try and solve it for you…

playfiplivingroom:
  alias: play Living
  sequence:
    - service: media_player.turn_on 
      entity_id: media_player.marantz_nr1608_2
    - delay: "00:00:10" 
    - service: media_player.select_source
      data:
        entity_id: media_player.marantz_nr1608_2
        source: Media Player
    - service: media_player.play_media
      data:
        entity_id: media_player.shield
        media_content_id: "https://icecast.radiofrance.fr/fip-hifi.aac" 
        media_content_type: audio/mp4
    - service: media_player.volume_set   
      data:
        entity_id: media_player.marantz_nr1608_2
        volume_level: 0.3
    
radio538:
  alias: play radio
  sequence:
    - service: media_player.volume_set
      data_template:
        entity_id: >
          {% if is_state("input_select.chromecast_radio", "Livingroom Shield") %} media_player.marantz_nr1608_1
          {% elif is_state("input_select.chromecast_radio", "Livingroom Tv") %} media_player.kd_49x8005c
          {% elif is_state("input_select.chromecast_radio", "Livingroom Marantz") %} media_player.marantz_nr1608_1
          {% elif is_state("input_select.chromecast_radio", "Bedroom") %} media_player.tv_in_slaapkamer
          {% elif is_state("input_select.chromecast_radio", "Everywhere") %} media_player.home_group
          {% endif %}
        volume_level: "{{ states('input_number.volume_radio') }}"
    - service: tts.google_translate_say
      data_template:
        entity_id: >
          {% if is_state("input_select.chromecast_radio", "Livingroom Shield") %} media_player.shield
          {% elif is_state("input_select.chromecast_radio", "Livingroom Tv") %} media_player.kd_49x8005c
          {% elif is_state("input_select.chromecast_radio", "Livingroom Marantz") %} media_player.marantz_nr1608
          {% elif is_state("input_select.chromecast_radio", "Bedroom") %} media_player.tv_in_slaapkamer
          {% elif is_state("input_select.chromecast_radio", "Everywhere") %} media_player.home_group
          {% endif %}
        message: "Volgende station: {{ states('input_select.radio_station') }}" 
    - delay: "00:00:04" 
    - service: media_player.play_media
      data_template:
        entity_id: >
          {% if is_state("input_select.chromecast_radio", "Livingroom Shield") %} media_player.shield
          {% elif is_state("input_select.chromecast_radio", "Livingroom Tv") %} media_player.kd_49x8005c 
          {% elif is_state("input_select.chromecast_radio", "Livingroom Marantz") %} media_player.marantz_nr1608
          {% elif is_state("input_select.chromecast_radio", "Bedroom") %} media_player.tv_in_slaapkamer
          {% elif is_state("input_select.chromecast_radio", "Everywhere") %} media_player.home_group
          {% endif %}
        media_content_id: >
          {% if is_state("input_select.radio_station", "Radio 1") %} https://icecast.omroep.nl/radio1-bb-aac
          {% elif is_state("input_select.radio_station", "Radio 2") %} https://icecast.omroep.nl/radio2-bb-aac
          {% elif is_state("input_select.radio_station", "3FM") %} http://icecast.omroep.nl/3fm-bb-mp3
          {% elif is_state("input_select.radio_station", "Radio 4 NL") %} https://icecast.omroep.nl/radio4-bb-aac
          {% elif is_state("input_select.radio_station", "Radio Fip") %} https://icecast.radiofrance.fr/fip-hifi.aac
          {% elif is_state("input_select.radio_station", "Omroep Brabant") %} http://av.omroepbrabant.nl/icecast/omroepbrabant/mp3
          {% elif is_state("input_select.radio_station",  "Sky Radio") %} http://8623.live.streamtheworld.com:80/SKYRADIOAAC_SC
          {% elif is_state("input_select.radio_station", "Arrow Classic Rock") %} http://91.221.151.155/listen.mp3
          {% elif is_state("input_select.radio_station", "Classic FM") %} http://19143.live.streamtheworld.com/CLASSICFM_SC
          {% elif is_state("input_select.radio_station", "BNR Nieuwsradio") %} http://icecast-bnr.cdp.triple-it.nl/bnr_mp3_96_03
          {% elif is_state("input_select.radio_station", "Sleep Radio") %} http://37.59.28.208:8722/stream
          {% elif is_state("input_select.radio_station", "Ambient Sleeping Pill") %} http://perseus.shoutca.st:8447/h
          {% elif is_state("input_select.radio_station", "Radio Art - Sleep") %} http://live.radioart.com/fSleep.mp3
          {% elif is_state("input_select.radio_station", "Ambi Nature Radio") %} http://94.23.252.14:8067/stream
          {% elif is_state("input_select.radio_station", "Calm Radio - Sleep") %} http://streams.calmradio.com/api/39/128/stream
          {% elif is_state("input_select.radio_station", "Dinamo.FM Sleep") %} http://channels.dinamo.fm/sleep-aac
          {% endif %}
        media_content_type: audio/mp4

Thanks MF_Social,

It works flawlessly! Thats so much cleaner!
I’m going to compare my code with yours.
If you can explain what happened i can learn from it?

Thanks! Dave

1 Like

Unfortunately I can’t, I just literally worked through it line by line and tidied it up, then went back through it to make sure that nothing stood out as being wrong, which there wasn’t so whatever it was must have been resolved during the tidy up and I didn’t notice :slightly_smiling_face:

I guess the only learning point would be to write it neatly in the first place :wink:

Thanks! It was a merge between auto generated scripts from the GUI and myself :slight_smile:

1 Like