cover-element
cover-element copied to clipboard
Cover Element
An element that allows cover/blinds control in a Home Assistant picture-elements card.
Using the card
Element options
| 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 |
Position_label object
| 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. |
Example usage
- 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%
Install
Simple install
-
Download and copy
cover-element-bundle.jsfrom the latest release into yourconfig/wwwdirectory. -
Add a reference to
cover-element-bundle.jsin 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))
CLI install
-
Move into your
config/wwwdirectory -
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.jsinside yourui-lovelace.yaml.
resources:
- url: /local/cover-element-bundle.js?v=0.3.0
type: module
(Optional) Add to custom updater
-
Make sure you have the custom_updater component installed and working.
-
Add a new reference under
card_urlsin yourcustom_updaterconfiguration inconfiguration.yaml. //todo: implement tracker
custom_updater:
card_urls:
- https://raw.githubusercontent.com/custom-cards/cover-element/master/tracker.json
Updating
-
Find your
cover-element-bundle.jsfile inconfig/wwwor 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.yamllike 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.
Getting errors?
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
License
This project is under the Apache 2.0 license.