Could someone point me to a solution? I know I have to select a attribute, but how?
I don’t understand some parameters and am missing documented details.
Thank you!
€dit:
I tired kind like this:
## note - hoolio is the name of my squuezebox media player
alias: Hoolio begins playing
trigger:
- platform: state
entity_id: media_player.hoolio
to: 'playing'
from: 'idle'
- platform: state
entity_id: media_player.hoolio
to: 'playing'
from: 'off'
action:
- service: media_player.turn_on
#change this to match your AVR
entity_id: media_player.kitchen_avr
- service: media_player.select_source
data:
#change this to match your AVR
entity_id: media_player.kitchen_avr
source: AV4
Where do you think this is breaking? The trigger or the action?
Here’s an automation I use to automatically turn on my receiver whenever SqueezePlay (a media_server) starts playing. I’m using the new Harmony/remote component. You can change that action to a light.turn_on…
Use the states dev tool (icon at bottom of sidebar) to see the actual states of your media_player as you start/stop it.
- alias: SqueezePlay begins playing
trigger:
- platform: state
entity_id: media_player.squeezeplay
to: 'playing'
from: 'idle'
- platform: state
entity_id: media_player.squeezeplay
to: 'playing'
from: 'off'
action:
- service: remote.turn_on
entity_id: remote.livingroom
data:
activity: 'Listen to Music'
okay, that was not precise enough. Sorry. Seems I’m not a true German
I think the problem is the trigger. It should be an event, but as it is just a state and HASS does not always get the state fast enough, I think it should be an event. So triggered from the receiver.
If I trigger it via GUI, the action takes place.
long time no read. The solution is pretty simple. Instead asking the receiver for it’s source, I check the state of the media_player and trigger there the action like @ih8gates said.
- alias: AAA Change light when watching a movie #no idea why it doesn't work
initial_state: True
hide_entity: False
trigger:
- platform: state
entity_id: media_player.kodi
state: 'playing'
- platform: state
entity_id: media_player.FireTV
state: 'playing'
condition:
condition: state
entity_id: sun.sun
state: 'below_horizon'
action:
service: scene.turn_on
entity_id: scene.movies