-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathButton_Card_Fan.yaml
29 lines (28 loc) · 1.05 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
type: custom:button-card
entity: switch.fan_bedroom_master
triggers_update: all
name: |
[[[ return entity.entity_id.slice(11).charAt().toUpperCase() +
entity.entity_id.slice(12,-7) + " Fan" ]]]
state_display: 'on'
state:
- value: 'on'
styles:
card:
- background: radial-gradient(circle, rgb(0,0,0, 10%), rgb(18, 81, 219, 60%))
- box-shadow: 0px 0px 20px rgb(31, 128, 240, 0)
icon:
- animation: |
[[[ var name = "number.fan_" + entity.entity_id.slice(11).charAt() +
entity.entity_id.slice(12,-7) + "_speed"
if (states[name].state == 1) return 'rotating 3s linear infinite'
if (states[name].state == 2) return 'rotating 1s linear infinite'
if (states[name].state == 3) return 'rotating .5s linear infinite' ]]]
styles:
card:
- font-size: 30px
double_tap_action:
action: more-info
entity: |
[[[ return "number.fan_" + entity.entity_id.slice(11).charAt() +
entity.entity_id.slice(12,-7) + "_speed" ]]]