Head Scratcher: Weekday Alarm Works, Weekend Doesn't

Hello. I am asking for some assistance here because I just can’t figure out why one of these radio alarm scripts works and the other doesn’t. I have two automations which are almost identical. Each one fires a script and the scripts are almost identical. Yet, one works and the other doesn’t.

Working (Weekday) Automation:

- id: 'Alarm Weekday'
  alias: 'Alarm Weekday'
  trigger:
    - platform: time
      at:
        - "06:59:00"
  condition:
  - condition: time
    weekday:
      - mon
      - tue
      - wed
      - thu
      - fri
  action:
    service: script.turn_on
    entity_id: script.radio_alarm_cbcmusic

Working (Weekday) Script:

radio_alarm_cbcmusic:
  sequence:
    - service: switch.turn_on
      data:
        entity_id: media_player.radio
    - service: squeezebox.call_method
      data:
        entity_id: media_player.radio
        command: stop
    - service: media_player.volume_set
      data:
        entity_id: media_player.radio
        volume_level: "0.24"
    - service: squeezebox.call_method
      data:
        entity_id: media_player.radio
        command: playlist
        parameters:
          - play
          - >-
            http://cbcmp3.ic.llnwd.net/stream/cbcmp3_cbc_r2_vcr
          - CBCR2
          - 30

Not Working (Weekend) Automation

- id: 'Alarm Weekend'
  alias: 'Alarm Weekend'
  trigger:
    - platform: time
      at:
        - "08:30:00"
  condition:
  - condition: time
    weekday:
      - sat
      - sun
  action:
    service: script.turn_on
    entity_id: script.radio_alarm_synphaera

Not Working (Weekend) Script:

radio_alarm_synphaera:
  sequence:
    - service: switch.turn_on
      data:
        entity_id: media_player.radio
    - service: squeezebox.call_method
      data:
        entity_id: media_player.radio
        command: stop
    - service: media_player.volume_set
      data:
        entity_id: media_player.radio
        volume_level: "0.24"
    - service: squeezebox.call_method
      data:
        entity_id: media_player.radio
        command: playlist
        parameters:
          - play
          - >-
            http://somafm.com/nossl/synphaera256.pls
          - Synphaera
          - 30

Now, here’s the REALLY weird part! When the weekend alarm occurs, I see it in the logbook, but for some reason it all looks good but then the radio is turned off. This does not occur with the weekday alarm - i.e. the circled log entry does not appear on weekdays.

Note: The 30 as the last parameter of the squeezebox call is a fade-in time. since the radio turns itself off after 7 seconds, no music is ever heard. Again, this works fine with the weekday alarm.

Screen Shot 2022-04-02 at 9.55.47 AM

Is anyone able to shed light on this strange issue?

Thanks in advance!

Check the automation and script traces:

I checked the trace - it just says “No traces found.” So I added this line to my configureation.yaml and restarted HASS:

trace:

After that, I manually triggered the automation. Still no trace. Will see if there is one tomorrow morning when it runs from its actual trigger.

Here’s something else strange that I forgot to mention earlier: when I manually trigger the automation it works fine every time. But when it triggers via “naturally” via time, the radio mysteriously turns itself off when the script completes!

You don’t need to do that.

If you have no traces the automations didn’t trigger. Check your log for errors.

I guess the scripts work when started manually, right?
I guess this shouldn’t affect the automation starting or not.

What about deleting/recreating the failing automation?

Adding trace: to my configuration.yaml file seems to have made no difference3, I still have “No traces found.” This is true for the automation that does work as well. Yet, in the image in OP, it would appear that the automations are indeed triggering, yes?

Your automations have to have an id for the trace to work.

Can you play an .pls file?

As you can see in the OP, the automations have IDs.

Re-creating the automation turned out to be the best advice here. I disabled the old one and created a new one using the GUI. Testing it seems to have worked. I won’t know for sure until Saturday morning, LOL. I guess it will remain a mystery why the original weekend one didn’t work…

Thanks everyone for the advice!

The person I was replying to is not OP.