I want to create a button that calls a service and passes some data with the state of some other entity and I’m very confused. When I call it from the developer tools it works. But when I pass this config to be called when I press a button it doesn’t.
Here’s the service config:
service: babybuddy.add_diaper_change
target:
entity_id: sensor.baby
service_data:
color: '{{ states("select.baby_buddy_diaper_color") }}'
type: '{{ states("select.baby_buddy_diaper_type") }}'
When I use this in a button it says the color
and type
must be a valid option from the select. For some reason the template is not rendering the correct value… Does anyone have a clue on what’s wrong here?