-
Notifications
You must be signed in to change notification settings - Fork 0
/
Button_Card_Fan.yaml
31 lines (31 loc) · 1.19 KB
/
Button_Card_Fan.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
type: vertical-stack
cards:
- type: custom:button-card
entity: fan.bedroom
triggers_update: all
name: >
[[[ return "Fan " + entity.entity_id.split(".")[1].charAt().toUpperCase()
+ entity.entity_id.split(".")[1].slice(1) ]]]
state_display: 'on'
state:
- value: 'on'
styles:
icon:
- color: |
[[[
if (states[entity.entity_id].attributes.percentage == 33) return 'green'
if (states[entity.entity_id].attributes.percentage == 66) return 'blue'
if (states[entity.entity_id].attributes.percentage == 100) return 'red'
]]]
- animation: |
[[[
if (states[entity.entity_id].attributes.percentage == 33) return 'rotating 3s linear infinite'
if (states[entity.entity_id].attributes.percentage == 66) return 'rotating 1s linear infinite'
if (states[entity.entity_id].attributes.percentage == 100) return 'rotating .5s linear infinite'
]]]
hold_action:
action: more-info
- type: entities
entities:
- entity: number.fan_bedroom_speed
name: Speed