I have tried to figure this out without luck. How the volume_level parameter should be passed to the script? By using just e.g. ‘0.1’ it works and the script works, but I would like to pass the current value of Denon. How is that done? The idea is to set volume back to previous state after playing doorbell ring.
Automation:
- id: '1581843050087'
alias: Doorbell_ring
description: ''
trigger:
- device_id: 643c2a1d61c541be95663a3af017c9be
domain: binary_sensor
entity_id: binary_sensor.vibration_8
platform: device
type: vibration
condition: []
action:
- data:
variables:
volume_level: "{{states.media_player.denon.attributes.volume_level}}"
entity_id: script.1595949689021
service: script.turn_on