I have setup the below code to play a door bell noise via the sonos speakers when the back gate gets opened.
Only issue is when listening to music the door bell will kick in, but I then have to put music back on. is there a way that I can go back to previously track after door bell has been played ?
- alias: doorbell
trigger:- platform: state
entity_id: binary_sensor.aeotec_zw089_recessed_door_sensor_gen5_sensor_11_0
to: ‘on’
action: - service: media_player.volume_set
data:
entity_id: media_player.family_room
volume_level: 0.75 - service: media_player.play_media
data:
entity_id: media_player.dining_room
media_content_id: http://XXX.XXX.XX.XX:8123/local/doorbell-1.mp3
media_content_type: music
- platform: state