Can you let me know what is wrong with my volume set action. The volume level is not working
######################################################################################################################################
#description: Anyone Arives To House.
#trigger(s): chris or kim is set to home.
#condition(s): none
#action: set thermostats to resume, turn off vacation mode, turn off the pet music
######################################################################################################################################
- alias: "Arriving - Someone Arrives At Any Time"
trigger:
- platform: state
entity_id: input_boolean.chris_leave_switch
to: 'off'
- platform: state
entity_id: input_boolean.kim_leave_switch
to: 'off'
action:
- service: media_player.media_pause
entity_id: media_player.everywhere
- service: climate.ecobee_resume_program
data:
resume_all: 'true'
- service: input_boolean.turn_off
entity_id: input_boolean.vacation_switch
- service: media_player.volume_set
data_template:
data:
entity_id: media_player.everywhere
volume_level: >
{% set hr = now().hour %}
{% if hr > 19 %} 0.3
{% elif hr < 10 %} 0.3
{% else %} 0.5
{% endif %}
Thanks