How to Trigger from media_player attributes changes

Hi
i have an input slider who control media_player volume.
i need to update this slider from the media_player.attributes.volume_level when it is change from another source.
so to prevent a loop i came with the idea of when update take place i will disable automation and reenable it when done.
i dont know how to trigger from media_player.attributes.volume_level

any idea that can help ?

Don’t bother with your solution, just add a condition that checks the value of the slider does not equal the value of the media player volume. That way, if they aren’t equal, it will execute the action. If they are equal, it won’t execute the action. No feedback loop!

condition:
  - condition: template
    value_template: "{{ state_attr('media_player.x','volume_level') != state('input_number.x') }}"
1 Like

Great !!
Thank you @petro !!

1 Like