I have the automation working to change volume. I just can’t figure out how to get the devices current volume, set it to a var and then at the end, set the volume back to what it was before the automation.
Any ideas? TIA!
alias: Doorbell Announce Button Press
description: Announce when the doorbell is pressed.
trigger:
- platform: mqtt
topic: DahuaVTO/PhoneCallDetect/Event
payload: Start
value_template: "{{ value_json.Action }}"
condition: []
action:
- if:
- condition: time
after: "07:00:00"
before: "18:00:00"
enabled: true
weekday:
- sun
- mon
- tue
- wed
- thu
- fri
- sat
then:
- service: media_player.volume_set
metadata: {}
data:
volume_level: 0.75
target:
device_id:
- 781fe5cda2577a5968a1310ce44fd56e
- service: notify.alexa_media_tyler_s_echo_dot
data:
message: DING DONG! Doorbell pressed! DING DONG! Doorbell pressed!
- service: media_player.volume_set
metadata: {}
data:
volume_level: 1
target:
device_id: e203de1a130ef044d8f1f451dc195f01
- service: notify.alexa_media_tyler_s_ecobee_smartthermostat_with_voice_control
data:
message: DING DONG! Doorbell button pressed! DING DONG! Doorbell button pressed!
mode: single