๐ Templatable Configuration Card
Hey dude! Help me out for a couple of ๐ป or a โ!
This card is for Lovelace on Home Assistant that allows you to use pretty much any valid Javascript on the hass object in your configuration
Name | Type | Requirement | Description |
---|---|---|---|
type | string | Required | custom:config-template-card |
config | object | Required | Card object |
Save config-template-card to <config directory>/www/config-template-card.js
on your Home Assistant instanse.
Example:
wget https://raw.githubusercontent.com/custom-cards/config-template-card/master/dist/config-template-card.js
mv config-template-card.js /config/www/
Link config-template-card
inside your ui-lovelace.yaml
or Raw Editor in the UI Editor
resources:
- url: /local/config-template-card.js
type: module
Add a custom element in your ui-lovelace.yaml
or in the UI Editor as a Manual Card
this.hass
- The hass object
states
- The states object
user
- The user object
type: 'custom:config-template-card'
config:
type: >-
${states['light.bed_light'].state === 'on' ? 'custom:hui-glance-card' :
'custom:hui-entities-card' }
entities:
- entity: alarm_control_panel.ha_alarm
name: >-
${states['cover.garage_door'].state === 'open' &&
states['alarm_control_panel.ha_alarm'].state === 'armed_home' ? 'Close
the garage!' : '' }
- entity: binary_sensor.basement_floor_wet
- entity: climate.ecobee
name: >-
${states['climate.ecobee'].attributes.current_temperature > 22 ? 'Cozy'
: 'Too Hot/Cold'}
- entity: cover.garage_door
- entity: >-
${ states['light.bed_light'].state === 'on' ? 'light.bed_light' :
'climate.ecobee' }
icon: '${states[''cover.garage_door''].state === ''open'' ? ''mdi:hotel'' : '''' }'