First of all, really excited to begin playing around with HA. I hope one day, I’ll be able to contribute back to the community but right now I’m stuck with something seemingly basic:
High Level Aim: Trigger events based on attribute changes e.g. volume change on a media player
I’ve looked at templating and followed a number of examples on the forums to no joy. Here’s what I have:
automation:
- alias: Sync Play1 with AV Receiver Volume
initial_state: True
hide_entity: False
trigger:
platform: numeric_state
value_template: “{{ states.media_player.yamaha_receiver.attributes.volume_level | float}}”
below: 0.5
action:
service: media_player.volume_set
entity_id: media_player.living_room
data:
volume_level: 0.9
(appreciate this example looks entirely pointless, but it’s just to prove a concept)
I’ve heard that using template triggers is inefficient and risky so I’d like to avoid that if I can. In the debugger, the template evaluates to the correct value (albeit, surrounded in quotes). Tried without quotes and then HA wouldn’t even start up.
Any advice would be much appreciated?