Is there a way to get the state_detail from switch.coffee_maker? I tried my automation template:
- alias: "Coffee Brewed - Turn On Lights"
trigger:
platform: template
value_template: "{% if is_state('states.switch.coffeemaker.attributes.state_detail', 'Brewed') %}true{% endif %}"
action:
service: light.turn_on
entity_id: light.living_room_floor_lamps
data:
brightness: 255
And it did nothing until I open up “Coffee Brewed” (actually, I made tea) and clicked in “Trigger” link. Then the light will turn on, but it does not look like the template trigger happens automatically.
What would be the solution if I want to use attributes instead of determining on/off states?
Update: OH! Maybe I should use is_state_attr as listed in documentation:
Somehow, I glanced over that. Will try it again the next day. Maybe I could change “Brewed” to “Refill” and see how that works.