For the life of me, I cant get the state animation to work, even when following the docs to the letter. https://github.com/custom-cards/button-card?tab=readme-ov-file#configuration-with-states
I'm wrapping the custom:button-card inside a conditional card:
- type: conditional
conditions:
- entity: light.livingroom_ceiling_fan
state_not: unavailable
card:
type: custom:button-card
entity: light.livingroom_ceiling_fan
name: Ceiling Fan
template: fan-button
icon: mdi:fan
aspect_ratio: 1/1.1
hold_action:
action: more-info
As for the animation, the docs say to do this:
- type: conditional
conditions:
- entity: light.livingroom_ceiling_fan
state_not: unavailable
card:
type: custom:button-card
entity: light.livingroom_ceiling_fan
name: Ceiling Fan
template: fan-button
icon: mdi:fan
aspect_ratio: 1/1.1
hold_action:
action: more-info
state:
- value: 'on'
styles:
icon:
- spin: true
however, this does not work.
If I remove the state: requirement, and move the styles: to the same level as the rest of the card options, then the icon spins.
I know using a 'light' entity for a fan is non-standard, this is a dimmer switch flashed to ESPhome presenting the dimmer as a brightness value.
I've verified the state of the entity is actually 'on' when the entity is on:
[<template TemplateState(<state light.livingroom_ceiling_fan=on; supported_color_modes=[<ColorMode.BRIGHTNESS: 'brightness'>], color_mode=brightness, brightness=38, icon=mdi:fan, friendly_name=Livingroom Ceiling Fan, supported_features=40 @ 2024-11-01T14:11:02.156155-05:00>)>]