An element that allows cover/blinds control in a Home Assistant picture-elements card.
Name | Type | Default | Since | Description |
---|---|---|---|---|
type | string | required | v0.1 | custom:cover-element |
entity | string | required | v0.1 | Cover entity to control. |
label | string | v0.3 | Heading label |
Name | Type | Default | Since | Description |
---|---|---|---|---|
show | boolean | false | v0.1 | Show the current position of the cover. |
open_text | string | open | v0.1 | Sets the text to show when cover is fully open. |
closed_text | string | closed | v0.1 | Sets the text to show when cover is fully closed. |
interim_text | string | open | v0.1 | Sets the text to show when cover is partially open. |
- type: picture-elements
image: /local/LivingRoom.jpg
elements:
- type: 'custom:cover-element'
entity: cover.livingroom_terrace_shutter
position_label:
show: true
open_text: open
closed_text: closed
interim_text: open
style:
top: 40%
height: 15%
background-color: 'rgba(255, 255, 255, 0.6)'
width: 23%
border-radius: 10px
left: 53%
-
Download and copy
cover-element-bundle.js
from the latest release into yourconfig/www
directory. -
Add a reference to
cover-element-bundle.js
in lovelace.
resources:
- url: /local/cover-element-bundle.js?v=0.3.0
type: module
To do this, go to Configure UI -> Raw Config Editor and paste this under resources or use YAML Mode (not recommended))
-
Move into your
config/www
directory -
Grab
cover-element-bundle.js
$ wget https://github.com/custom-cards/cover-element/releases/download/0.3.0/cover-element-bundle.js
- Add a reference to
cover-element-bundle.js
inside yourui-lovelace.yaml
.
resources:
- url: /local/cover-element-bundle.js?v=0.3.0
type: module
-
Make sure you have the custom_updater component installed and working.
-
Add a new reference under
card_urls
in yourcustom_updater
configuration inconfiguration.yaml
. //todo: implement tracker
custom_updater:
card_urls:
- https://raw.githubusercontent.com/custom-cards/cover-element/master/tracker.json
-
Find your
cover-element-bundle.js
file inconfig/www
or wherever you ended up storing it. -
Replace the local file with the latest one attached in the latest release.
-
Add the new version number to the end of the cards reference url in your
ui-lovelace.yaml
like below.
resources:
- url: /local/cover-element-bundle.js?v=0.3.0
type: module
You may need to empty the browsers cache if you have problems loading the updated card.
Make sure you have javascript_version: latest
in your configuration.yaml
under frontend:
.
Make sure you have the latest version of cover-element-bundle.js
.
If you have issues after updating the card, try clearing your browsers cache or restart Home Assistant.
If you get "Custom element doesn't exist: cover-element" or running older browsers try replacing type: module
with type: js
in your resource reference, like below.
resources:
- url: ...
type: js
This project is under the Apache 2.0 license.