I have a lot of Nest speakers around the house and my kids love to hear music on them, which is awesome. But then I then asks google for something later the that day I get blowed away because they of course didnt lower the volume again.
This is where this Blueprint comes in. It triggers if a speaker (you can choose one og multiple) state enters ‘off’ for a given time (default 1 min) and lowers the speaker to given volume (default 0.3 = 30%)
Blueprint Code
blueprint:
name: Reset speaker volume after music stops
description: After speaker has been turned off for x minutes it will has its volume reset to x
domain: automation
input:
media_player:
name: Media Players
description: Select a media player or multiple media players
selector:
entity:
domain: media_player
offtime:
name: Off time
description: How long should the media player be off for before we reset the volume?
default: '00:01:00'
selector:
time:
reset_volume:
name: Reset volume
description: The volume you want your media player to be reset to
default: 0.3
selector:
number:
min: 0
max: 1
step: 0.1
mode: slider
trigger:
platform: state
entity_id: !input media_player
from: 'playing'
for: !input offtime
action:
- service: media_player.volume_set
data:
entity_id: '{{ trigger.entity_id }}'
volume_level: !input reset_volume
Changelog:
2021-02-19: removed to: ‘off’ from trigger to handle more speaker types