Service Template is what I was looking for. Thanks! Now, the Xiaomi cube can turn down the volume on my receiver, if it’s on.
- alias: Cube Dimmer (Volume)
trigger:
platform: event
event_type: cube_action
event_data:
entity_id: binary_sensor.cube
action_type: rotate
condition:
condition: state
entity_id: switch.avr_power
state: 'on'
action:
service_template: >
{% if trigger.event.data.action_value | float > 0 %}
switch.turn_on
{% else %}
switch.turn_off
{% endif %}
entity_id: switch.avr_volume