I’m trying to store the volume of 2 mediaplayers (only 1 in this test) when the phone is used to be able to restore it afterwards.
Something is wrong with the data_template part of the action but I cannot find out what.
alias: 'Livingroom: FB'
description: ''
trigger:
- platform: state
entity_id: sensor.fritz_box_call_monitor
from: idle
to: ringing
- platform: state
entity_id: sensor.fritz_box_call_monitor
from: idle
to: dialing
- platform: state
entity_id: sensor.fritz_box_call_monitor
from: idle
to: talking
condition:
- condition: state
state: playing
entity_id: media_player.living
action:
- data_template:
scene_id: beforecall
snapshot_entities:
- light.dl1
entities:
media_player.living:
volume_level: '{{ state_attr("media_player.living", "volume_level") }}'
service: scene.create
- service: media_player.volume_set
target:
entity_id: media_player.living
data:
volume_level: 0.05
mode: single
These are the step details:
params:
domain: scene
service: create
service_data:
scene_id: beforecall
snapshot_entities:
- light.dl1
entities:
media_player.living:
volume_level: 0.08
target: {}
running_script: false
limit: 10
Is the ‘snapshot_entities’ entry needed to make this work?