Problems with an automation not working under certain circumstances

Hello! I’m having an issue with an automation that I can’t figure out. I have a Sonos Connect connected to my Pioneer receiver. The problem is that when I start the connect playing, I also have to turn on the receiver, set it to the right input and adjust the volume. So I set up an automation to accomplish this. It action sequence works completely fine when I trigger the automation manually, but the trigger only seems to be working when I start the Sonos playing from the control in my Hass.io interface. If I start the sonos playing from my sonos or spotify app on my iphone, it doesn’t turn the receiver on, DESPITE the automation actually firing according to my log. I can’t figure out where the disconnect is. Anyone have any ideas?

Here is the automation. It is built inside the hass.io editor, which is why it’s in the weird backwards format.

- action:
  - data:
      entity_id: media_player.pioneer_avr
    service: media_player.turn_on
  - delay: 00:00:10
  - data:
      entity_id: media_player.pioneer_avr
      source: CD
    service: media_player.select_source
  - delay: 00:00:03
  - data:
      entity_id: media_player.pioneer_avr
      volume_level: 0.7
    service: media_player.volume_set
  alias: Receiver On for Sonos
  condition: []
  id: '1513744699371'
  trigger:
  - entity_id: media_player.living_room
    platform: state
    to: playing

My log is showing these errors:

2018-01-06 11:26:03 WARNING (SyncWorker_7) [homeassistant.components.media_player.pioneer] Pioneer Pioneer AVR refused connection
2018-01-06 11:26:13 WARNING (SyncWorker_6) [homeassistant.components.media_player.pioneer] Pioneer Pioneer AVR refused connection
2018-01-06 11:26:17 WARNING (SyncWorker_19)

That’s at the heart of your problem - try turning the power off, waiting 30 seconds, turn it back on, and see if that helps.

Well, like I said, the automation works fine when triggered manually in hass.io, or if I hit play on the Sonos Hass.io card.

Its quite a while ago, but did you have a solution found? I’m having the same problem…

Well, as your system isn’t the OPs system, probably yous isn’t exactly the same. Of course, we don’t know, because you haven’t told us exactly what’s happening…