Custom-chip Garage
¶
Custom-chip Garage
is a chip showing the status of a garage door.
INSERT IMAGES
Credits¶
Author: Vincent Lape - 2023 Credits: THe basis of this chip was derived from built-in Alarm chip Version: 1.0.0
Changelog¶
1.0.0
Initial releaseUsage¶
- type: 'custom:button-card'
template: chip_garage
entity: cover.garage_door
Requirements¶
Variables¶
Variable | Default | Required | Notes |
---|---|---|---|
entity | Yes | Garage door entity |
Template code¶
Template Code
custom_chip_vlape_garage.yaml
---
### custom_chip_vlape_garage ###
chip_garage:
template:
- "chip_icon_label"
- "ulm_translation_engine"
label: "[[[ return variables.ulm_translation_state ]]]"
icon: |
[[[
var state = entity.state.toLowerCase();
var garage_icon = {
"default": "mdi:garage",
"closed": "mdi:garage",
"open": "mdi:garage-open"
}
return (garage_icon[state] || garage_icon["default"]);
]]]
styles:
icon:
- color: |
[[[
var state = entity.state.toLowerCase();
var garage_color = {
"default": "var(--google-green)",
"closed": "var(--google-green)",
"open": "var(--google-red)"
}
return (garage_color[state] || garage_color["default"]);
]]]