diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 8fd9d3b2b..aac251486 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -26,3 +26,13 @@ If applicable, add screenshots to help explain your problem. **Additional context** Add any other context about the problem here. + +**Related Logs** (can be found in the browser-console (F12)) +Add related logs for the problem + +**Related Card Config** +Add the card config from `ui-lovelace.yaml` with the related problem + +```yaml +paste the yaml code here +``` diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..855a4dd36 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,28 @@ + + +## Additional information + + +- This PR fixes or closes issue: fixes # +- This PR is related to issue: +- Link to documentation pull request: + +## Checklist + + +- [ ] The code change is tested and works locally. +- [ ] There is no commented out code in this PR. +- [ ] I have followed the [contribution guidelines](https://github.com/UI-Lovelace-Minimalist/UI/blob/main/.github/CONTRIBUTING.md) + - [ ] This PR is for a custom-card or documentation change and therefore directed to the `main` branch. + - [ ] This PR is for a official card or any other directly to the integration related change and therefore directed to the `release` branch. diff --git a/.github/workflows/automatic-custom-card-docs.yml b/.github/workflows/automatic-custom-card-docs.yml index 0431b8d85..a92327fbe 100644 --- a/.github/workflows/automatic-custom-card-docs.yml +++ b/.github/workflows/automatic-custom-card-docs.yml @@ -5,13 +5,13 @@ on: push: # Should only run on "dev" when new cards are submitted via PR branches: ["main"] - paths: ["custom_cards/*/README.md"] + paths: ["custom_cards/*/README.md", "docs/"] jobs: docit: runs-on: "ubuntu-latest" steps: - - uses: "actions/checkout@v2" + - uses: "actions/checkout@v3" with: fetch-depth: 0 - name: "Copy and rename README.md files" @@ -24,14 +24,14 @@ jobs: cp "${dirname}/$filename" "./docs/usage/custom_cards/${foldername}.md" done - name: "Find and replace asset paths" - uses: "jacobtomlinson/gha-find-replace@v2" + uses: "jacobtomlinson/gha-find-replace@v3" with: find: "../../docs/assets/img" replace: "../../assets/img" include: "docs/usage/custom_cards/**" regex: true - name: "Create Pull Request" - uses: "peter-evans/create-pull-request@v3" + uses: "peter-evans/create-pull-request@v5" with: token: "${{ secrets.GITHUB_TOKEN }}" branch: "automated_custom_card_docs" diff --git a/.github/workflows/check-code-quality.yml b/.github/workflows/check-code-quality.yml index a39235b74..2583600cb 100644 --- a/.github/workflows/check-code-quality.yml +++ b/.github/workflows/check-code-quality.yml @@ -11,9 +11,9 @@ jobs: runs-on: "ubuntu-latest" steps: - name: "⤵️ Check out code from GitHub" - uses: "actions/checkout@v2" + uses: "actions/checkout@v3" - name: "⚙️ Set up Python" - uses: "actions/setup-python@v2" + uses: "actions/setup-python@v4" with: python-version: 3.8 - name: "⚙️ Set up Ruby" @@ -22,4 +22,4 @@ jobs: ruby-version: 2.7 bundler-cache: true - name: "\U0001F680 Run pre-commit" - uses: "pre-commit/action@v2.0.3" + uses: "pre-commit/action@v3.0.0" diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 54269e749..f54dfd08b 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -34,7 +34,7 @@ jobs: steps: - name: "Checkout repository" - uses: "actions/checkout@v2" + uses: "actions/checkout@v3" # Initializes the CodeQL tools for scanning. - name: "Initialize CodeQL" diff --git a/.github/workflows/hacs-validate.yml b/.github/workflows/hacs-validate.yml index fc59895ed..d9a19e621 100644 --- a/.github/workflows/hacs-validate.yml +++ b/.github/workflows/hacs-validate.yml @@ -13,7 +13,7 @@ jobs: runs-on: "ubuntu-latest" steps: - name: "checkout" - uses: "actions/checkout@v2" + uses: "actions/checkout@v3" - name: "validation" uses: "home-assistant/actions/hassfest@master" @@ -22,7 +22,7 @@ jobs: runs-on: "ubuntu-latest" steps: - name: "checkout" - uses: "actions/checkout@v2" + uses: "actions/checkout@v3" - name: "validation" uses: "hacs/action@main" with: diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 23ddb522b..a782ee3b6 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -12,8 +12,8 @@ jobs: runs-on: "ubuntu-latest" steps: - name: "⤵️ Check out code from GitHub" - uses: "actions/checkout@v2" + uses: "actions/checkout@v3" - name: "\U0001F680 Run Labeler" - uses: "crazy-max/ghaction-github-labeler@v3.1.1" + uses: "crazy-max/ghaction-github-labeler@v4" with: skip-delete: false diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 4b4cbea3c..d03239b40 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -10,9 +10,11 @@ jobs: deploy: runs-on: "ubuntu-latest" steps: - - uses: "actions/checkout@v2" - - uses: "actions/setup-python@v2" + - uses: "actions/checkout@v3" with: - python-version: "3.x" + node-version: "16.x" + - uses: "actions/setup-python@v4" + with: + python-version: "3.11" - run: "pip install mkdocs-material mkdocs-awesome-pages-plugin" - run: "mkdocs gh-deploy --force" diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 3b51be2cb..43910e228 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -11,6 +11,6 @@ jobs: runs-on: "ubuntu-latest" steps: - name: "Run release-drafter" - uses: "release-drafter/release-drafter@v5.15.0" + uses: "release-drafter/release-drafter@v5" env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f38cfbe44..3196cc7e6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ jobs: runs-on: "ubuntu-latest" steps: - name: "Check out repository" - uses: "actions/checkout@v2" + uses: "actions/checkout@v3" - name: "Get version" id: "version" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 467dca43a..d9b4023f0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -73,10 +73,10 @@ repos: - id: "pyupgrade" args: ["--py39-plus"] - - repo: "https://github.com/pre-commit/mirrors-isort" - rev: "v5.10.1" + - repo: https://github.com/pycqa/isort + rev: 5.12.0 hooks: - - id: "isort" + - id: isort - repo: "https://github.com/psf/black" rev: "22.3.0" diff --git a/README.md b/README.md index 1691f05d7..9cfc8928f 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,18 @@ ![hacs installs](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Flauwbier.nl%2Fhacs%2Fui_lovelace_minimalist) ![Downloads](https://img.shields.io/github/downloads/UI-Lovelace-Minimalist/UI/total) +> [!IMPORTANT] +> Looking for New Maintainers! +> +> This project is in need of new maintainers! The current maintainers are no longer actively working on it, and without fresh leadership, we may be forced to shut down the project and its associated Discord server. +> +> If you're passionate about this project and would like to take over its development and community management, we’d love to hear from you! +> +> - Join us on Discord to discuss further: [Thread Message](https://discord.com/channels/923363055444832296/928986459975876668/1314292139139534979) +> - Or reach out on GitHub Discussions: [GitHub discussion](https://github.com/UI-Lovelace-Minimalist/UI/discussions/1560) +> +> Thank you for considering helping keep this project alive and thriving! 🙌 + It's kind of hard to explain what this is, so let's call it a "theme" (in quotation marks). But one thing is for sure, it is very nice! Taking the exceptional work of tben as a basis, this repository is aimed to ease installation and maintenance of his wonderful work. You can use this interpretation of a SmartHomeUI more or less like a theme in HomeAssistant. diff --git a/custom_cards/custom_card_alarm_time/README.md b/custom_cards/custom_card_alarm_time/README.md new file mode 100644 index 000000000..cdb8cb311 --- /dev/null +++ b/custom_cards/custom_card_alarm_time/README.md @@ -0,0 +1,112 @@ +--- +title: Alarm Time Custom-card +--- + + + +# Custom-card "Alarm Time Card" + +The `card_alarm_time` you can control a input_datetime entity and a boolean. +This card is useful for setting alarms (e.g. wakeup alarm), as you can modify the time and toggle the state of the alarm from one card. + +## Credits + +Author: benbur - 2023 +Version: 1.0.0 + +This is built largely on top of the original Input_Datetime Card: +Author: sildehoop - 2022 +Version: 1.0.0 + +## Changelog + +
+1.0.0 +Initial Release +
+ +## Variables + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
VariableExampleRequiredDefaultExplanation
ulm_card_alarm_time_name'Morning Alarm'noSet Custom Name
ulm_card_alarm_time_icon'mdi:alarm'noSet Custom Icon
ulm_card_alarm_time_color'green'no'blue'Set Custom Color for Card Elements
ulm_card_alarm_time_force_background_colortruenofalseForce Background Color in Light Mode/td> +
ulm_card_alarm_time_collapsetruenofalseMake card collapsible when off
ulm_card_alarm_time_horizontaltruenofalseHorizontal Mode for the Card
ulm_card_alarm_time_step'30'no15Set Adjust Time (minutes)
+ +## Usage + +```yaml +- type: "custom:button-card" + template: card_alarm_time + entity: input_boolean.morning_alarm_toggle + variables: + ulm_card_alarm_time_datetime: input_datetime.morning_alarm_time + ulm_card_alarm_time_horizontal: true + ulm_card_alarm_time_collapse: true +``` + +## Requirements + +Input DateTime Helper +Input Boolean + +## Template code + +??? note "Template Code" + + ```yaml title="custom_card_alarm_time.yaml" + --8<-- "custom_cards/custom_card_alarm_time/card_alarm_time.yaml" + ``` diff --git a/custom_cards/custom_card_alarm_time/card_alarm_time.yaml b/custom_cards/custom_card_alarm_time/card_alarm_time.yaml new file mode 100644 index 000000000..15e355be0 --- /dev/null +++ b/custom_cards/custom_card_alarm_time/card_alarm_time.yaml @@ -0,0 +1,303 @@ +--- +### Card Alarm ### +card_alarm_time: + triggers_update: "all" + template: + - "icon_more_info_new" + variables: + ulm_card_alarm_time_name: "[[[ return entity.attributes.friendly_name ]]]" + ulm_card_alarm_time_icon: "[[[ return entity.attributes.icon ]]]" + ulm_card_alarm_time_horizontal: false + ulm_card_alarm_time_collapse: false + ulm_card_alarm_time_color: "blue" + ulm_card_alarm_time_force_background_color: false + ulm_card_alarm_time_step: 15 + show_icon: false + show_name: false + show_label: false + state: + - value: "on" + styles: + card: + - background-color: > + [[[ + if (variables.ulm_card_alarm_time_force_background_color || hass.themes.darkMode) { + var color = variables.ulm_card_alarm_time_color; + return 'rgba(var(--color-' + color + '),var(--opacity-bg))'; + } + ]]] + styles: + grid: + - grid-template-areas: > + [[[ + if (entity.state != "on" && variables.ulm_card_alarm_time_collapse) { + return "\"item1\""; + } + if (variables.ulm_card_alarm_time_horizontal) { + return "\"item1 item2\""; + } + return "\"item1\" \"item2\""; + ]]] + - grid-template-columns: > + [[[ + if (variables.ulm_card_alarm_time_horizontal) { + return "1fr 1fr"; + } + return "1fr"; + ]]] + - grid-template-rows: > + [[[ + if (variables.ulm_card_alarm_time_horizontal || (entity.state != "on" && variables.ulm_card_alarm_time_collapse)) { + return "1fr"; + } + return "min-content min-content"; + ]]] + - row-gap: "12px" + card: + - border-radius: "var(--border-radius)" + - box-shadow: "var(--box-shadow)" + - padding: "12px" + custom_fields: + item2: + - display: > + [[[ + if (entity.state != "off") { + return "block"; + } + return "none"; + ]]] + custom_fields: + item1: + card: + type: "custom:button-card" + custom_fields: + item1: + card: + type: "custom:button-card" + entity: "[[[ return entity.entity_id ]]]" + icon: "[[[ return variables.ulm_card_alarm_time_icon ]]]" + styles: + icon: + - color: > + [[[ + var color = variables.ulm_card_alarm_time_color; + if (typeof entity !== "undefined") { + if (entity.state != "off") { + return 'rgba(var(--color-' + color + '),1)'; + } + } + return 'rgba(var(--color-theme),0.2)'; + ]]] + img_cell: + - background-color: > + [[[ + var color = variables.ulm_card_alarm_time_color; + if (typeof entity !== "undefined") { + if (entity.state != "off") { + return 'rgba(var(--color-' + color + '),0.2)'; + } + } + return 'rgba(var(--color-theme),0.05)'; + ]]] + item2: + card: + type: "custom:button-card" + entity: "[[[ return entity.entity_id ]]]" + name: "[[[ return variables.ulm_card_alarm_time_name ]]]" + label: > + [[[ + if (entity.state == "on") { + return "On"; + } else if (entity.state == "off") { + return "Off"; + } + ]]] + state: + - value: "on" + styles: + name: + - color: > + [[[ + if (variables.ulm_card_alarm_time_force_background_color) { + return 'rgb(250,250,250)'; + } + ]]] + label: + - color: > + [[[ + if (variables.ulm_card_alarm_time_force_background_color) { + return 'rgb(250,250,250)'; + } + ]]] + item2: + card: + type: "custom:button-card" + template: "list_3_items" + styles: + card: + - background: "none" + grid: + - grid-template-areas: > + [[[ + if (variables.ulm_card_alarm_time_horizontal) { + return "'item2'"; + } else { + return "'item1 item2 item3'"; + } + ]]] + - grid-template-columns: > + [[[ + if (variables.ulm_card_alarm_time_horizontal) { + return "1fr"; + } else { + return "1fr 1fr 1fr"; + } + ]]] + custom_fields: + item1: + - display: > + [[[ + if (variables.ulm_card_alarm_time_horizontal) { + return "none"; + } + return "block"; + ]]] + item3: + - display: > + [[[ + if (variables.ulm_card_alarm_time_horizontal) { + return "none"; + } + return "block"; + ]]] + custom_fields: + item1: + card: + type: "custom:button-card" + template: "widget_icon" + tap_action: + action: "perform-action" + perform_action: "input_datetime.set_datetime" + target: + entity_id: "[[[ return variables.ulm_card_alarm_time_datetime ]]]" + data: + time: > + [[[ + var timestamp = states[variables.ulm_card_alarm_time_datetime].attributes.timestamp; + let time_adjust = (60 + variables.ulm_card_alarm_time_step) * 60; + let new_timestamp = timestamp - time_adjust; + var date = new Date(new_timestamp * 1000); + var hours = date.getHours(); + var minutes = "0" + date.getMinutes(); + var seconds = "0" + date.getSeconds(); + var formattedTime = hours + ':' + minutes.substr(-2) + ':' + seconds.substr(-2); + return formattedTime; + ]]] + icon: "mdi:minus" + styles: + card: + - background-color: > + [[[ + if (!hass.themes.darkMode && variables.ulm_card_alarm_time_force_background_color) { + if (entity.state != "off") { + return 'rgba(250,250,250,0.8)'; + } + } + return 'rgba(var(--color-theme),0.05)'; + ]]] + icon: + - color: > + [[[ + if (!hass.themes.darkMode && variables.ulm_card_alarm_time_force_background_color) { + if (entity.state != "off") { + var color_set = variables.ulm_card_alarm_time_color; + var color = 'rgba(var(--color-' + color_set + '),1)'; + return color; + } + } + return 'rgba(var(--color-theme),0.9)'; + ]]] + + item2: + card: + type: "custom:button-card" + template: + - "widget_icon" + entity: "[[[ return variables.ulm_card_alarm_time_datetime ]]]" + tap_action: + action: "more-info" + show_icon: false + show_label: true + label: "[[[ return states[variables.ulm_card_alarm_time_datetime].state ]]]" + styles: + grid: + - grid-template-areas: "'l'" + card: + - background-color: > + [[[ + if (!hass.themes.darkMode && variables.ulm_card_alarm_time_force_background_color) { + if (entity.state != "off") { + return 'rgba(250,250,250,0.8)'; + } + } + return 'rgba(var(--color-theme),0.05)'; + ]]] + icon: + - color: > + [[[ + if (!hass.themes.darkMode && variables.ulm_card_alarm_time_force_background_color) { + if (entity.state != "off") { + var color_set = variables.ulm_card_alarm_time_color; + var color = 'rgba(var(--color-' + color_set + '),1)'; + return color; + } + } + return 'rgba(var(--color-theme),0.9)'; + ]]] + + item3: + card: + type: "custom:button-card" + template: "widget_icon" + tap_action: + action: "perform-action" + perform_action: "input_datetime.set_datetime" + target: + entity_id: "[[[ return variables.ulm_card_alarm_time_datetime ]]]" + data: + time: > + [[[ + var timestamp = states[variables.ulm_card_alarm_time_datetime].attributes.timestamp; + let time_adjust = (60 - variables.ulm_card_alarm_time_step) * 60; + let new_timestamp = timestamp - time_adjust; + var date = new Date(new_timestamp * 1000); + var hours = date.getHours(); + var minutes = "0" + date.getMinutes(); + var seconds = "0" + date.getSeconds(); + var formattedTime = hours + ':' + minutes.substr(-2) + ':' + seconds.substr(-2); + return formattedTime; + ]]] + icon: "mdi:plus" + styles: + card: + - background-color: > + [[[ + if (!hass.themes.darkMode && variables.ulm_card_alarm_time_force_background_color) { + if (entity.state != "off") { + return 'rgba(250,250,250,0.8)'; + } + } + return 'rgba(var(--color-theme),0.05)'; + ]]] + icon: + - color: > + [[[ + if (!hass.themes.darkMode && variables.ulm_card_alarm_time_force_background_color) { + if (entity.state != "off") { + var color_set = variables.ulm_card_alarm_time_color; + var color = 'rgba(var(--color-' + color_set + '),1)'; + return color; + } + } + return 'rgba(var(--color-theme),0.9)'; + ]]] diff --git a/custom_cards/custom_card_bar_card/README.md b/custom_cards/custom_card_bar_card/README.md index 62b108fd1..6e3d9cd92 100644 --- a/custom_cards/custom_card_bar_card/README.md +++ b/custom_cards/custom_card_bar_card/README.md @@ -78,6 +78,13 @@ This card needs the following to function correctly: Overwrites the sensor name +ulm_custom_card_bar_card_icon +"mdi:icon" +no +Sensor Icon +Overwrites the sensor icon + + ulm_custom_card_bar_card_value true / false no diff --git a/custom_cards/custom_card_bar_card/custom_card_bar_card.yaml b/custom_cards/custom_card_bar_card/custom_card_bar_card.yaml index 3c4a69835..58dd0b13d 100644 --- a/custom_cards/custom_card_bar_card/custom_card_bar_card.yaml +++ b/custom_cards/custom_card_bar_card/custom_card_bar_card.yaml @@ -22,6 +22,7 @@ custom_card_bar_card: - "card_generic" variables: ulm_card_generic_name: "[[[ return variables.ulm_custom_card_bar_card_name != '' ? variables.ulm_custom_card_bar_card_name : '' ]]]" + ulm_card_generic_icon: "[[[ return variables.ulm_custom_card_bar_card_icon != '' ? variables.ulm_custom_card_bar_card_icon : '' ]]]" styles: card: - box-shadow: "none" @@ -43,26 +44,27 @@ custom_card_bar_card: name: "off" min: "[[[ return variables.ulm_custom_card_bar_card_min ]]]" max: "[[[ return variables.ulm_custom_card_bar_card_max ]]]" - style: |- - bar-card-currentbar { - border-radius: 0px !important; - right: 0; - } - bar-card-backgroundbar { - border-radius: 0px !important; - right: 0; - } - #states { - padding: 0; - height: 35px; - } - bar-card-background { - height: 35px !important; - } - bar-card-indicator { - left: 10px; - } - bar-card-value { - font-weight: bold; - font-size: 12px; - } + card_mod: + style: |- + bar-card-currentbar { + border-radius: 0px !important; + right: 0; + } + bar-card-backgroundbar { + border-radius: 0px !important; + right: 0; + } + #states { + padding: 0; + height: 35px; + } + bar-card-background { + height: 35px !important; + } + bar-card-indicator { + left: 10px; + } + bar-card-value { + font-weight: bold; + font-size: 12px; + } diff --git a/custom_cards/custom_card_camera/README.md b/custom_cards/custom_card_camera/README.md index 6c3035ad5..d3ebfbabc 100644 --- a/custom_cards/custom_card_camera/README.md +++ b/custom_cards/custom_card_camera/README.md @@ -19,6 +19,10 @@ Version: 1.0.0 ## Changelog +
+1.0.1 +Added variable to passthough aspect ratio to the picture entity card. Fix minor issues with title. +
1.0.0 Initial release. @@ -35,6 +39,7 @@ Initial release. ulm_custom_card_camera_title: true ulm_custom_card_camera_name: "name" ulm_custom_card_camera_label: "label" + ulm_custom_card_camera_aspect_ratio: '16:9' ``` ## Variables @@ -68,6 +73,13 @@ Initial release. Label of your choice + +ulm_custom_card_camera_aspect_ratio +'16:9' +no + +Aspect ratio of camera entity + ??? note "Template Code" diff --git a/custom_cards/custom_card_camera/custom_card_camera.yaml b/custom_cards/custom_card_camera/custom_card_camera.yaml index a5a5d6c47..218b65f97 100644 --- a/custom_cards/custom_card_camera/custom_card_camera.yaml +++ b/custom_cards/custom_card_camera/custom_card_camera.yaml @@ -40,10 +40,14 @@ custom_card_camera: show_icon: "[[[ return variables.ulm_custom_card_camera_title; ]]]" name: "[[[ return variables.ulm_custom_card_camera_name; ]]]" label: "[[[ return variables.ulm_custom_card_camera_label; ]]]" + tap_action: + action: "more-info" + entity: "[[[ return entity.entity_id ]]]" styles: card: - box-shadow: "none" - padding: "0" + - --mdc-ripple-press-opacity: 0 name: - align-self: "end" - justify-self: "start" @@ -70,5 +74,6 @@ custom_card_camera: entity: "[[[ return entity.entity_id ]]]" show_name: false show_state: false + aspect_ratio: "[[[ return variables.ulm_custom_card_camera_aspect_ratio; ]]]" tap_action: action: "more-info" diff --git a/custom_cards/custom_card_chromecast/custom_card_chromecast.yaml b/custom_cards/custom_card_chromecast/custom_card_chromecast.yaml index 5b8e6757a..c11c1328a 100644 --- a/custom_cards/custom_card_chromecast/custom_card_chromecast.yaml +++ b/custom_cards/custom_card_chromecast/custom_card_chromecast.yaml @@ -9,7 +9,7 @@ card_media_player_chromecast: - "icon_info" - "blue_not_unavailable" - "ulm_translation_engine" - label: "[[[ return variables.ulm_translation_state_unit ]]]" + label: "[[[ return variables.ulm_translation_state ]]]" card_media_player_chromecast_with_controls: variables: ulm_card_media_player_with_controls_name: "No name set" @@ -49,9 +49,9 @@ card_media_player_chromecast_with_controls: type: "custom:button-card" template: "widget_icon" tap_action: - action: "call-service" - service: "media_player.toggle" - service_data: + action: "perform-action" + perform_action: "media_player.toggle" + target: entity_id: "[[[ return variables.ulm_card_media_player_with_controls_entity ]]]" icon: "mdi:power" item2: @@ -60,9 +60,9 @@ card_media_player_chromecast_with_controls: template: "widget_icon" entity: "[[[ return variables.ulm_card_media_player_with_controls_entity ]]]" tap_action: - action: "call-service" - service: "media_player.media_play_pause" - service_data: + action: "perform-action" + perform_action: "media_player.media_play_pause" + target: entity_id: "[[[ return variables.ulm_card_media_player_with_controls_entity ]]]" icon: "mdi:pause" state: @@ -75,9 +75,9 @@ card_media_player_chromecast_with_controls: type: "custom:button-card" template: "widget_icon" tap_action: - action: "call-service" - service: "media_player.toggle" - service_data: + action: "perform-action" + perform_action: "media_player.toggle" + target: entity_id: "[[[ return variables.ulm_card_media_player_with_controls_entity ]]]" icon: "mdi:video-input-hdmi" diff --git a/custom_cards/custom_card_damix48_power_details/languages/sv.yaml b/custom_cards/custom_card_damix48_power_details/languages/sv.yaml new file mode 100644 index 000000000..ef49a2e32 --- /dev/null +++ b/custom_cards/custom_card_damix48_power_details/languages/sv.yaml @@ -0,0 +1,7 @@ +--- +ulm_custom_card_damix48_power_details_language_variables: + variables: + ulm_custom_card_damix48_power_details_hour: "timmen" + ulm_custom_card_damix48_power_details_hours: "timmarna" + ulm_custom_card_damix48_power_details_in_the_last: "Den senaste" + ulm_custom_card_damix48_power_details_in_the_lasts: "De senaste" diff --git a/custom_cards/custom_card_device_tracker/README.md b/custom_cards/custom_card_device_tracker/README.md index 34459197b..622440000 100644 --- a/custom_cards/custom_card_device_tracker/README.md +++ b/custom_cards/custom_card_device_tracker/README.md @@ -7,7 +7,7 @@ hide: ## Description -![example-image](../../docs/assets/img/ulm_cards/custom_card_device_tracker.png){ width="500" } +![example-image](../../docs/assets/img/custom_card_device_tracker.png){ width="500" } The `custom_card_device_tracker` displays presence state of a device according to the provided entity. It allow to display the state of two tracker for this device diff --git a/custom_cards/custom_card_eraycetinay_elapsed_time/custom_card_eraycetinay_elapsed_time.yaml b/custom_cards/custom_card_eraycetinay_elapsed_time/custom_card_eraycetinay_elapsed_time.yaml index 6d7f5283f..eac04aa4c 100644 --- a/custom_cards/custom_card_eraycetinay_elapsed_time/custom_card_eraycetinay_elapsed_time.yaml +++ b/custom_cards/custom_card_eraycetinay_elapsed_time/custom_card_eraycetinay_elapsed_time.yaml @@ -23,15 +23,15 @@ custom_card_eraycetinay_elapsed_time: let text = ''; if(entity.attributes.has_date) { - text += days > 0 ? days + ' ' + (days > 1 ? variables.custom_card_eraycetinay_elapsed_time_days : variables.custom_card_eraycetinay_elapsed_time_day) +' ' : ''; + text += days > 0 ? days + ' ' + (days > 1 ? variables.ulm_custom_card_eraycetinay_elapsed_time_days : variables.ulm_custom_card_eraycetinay_elapsed_time_day) +' ' : ''; } if(entity.attributes.has_time) { - text += hours > 0 ? hours + ' ' + (hours > 1 ? variables.custom_card_eraycetinay_elapsed_time_hours : variables.custom_card_eraycetinay_elapsed_time_hour) +' ' : ''; + text += hours > 0 ? hours + ' ' + (hours > 1 ? variables.ulm_custom_card_eraycetinay_elapsed_time_hours : variables.ulm_custom_card_eraycetinay_elapsed_time_hour) +' ' : ''; } if(entity.attributes.has_time && !entity.attributes.has_date) { - text += minutes > 0 ? minutes + ' ' + (minutes > 1 ? variables.custom_card_eraycetinay_elapsed_time_minutes : variables.custom_card_eraycetinay_elapsed_time_minute) +' ' : ''; + text += minutes > 0 ? minutes + ' ' + (minutes > 1 ? variables.ulm_custom_card_eraycetinay_elapsed_time_minutes : variables.ulm_custom_card_eraycetinay_elapsed_time_minute) +' ' : ''; } - text = text.length ? text += variables.custom_card_eraycetinay_elapsed_time_ago : variables.custom_card_eraycetinay_elapsed_time_justnow; + text = text.length ? text += variables.ulm_custom_card_eraycetinay_elapsed_time_ago : variables.ulm_custom_card_eraycetinay_elapsed_time_justnow; return text; ]]] diff --git a/custom_cards/custom_card_eraycetinay_elapsed_time/languages/de.yaml b/custom_cards/custom_card_eraycetinay_elapsed_time/languages/de.yaml index d0b14792a..0b81d9b18 100644 --- a/custom_cards/custom_card_eraycetinay_elapsed_time/languages/de.yaml +++ b/custom_cards/custom_card_eraycetinay_elapsed_time/languages/de.yaml @@ -1,11 +1,11 @@ --- ulm_custom_card_eraycetinay_elapsed_time_language_variables: variables: - custom_card_eraycetinay_elapsed_time_day: "Tag" - custom_card_eraycetinay_elapsed_time_days: "Tage" - custom_card_eraycetinay_elapsed_time_hour: "Stunde" - custom_card_eraycetinay_elapsed_time_hours: "Stunden" - custom_card_eraycetinay_elapsed_time_minute: "Minute" - custom_card_eraycetinay_elapsed_time_minutes: "Minuten" - custom_card_eraycetinay_elapsed_time_ago: "her" - custom_card_eraycetinay_elapsed_time_justnow: "Jetzt" + ulm_custom_card_eraycetinay_elapsed_time_day: "Tag" + ulm_custom_card_eraycetinay_elapsed_time_days: "Tage" + ulm_custom_card_eraycetinay_elapsed_time_hour: "Stunde" + ulm_custom_card_eraycetinay_elapsed_time_hours: "Stunden" + ulm_custom_card_eraycetinay_elapsed_time_minute: "Minute" + ulm_custom_card_eraycetinay_elapsed_time_minutes: "Minuten" + ulm_custom_card_eraycetinay_elapsed_time_ago: "her" + ulm_custom_card_eraycetinay_elapsed_time_justnow: "Jetzt" diff --git a/custom_cards/custom_card_eraycetinay_elapsed_time/languages/en.yaml b/custom_cards/custom_card_eraycetinay_elapsed_time/languages/en.yaml index 738a2e718..a062075df 100644 --- a/custom_cards/custom_card_eraycetinay_elapsed_time/languages/en.yaml +++ b/custom_cards/custom_card_eraycetinay_elapsed_time/languages/en.yaml @@ -1,11 +1,11 @@ --- ulm_custom_card_eraycetinay_elapsed_time_language_variables: variables: - custom_card_eraycetinay_elapsed_time_day: "day" - custom_card_eraycetinay_elapsed_time_days: "days" - custom_card_eraycetinay_elapsed_time_hour: "hour" - custom_card_eraycetinay_elapsed_time_hours: "hours" - custom_card_eraycetinay_elapsed_time_minute: "minute" - custom_card_eraycetinay_elapsed_time_minutes: "minutes" - custom_card_eraycetinay_elapsed_time_ago: "ago" - custom_card_eraycetinay_elapsed_time_justnow: "just now" + ulm_custom_card_eraycetinay_elapsed_time_day: "day" + ulm_custom_card_eraycetinay_elapsed_time_days: "days" + ulm_custom_card_eraycetinay_elapsed_time_hour: "hour" + ulm_custom_card_eraycetinay_elapsed_time_hours: "hours" + ulm_custom_card_eraycetinay_elapsed_time_minute: "minute" + ulm_custom_card_eraycetinay_elapsed_time_minutes: "minutes" + ulm_custom_card_eraycetinay_elapsed_time_ago: "ago" + ulm_custom_card_eraycetinay_elapsed_time_justnow: "just now" diff --git a/custom_cards/custom_card_eraycetinay_elapsed_time/languages/es.yaml b/custom_cards/custom_card_eraycetinay_elapsed_time/languages/es.yaml index 08f72bf65..137df9718 100644 --- a/custom_cards/custom_card_eraycetinay_elapsed_time/languages/es.yaml +++ b/custom_cards/custom_card_eraycetinay_elapsed_time/languages/es.yaml @@ -1,11 +1,11 @@ --- ulm_custom_card_eraycetinay_elapsed_time_language_variables: variables: - custom_card_eraycetinay_elapsed_time_day: "día" - custom_card_eraycetinay_elapsed_time_days: "días" - custom_card_eraycetinay_elapsed_time_hour: "hora" - custom_card_eraycetinay_elapsed_time_hours: "horas" - custom_card_eraycetinay_elapsed_time_minute: "minuto" - custom_card_eraycetinay_elapsed_time_minutes: "minutos" - custom_card_eraycetinay_elapsed_time_ago: "atrás" - custom_card_eraycetinay_elapsed_time_justnow: "justo ahora" + ulm_custom_card_eraycetinay_elapsed_time_day: "día" + ulm_custom_card_eraycetinay_elapsed_time_days: "días" + ulm_custom_card_eraycetinay_elapsed_time_hour: "hora" + ulm_custom_card_eraycetinay_elapsed_time_hours: "horas" + ulm_custom_card_eraycetinay_elapsed_time_minute: "minuto" + ulm_custom_card_eraycetinay_elapsed_time_minutes: "minutos" + ulm_custom_card_eraycetinay_elapsed_time_ago: "atrás" + ulm_custom_card_eraycetinay_elapsed_time_justnow: "justo ahora" diff --git a/custom_cards/custom_card_eraycetinay_elapsed_time/languages/hu.yaml b/custom_cards/custom_card_eraycetinay_elapsed_time/languages/hu.yaml new file mode 100644 index 000000000..5c29e717f --- /dev/null +++ b/custom_cards/custom_card_eraycetinay_elapsed_time/languages/hu.yaml @@ -0,0 +1,11 @@ +--- +ulm_custom_card_eraycetinay_elapsed_time_language_variables: + variables: + ulm_custom_card_eraycetinay_elapsed_time_day: "nappal" + ulm_custom_card_eraycetinay_elapsed_time_days: "nappal" + ulm_custom_card_eraycetinay_elapsed_time_hour: "órával" + ulm_custom_card_eraycetinay_elapsed_time_hours: "órával" + ulm_custom_card_eraycetinay_elapsed_time_minute: "perccel" + ulm_custom_card_eraycetinay_elapsed_time_minutes: "perccel" + ulm_custom_card_eraycetinay_elapsed_time_ago: "ezelőtt" + ulm_custom_card_eraycetinay_elapsed_time_justnow: "éppen most" diff --git a/custom_cards/custom_card_eraycetinay_elapsed_time/languages/pl.yaml b/custom_cards/custom_card_eraycetinay_elapsed_time/languages/pl.yaml index 9d59fd2e4..e7912b293 100644 --- a/custom_cards/custom_card_eraycetinay_elapsed_time/languages/pl.yaml +++ b/custom_cards/custom_card_eraycetinay_elapsed_time/languages/pl.yaml @@ -1,11 +1,11 @@ --- ulm_custom_card_eraycetinay_elapsed_time_language_variables: variables: - custom_card_eraycetinay_elapsed_time_day: "dzień" - custom_card_eraycetinay_elapsed_time_days: "dni" - custom_card_eraycetinay_elapsed_time_hour: "godzinę" - custom_card_eraycetinay_elapsed_time_hours: "godzin" - custom_card_eraycetinay_elapsed_time_minute: "minutę" - custom_card_eraycetinay_elapsed_time_minutes: "minut" - custom_card_eraycetinay_elapsed_time_ago: "temu" - custom_card_eraycetinay_elapsed_time_justnow: "przed chwilą" + ulm_custom_card_eraycetinay_elapsed_time_day: "dzień" + ulm_custom_card_eraycetinay_elapsed_time_days: "dni" + ulm_custom_card_eraycetinay_elapsed_time_hour: "godzinę" + ulm_custom_card_eraycetinay_elapsed_time_hours: "godzin" + ulm_custom_card_eraycetinay_elapsed_time_minute: "minutę" + ulm_custom_card_eraycetinay_elapsed_time_minutes: "minut" + ulm_custom_card_eraycetinay_elapsed_time_ago: "temu" + ulm_custom_card_eraycetinay_elapsed_time_justnow: "przed chwilą" diff --git a/custom_cards/custom_card_eraycetinay_elapsed_time/languages/tr.yaml b/custom_cards/custom_card_eraycetinay_elapsed_time/languages/tr.yaml index d3991c805..0b36ea71f 100644 --- a/custom_cards/custom_card_eraycetinay_elapsed_time/languages/tr.yaml +++ b/custom_cards/custom_card_eraycetinay_elapsed_time/languages/tr.yaml @@ -1,11 +1,11 @@ --- ulm_custom_card_eraycetinay_elapsed_time_language_variables: variables: - custom_card_eraycetinay_elapsed_time_day: "gün" - custom_card_eraycetinay_elapsed_time_days: "gün" - custom_card_eraycetinay_elapsed_time_hour: "saat" - custom_card_eraycetinay_elapsed_time_hours: "saat" - custom_card_eraycetinay_elapsed_time_minute: "dakika" - custom_card_eraycetinay_elapsed_time_minutes: "dakika" - custom_card_eraycetinay_elapsed_time_ago: "önce" - custom_card_eraycetinay_elapsed_time_justnow: "az önce" + ulm_custom_card_eraycetinay_elapsed_time_day: "gün" + ulm_custom_card_eraycetinay_elapsed_time_days: "gün" + ulm_custom_card_eraycetinay_elapsed_time_hour: "saat" + ulm_custom_card_eraycetinay_elapsed_time_hours: "saat" + ulm_custom_card_eraycetinay_elapsed_time_minute: "dakika" + ulm_custom_card_eraycetinay_elapsed_time_minutes: "dakika" + ulm_custom_card_eraycetinay_elapsed_time_ago: "önce" + ulm_custom_card_eraycetinay_elapsed_time_justnow: "az önce" diff --git a/custom_cards/custom_card_eraycetinay_lock/README.md b/custom_cards/custom_card_eraycetinay_lock/README.md index 777c75ac2..9b3bb9e06 100644 --- a/custom_cards/custom_card_eraycetinay_lock/README.md +++ b/custom_cards/custom_card_eraycetinay_lock/README.md @@ -107,6 +107,20 @@ Version: 0.0.3 no Displays a warning when the door is lock but the door is still open. + + ulm_custom_card_eraycetinay_lock_battery_sensor_binary + true + false + no + Set to true if using a binary battery sensor. Will ignore battery_warning percentage settings + + + ulm_custom_card_eraycetinay_lock_battery_sensor_binary_low_state + off + on + no + Set whether the binary sensor turns to on or off when in low state + ??? note "Template Code" diff --git a/custom_cards/custom_card_eraycetinay_lock/custom_card_eraycetinay_lock.yaml b/custom_cards/custom_card_eraycetinay_lock/custom_card_eraycetinay_lock.yaml index 4c2447996..fa59709a2 100644 --- a/custom_cards/custom_card_eraycetinay_lock/custom_card_eraycetinay_lock.yaml +++ b/custom_cards/custom_card_eraycetinay_lock/custom_card_eraycetinay_lock.yaml @@ -7,16 +7,19 @@ custom_card_eraycetinay_lock: variables: ulm_custom_card_eraycetinay_lock_battery_warning: 20 ulm_custom_card_eraycetinay_lock_battery_warning_low: 5 + ulm_custom_card_eraycetinay_lock_battery_sensor_binary: false + ulm_custom_card_eraycetinay_lock_battery_sensor_binary_low_state: "on" + ulm_custom_card_eraycetinay_lock_only_open: false tap_action: action: | [[[ - return variables.ulm_custom_card_eraycetinay_lock_tap_control ? "call-service" : "more-info"; + return variables.ulm_custom_card_eraycetinay_lock_tap_control ? "perform-action" : "more-info"; ]]] - # only related with call-service action - service: | + # only related with perform-action + perform_action: | [[[ if(variables.ulm_custom_card_eraycetinay_lock_tap_control){ - if(variables.ulm_custom_card_eraycetinay_lock_open){ + if(variables.ulm_custom_card_eraycetinay_lock_only_open){ return "lock.open"; } else { if (entity.state == "locked"){ @@ -27,8 +30,8 @@ custom_card_eraycetinay_lock: } } ]]] - # only related with call-service action - service_data: + # only related with perform-action + target: entity_id: | [[[ return entity.entity_id; ]]] show_label: true @@ -89,10 +92,16 @@ custom_card_eraycetinay_lock: - background-color: | [[[ if (variables.ulm_custom_card_eraycetinay_lock_battery_level !== undefined) { - if (states[variables.ulm_custom_card_eraycetinay_lock_battery_level].state <= variables.ulm_custom_card_eraycetinay_lock_battery_warning_low) { - return "rgba(var(--color-red),1)"; - } else if (states[variables.ulm_custom_card_eraycetinay_lock_battery_level].state <= variables.ulm_custom_card_eraycetinay_lock_battery_warning) { - return "rgba(var(--color-yellow),1)"; + if (variables.ulm_custom_card_eraycetinay_lock_battery_sensor_binary) { + if (states[variables.ulm_custom_card_eraycetinay_lock_battery_level].state == variables.ulm_custom_card_eraycetinay_lock_battery_sensor_binary_low_state) { + return "rgba(var(--color-red),1)"; + } + } else { + if (states[variables.ulm_custom_card_eraycetinay_lock_battery_level].state <= variables.ulm_custom_card_eraycetinay_lock_battery_warning_low) { + return "rgba(var(--color-red),1)"; + } else if (states[variables.ulm_custom_card_eraycetinay_lock_battery_level].state <= variables.ulm_custom_card_eraycetinay_lock_battery_warning) { + return "rgba(var(--color-yellow),1)"; + } } } ]]] @@ -106,10 +115,18 @@ custom_card_eraycetinay_lock: notification_battery: > [[[ if (variables.ulm_custom_card_eraycetinay_lock_battery_level !== undefined) { - if (variables.ulm_custom_card_eraycetinay_lock_battery_warning >= states[variables.ulm_custom_card_eraycetinay_lock_battery_level].state) { - return ` - - `; + if (variables.ulm_custom_card_eraycetinay_lock_battery_sensor_binary) { + if (states[variables.ulm_custom_card_eraycetinay_lock_battery_level].state == variables.ulm_custom_card_eraycetinay_lock_battery_sensor_binary_low_state) { + return ` + + `; + } + } else { + if (variables.ulm_custom_card_eraycetinay_lock_battery_warning >= states[variables.ulm_custom_card_eraycetinay_lock_battery_level].state) { + return ` + + `; + } } } ]]] diff --git a/custom_cards/custom_card_eraycetinay_lock/languages/de.yaml b/custom_cards/custom_card_eraycetinay_lock/languages/de.yaml index 1305d95eb..d97a28f11 100644 --- a/custom_cards/custom_card_eraycetinay_lock/languages/de.yaml +++ b/custom_cards/custom_card_eraycetinay_lock/languages/de.yaml @@ -1,11 +1,12 @@ --- custom_card_eraycetinay_lock_language_variables: variables: - custom_card_eraycetinay_lock_locked: "verriegelt" - custom_card_eraycetinay_lock_unlocked: "entriegelt" - custom_card_eraycetinay_lock_locking: "verriegeln" - custom_card_eraycetinay_lock_unlocking: "entriegeln" - custom_card_eraycetinay_lock_unavailable: "nicht verfügbar" - custom_card_eraycetinay_lock_jammed: "blockiert" - custom_card_eraycetinay_lock_locked_and_opened: "Die Tür ist verschlossen, aber noch offen." - custom_card_eraycetinay_lock_battery_is_at: "Batterie ist an" + ulm_custom_card_eraycetinay_lock_locked: "verriegelt" + ulm_custom_card_eraycetinay_lock_unlocked: "entriegelt" + ulm_custom_card_eraycetinay_lock_locking: "verriegeln" + ulm_custom_card_eraycetinay_lock_unlocking: "entriegeln" + ulm_custom_card_eraycetinay_lock_unavailable: "nicht verfügbar" + ulm_custom_card_eraycetinay_lock_jammed: "blockiert" + ulm_custom_card_eraycetinay_lock_locked_and_opened: "Die Tür ist verschlossen, aber noch offen." + ulm_custom_card_eraycetinay_lock_battery_is_at: "Batterie ist an" + ulm_custom_card_eraycetinay_lock_battery_is_low: "Batterie schwach" diff --git a/custom_cards/custom_card_eraycetinay_lock/languages/en.yaml b/custom_cards/custom_card_eraycetinay_lock/languages/en.yaml index f34a60515..81579b70b 100644 --- a/custom_cards/custom_card_eraycetinay_lock/languages/en.yaml +++ b/custom_cards/custom_card_eraycetinay_lock/languages/en.yaml @@ -1,11 +1,12 @@ --- custom_card_eraycetinay_lock_language_variables: variables: - custom_card_eraycetinay_lock_locked: "locked" - custom_card_eraycetinay_lock_unlocked: "unlocked" - custom_card_eraycetinay_lock_locking: "locking" - custom_card_eraycetinay_lock_unlocking: "unlocking" - custom_card_eraycetinay_lock_unavailable: "unavailable" - custom_card_eraycetinay_lock_jammed: "jammed" - custom_card_eraycetinay_lock_locked_and_opened: "The door is locked but still open." - custom_card_eraycetinay_lock_battery_is_at: "Battery is at" + ulm_custom_card_eraycetinay_lock_locked: "locked" + ulm_custom_card_eraycetinay_lock_unlocked: "unlocked" + ulm_custom_card_eraycetinay_lock_locking: "locking" + ulm_custom_card_eraycetinay_lock_unlocking: "unlocking" + ulm_custom_card_eraycetinay_lock_unavailable: "unavailable" + ulm_custom_card_eraycetinay_lock_jammed: "jammed" + ulm_custom_card_eraycetinay_lock_locked_and_opened: "The door is locked but still open." + ulm_custom_card_eraycetinay_lock_battery_is_at: "Battery is at" + ulm_custom_card_eraycetinay_lock_battery_is_low: "Battery is low" diff --git a/custom_cards/custom_card_eraycetinay_lock/languages/es.yaml b/custom_cards/custom_card_eraycetinay_lock/languages/es.yaml index 637d3c74c..3281e2ee1 100644 --- a/custom_cards/custom_card_eraycetinay_lock/languages/es.yaml +++ b/custom_cards/custom_card_eraycetinay_lock/languages/es.yaml @@ -1,11 +1,12 @@ --- custom_card_eraycetinay_lock_language_variables: variables: - custom_card_eraycetinay_lock_locked: "bloqueado" - custom_card_eraycetinay_lock_unlocked: "desbloqueado" - custom_card_eraycetinay_lock_locking: "bloqueando" - custom_card_eraycetinay_lock_unlocking: "desbloqueando" - custom_card_eraycetinay_lock_unavailable: "no disponible" - custom_card_eraycetinay_lock_jammed: "apretada" - custom_card_eraycetinay_lock_locked_and_opened: "La puerta está cerrada pero aún abierta." - custom_card_eraycetinay_lock_battery_is_at: "la batería está en" + ulm_custom_card_eraycetinay_lock_locked: "bloqueado" + ulm_custom_card_eraycetinay_lock_unlocked: "desbloqueado" + ulm_custom_card_eraycetinay_lock_locking: "bloqueando" + ulm_custom_card_eraycetinay_lock_unlocking: "desbloqueando" + ulm_custom_card_eraycetinay_lock_unavailable: "no disponible" + ulm_custom_card_eraycetinay_lock_jammed: "apretada" + ulm_custom_card_eraycetinay_lock_locked_and_opened: "La puerta está cerrada pero aún abierta." + ulm_custom_card_eraycetinay_lock_battery_is_at: "la batería está en" + ulm_custom_card_eraycetinay_lock_battery_is_low: "La batería está baja" diff --git a/custom_cards/custom_card_eraycetinay_lock/languages/pl.yaml b/custom_cards/custom_card_eraycetinay_lock/languages/pl.yaml index b00d13270..edfaba02f 100644 --- a/custom_cards/custom_card_eraycetinay_lock/languages/pl.yaml +++ b/custom_cards/custom_card_eraycetinay_lock/languages/pl.yaml @@ -1,11 +1,12 @@ --- custom_card_eraycetinay_lock_language_variables: variables: - custom_card_eraycetinay_lock_locked: "zamknięty" - custom_card_eraycetinay_lock_unlocked: "otwarty" - custom_card_eraycetinay_lock_locking: "zamykanie" - custom_card_eraycetinay_lock_unlocking: "otwieranie" - custom_card_eraycetinay_lock_unavailable: "niedostępny" - custom_card_eraycetinay_lock_jammed: "zacięty" - custom_card_eraycetinay_lock_locked_and_opened: "Drzwi są zamknięte, ale nadal otwarte." - custom_card_eraycetinay_lock_battery_is_at: "Bateria jest na" + ulm_custom_card_eraycetinay_lock_locked: "zamknięty" + ulm_custom_card_eraycetinay_lock_unlocked: "otwarty" + ulm_custom_card_eraycetinay_lock_locking: "zamykanie" + ulm_custom_card_eraycetinay_lock_unlocking: "otwieranie" + ulm_custom_card_eraycetinay_lock_unavailable: "niedostępny" + ulm_custom_card_eraycetinay_lock_jammed: "zacięty" + ulm_custom_card_eraycetinay_lock_locked_and_opened: "Drzwi są zamknięte, ale nadal otwarte." + ulm_custom_card_eraycetinay_lock_battery_is_at: "Bateria jest na" + ulm_custom_card_eraycetinay_lock_battery_is_low: "Bateria jest słaba" diff --git a/custom_cards/custom_card_eraycetinay_lock/languages/sv.yaml b/custom_cards/custom_card_eraycetinay_lock/languages/sv.yaml index 707eab945..858d90629 100644 --- a/custom_cards/custom_card_eraycetinay_lock/languages/sv.yaml +++ b/custom_cards/custom_card_eraycetinay_lock/languages/sv.yaml @@ -1,11 +1,12 @@ --- custom_card_eraycetinay_lock_language_variables: variables: - custom_card_eraycetinay_lock_locked: "låst" - custom_card_eraycetinay_lock_unlocked: "olåst" - custom_card_eraycetinay_lock_locking: "låser" - custom_card_eraycetinay_lock_unlocking: "låser upp" - custom_card_eraycetinay_lock_unavailable: "otillgängligt" - custom_card_eraycetinay_lock_jammed: "fastnat" - custom_card_eraycetinay_lock_locked_and_opened: "Dörren är låst men fortfarande öppen." - custom_card_eraycetinay_lock_battery_is_at: "Batterinivån är" + ulm_custom_card_eraycetinay_lock_locked: "låst" + ulm_custom_card_eraycetinay_lock_unlocked: "olåst" + ulm_custom_card_eraycetinay_lock_locking: "låser" + ulm_custom_card_eraycetinay_lock_unlocking: "låser upp" + ulm_custom_card_eraycetinay_lock_unavailable: "otillgängligt" + ulm_custom_card_eraycetinay_lock_jammed: "fastnat" + ulm_custom_card_eraycetinay_lock_locked_and_opened: "Dörren är låst men fortfarande öppen." + ulm_custom_card_eraycetinay_lock_battery_is_at: "Batterinivån är" + ulm_custom_card_eraycetinay_lock_battery_is_low: "Batteriet är lågt" diff --git a/custom_cards/custom_card_eraycetinay_lock/languages/tr.yaml b/custom_cards/custom_card_eraycetinay_lock/languages/tr.yaml index e612ab5f2..71087a982 100644 --- a/custom_cards/custom_card_eraycetinay_lock/languages/tr.yaml +++ b/custom_cards/custom_card_eraycetinay_lock/languages/tr.yaml @@ -1,11 +1,12 @@ --- custom_card_eraycetinay_lock_language_variables: variables: - custom_card_eraycetinay_lock_locked: "kilitli" - custom_card_eraycetinay_lock_unlocked: "kilitli değil" - custom_card_eraycetinay_lock_locking: "kilitleniyor" - custom_card_eraycetinay_lock_unlocking: "kilit açılıyor" - custom_card_eraycetinay_lock_unavailable: "müsait değil" - custom_card_eraycetinay_lock_jammed: "sıkışmış" - custom_card_eraycetinay_lock_locked_and_opened: "Kapı kilitli ama hala açık" - custom_card_eraycetinay_lock_battery_is_at: "pil" + ulm_custom_card_eraycetinay_lock_locked: "kilitli" + ulm_custom_card_eraycetinay_lock_unlocked: "kilitli değil" + ulm_custom_card_eraycetinay_lock_locking: "kilitleniyor" + ulm_custom_card_eraycetinay_lock_unlocking: "kilit açılıyor" + ulm_custom_card_eraycetinay_lock_unavailable: "müsait değil" + ulm_custom_card_eraycetinay_lock_jammed: "sıkışmış" + ulm_custom_card_eraycetinay_lock_locked_and_opened: "Kapı kilitli ama hala açık" + ulm_custom_card_eraycetinay_lock_battery_is_at: "pil" + ulm_custom_card_eraycetinay_lock_battery_is_low: "pil zayıf" diff --git a/custom_cards/custom_card_esh_welcome/custom_card_esh_welcome.yaml b/custom_cards/custom_card_esh_welcome/custom_card_esh_welcome.yaml index d2c089bf3..5a9b32266 100644 --- a/custom_cards/custom_card_esh_welcome/custom_card_esh_welcome.yaml +++ b/custom_cards/custom_card_esh_welcome/custom_card_esh_welcome.yaml @@ -405,9 +405,9 @@ card_esh_welcome_topbar: type: "custom:button-card" template: "chips" tap_action: - action: "call-service" - service: "input_boolean.toggle" - service_data: + action: "perform-action" + perform_action: "input_boolean.toggle" + target: entity_id: "[[[ return variables.ulm_card_esh_welcome_collapse ]]]" show_icon: true icon: "mdi:chevron-up" diff --git a/custom_cards/custom_card_haven_washer/README.md b/custom_cards/custom_card_haven_washer/README.md new file mode 100644 index 000000000..7cd1121e5 --- /dev/null +++ b/custom_cards/custom_card_haven_washer/README.md @@ -0,0 +1,245 @@ +--- +title: Washer/Dryer/Dishwasher Custom-card +hide: + - toc +--- + + + +# Custom-card "Washer" + +![Washer Dryer off](../../docs/assets/img/custom_card_haven_washer_off.png) + +Small layout when the washer, dryer or dishwasher is turned off (ulm_custom_card_washer_power === "off"). It shows the content of the idle label variable (ulm_custom_card_washer_label_idle) + +![Washer Dryer Ready](../../docs/assets/img/custom_card_haven_washer_ready.png) + +When the washer, dryer or dishwasher is turned on the possible (job) stages of machine become visible (In this example the dryer has no different (job) stages so the stages remain closed) + +![Washer Dryer Remote Control](../../docs/assets/img/custom_card_haven_washer_remote_control.png) + +When the washer, dryer or dishwasher is set to smart control (ulm_custom_card_washer_remote_control === "true"), you can start the machine from you app, or you can start it using automation. The buttons will reflect this stage change. + +![Washer Dryer Timer](../../docs/assets/img/custom_card_haven_washer_timer.png) + +When you want to start the washer, dryer or dishwasher at a specific time (through automation) you can turn on the timer (press the icon and the ulm_custom_card_washer_delayed_start === "on") and set the time to start (use the up and down buttons of click on the time to set ulm_custom_card_washer_delayed_starttime (Time only)). It shows the content of the configuration label variable (ulm_custom_card_washer_label_configuring). + +![Washer Dryer Running](../../docs/assets/img/custom_card_haven_washer_running.png) + +When the washer, dryer or dishwasher is running you can use the running label variable (ulm_custom_card_washer_label_running) to show the remaining time. The dryer can't be paused so the button is disabled. + +!! Attention !! + +This custom card is build based on a Samsung Washer and Dryer and based on the SmartThings Custom integration (installable using HACS: https://github.com/veista/smartthings). Other washer, dryers or dishwasher could work with this custom card, but might require some work. This card is highly configurable, but for the machine state you might need a template sensors to support the same terminology (run, pause, stop). + +## Credits + +- Author: Cruguah - 2023 +- Version: 1.0.2 + +- Thanks to rphlwnk for sharing his code of his washing machine card. +- Thanks to dougmaitelli for sharing his experience and configuration of his washing machine (LG SmartThinQ). + +## Changelog + +
+ 1.0.2 + Added an extra variable ulm_custom_card_washer_machine_stop_state to support more washers (LG SmartThinQ) #1268. + Thanks to dougmaitelli for pointing out this issue. +
+
+ 1.0.1 + Small bug fix resolving issue #1230. +
+
+ 1.0.0 + Initial release. +
+ +## Usage + +Example for Samsung SmartThings: + +```yaml +- type: "custom:button-card" + template: "custom_card_haven_washer" + variables: + ulm_custom_card_washer_power: switch.washingmachine_switch + ulm_custom_card_washer_remote_control: sensor.washingmachine_remote_control + ulm_custom_card_washer_machine_state: sensor.washingmachine_machine_state + ulm_custom_card_washer_job_state: sensor.washingmachine_job_state + ulm_custom_card_washer_job_states: + state1: + name: "weightSensing" + icon: "mdi:scale" + state2: + name: "wash" + icon: "mdi:waves" + state3: + name: "rinse" + icon: "mdi:water" + state4: + name: "spin" + icon: "mdi:fan" + ulm_custom_card_washer_delayed_start: input_boolean.washingmachine_latest_start + ulm_custom_card_washer_delayed_starttime: input_datetime.washingmachine_latest_starttime + ulm_custom_card_washer_label_idle: > + [[[ + var name = states["sensor.washingmachine_energy"].attributes.friendly_name; + var value = states["sensor.washingmachine_energy"].state; + var measurement = states["sensor.washingmachine_energy"].attributes.unit_of_measurement; + return name + " • " + value + " " + measurement; + ]]] + ulm_custom_card_washer_label_running: "[[[ return states["sensor.washer_remaining_time"].state; ]]]" + ulm_custom_card_washer_label_configuring: > + [[[ + var name = states["sensor.washer_actual_starttime"].attributes.friendly_name; + var time = states["sensor.washer_actual_starttime"].attributes.display_time; + return name + " • " + time; + ]]] + ulm_custom_card_washer_start_action: + action: "call-service" + service: switch.turn_on + service_data: + entity_id: switch.washer_run_action + ulm_custom_card_washer_pause_action: + action: "call-service" + service: switch.turn_on + service_data: + entity_id: switch.washer_pause_action + ulm_custom_card_washer_stop_action: + action: "call-service" + service: switch.turn_on + service_data: + entity_id: switch.washer_stop_action +``` + +Example for LG SmartThinQ + +```yaml +- type: "custom:button-card" + template: "custom_card_haven_washer" + variables: + ulm_custom_card_washer_power: sensor.washer + ulm_custom_card_washer_machine_state: sensor.washer_run_state + ulm_custom_card_washer_machine_stop_state: "-" + ulm_custom_card_washer_job_state: sensor.washer_run_state + ulm_custom_card_washer_job_states: + state1: + name: "Detecting" + icon: "mdi:scale" + state2: + name: "Washing" + icon: "mdi:waves" + state3: + name: "Rinsing" + icon: "mdi:water" + state4: + name: "Spin" + icon: "mdi:fan" + ulm_custom_card_washer_label_idle: > + [[[ + return "-"; + ]]] + ulm_custom_card_washer_label_running: > + [[[ + return states["sensor.washer_remaining_time"].state; + ]]] + ulm_custom_card_washer_label_configuring: > + [[[ + var name = states["sensor.washer_initial_time"].attributes.friendly_name; + var time = states["sensor.washer_initial_time"].attributes.display_time; + return name + " • " + time; + ]]] +``` + +## Requirements + +An integration that will support your washer, dryer, dishwasher or any other machine with job stages that you want to monitor. + +When using a Samsung Washing machine or Dryer that integrates with SmartThings, a default integration is available in Home Assistant and this custom card works with this integration. One thing missing in the default SmartThings integration is the ability to see is remote control is enabled. A custom integration is available which extends the sensors with a remote control sensor. Integration from HACS: "SmartThings Custom" (https://github.com/veista/smartthings) from veista. + +When using a LG Washing machine or Dryer or Dishwasher that integrates with LG SmartThinQ, a custom integration is available from HACS: "LG ThinQ Devices integration for HomeAssistant" (https://github.com/ollo69/ha-smartthinq-sensors) that works with this integration. + +## Additional: Show the remaining time + +If you want to show the remaining time of your wash you can use the following template sensor to calculate duration. + +```yaml +template: + - sensor: + - unique_id: washer_remaining_time + name: "Remaining Time" + state: >- + {% set rem_h = (as_timestamp(states.sensor.washer_completion_time.state) - as_timestamp(now())) | timestamp_custom("%-H", false) %} + {% set rem_m = (as_timestamp(states.sensor.washer_completion_time.state) - as_timestamp(now())) | timestamp_custom("%-M", false) %} + {% if int(rem_h) > 0.9 %} {{ rem_h }} hour(s) and {{ rem_m }} minute(s) {% else %} {{ rem_m }} minute(s) {% endif %} +``` + +## Additional: Control the washing machine of dryer remotely + +Starting, pausing or stopping the washer or dryer is currently not supported by the Samsung SmartThings integration. +To use the start, pause, and stop buttons, you can create command line switches, which can initiate the corresponding action. +When creating a command-line switch, you need to replace the following items: + +| Variable | Explanation | +| --------- | ---------------------------------------------------------------------------------------- | +| action | this should be run, pause or stop | +| deviceId | The id of your device (guid) | +| PAT Token | The same PAT Token you"ve created during the installation of the SmartThings integration | + +For every action you need to create an other command-line switch. + +Please ensure the capabilities of you machine before creating command-line switches. + +```yaml +switch: + - platform: command_line + switches: + washer_run_action: + unique_id: switch.washer__action + value_template: > + {% if is_state("switch.washer__action", "on") %} + false + {% endif %} + command_on: > + curl --location --request POST "https://api.smartthings.com/v1/devices//commands" --header "authorization: Bearer " --header "Content-Type: text/plain" --data-raw "[{"capability":"washerOperatingState","command":"setMachineState","arguments":[""]}]" +``` + +## Variables + +### Main parameters + +| Variable | Example | Required | Explanation | +| ----------------------------------------- | --------------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------- | +| ulm_custom_card_washer_power | switch.washingmachine_switch | yes | Is the washing machine or dryer turned on? | +| ulm_custom_card_washer_remote_control | sensor.washingmachine_remote_control | no | Can we control the washing machine or dryer remotely | +| ulm_custom_card_washer_machine_state | sensor.washingmachine_machine_state | no | What is the current state of washing machine or dryer: none, run or pause | +| ulm_custom_card_washer_machine_stop_state | "stop" | no | What is the value for the stop stage of the ulm_custom_card_washer_machine_state | +| ulm_custom_card_washer_job_state | sensor.washingmachine_job_state | no | What is the current step in the program, weightSensing, wash, rinse, spin or drying | +| ulm_custom_card_washer_job_states | List of maximum 5 states (name and icon) to show as job states | no | Define the job states of the washing machine of dryer (or any other machine that you wanna use) | +| ulm_custom_card_washer_delayed_start | input_boolean.washingmachine_latest_start | no | Turn on the ability to start the washing machine of dryer at a specific time | +| ulm_custom_card_washer_delayed_starttime | input_datetime.washingmachine_latest_starttime | no | What time should the washing machine or dryer start | +| ulm_custom_card_washer_label_idle | Any text, for example the number of runs | no | What label to show when the washing machine or dryer is idle | +| ulm_custom_card_washer_label_running | Any text, for example the remaining time of the current program | no | What label to show when the washing machine or dryer is running | +| ulm_custom_card_washer_label_configuring | Any text, for example, the end result of all the settings | no | What label to show when the washing machine or dryer is being configured | +| ulm_custom_card_washer_start_action | A collection of setting to change a value or start an action | no | This contains all the parameters to start the washing machine or dryer (See the next table) | +| ulm_custom_card_washer_pause_action | A collection of setting to change a value or start an action | no | This contains all the parameters to pause the washing machine or dryer (See the next table) | +| ulm_custom_card_washer_stop_action | A collection of setting to change a value or start an action | no | This contains all the parameters to stop the washing machine or dryer (See the next table) | + +### Parameters specific for the start, pause and stop of the washing machine of dryer + +| Variable | Example | Required | Explanation | +| --------------- | -------------------------------------- | -------- | --------------------------------------------------------------------------------------------------- | +| action | none | no | Action to perform (more-info, toggle, call-service, navigate, url, none) Default: none | +| entity | entity_id | no | Entity id to call the action on | +| navigation_path | The navigation path for the call | no | Path to navigate to (e.g., /lovelace/0/) when action defined as navigate | +| url_path | The url path for the call | no | Path to navigate to (e.g., https://www.home-assistant.io) when action defined as url | +| service | The service to call the action on | no | Service to call (e.g., media_player.media_play_pause) when action defined as call-service | +| service_data | The service_data to call the action on | no | Service data to include (e.g., entity_id: media_player.bedroom) when action defined as call-service | + +??? note "Template Code" + + ```yaml title="custom_card_haven_washer.yaml" + --8<-- "custom_cards/custom_card_haven_washer/custom_card_haven_washer.yaml" + ``` diff --git a/custom_cards/custom_card_haven_washer/custom_card_haven_washer.yaml b/custom_cards/custom_card_haven_washer/custom_card_haven_washer.yaml new file mode 100644 index 000000000..42561ff34 --- /dev/null +++ b/custom_cards/custom_card_haven_washer/custom_card_haven_washer.yaml @@ -0,0 +1,733 @@ +--- +custom_card_haven_washer: + template: + - "ulm_language_variables" + - "ulm_translation_engine" + variables: + ulm_custom_card_washer_power: + ulm_custom_card_washer_remote_control: + ulm_custom_card_washer_machine_state: + ulm_custom_card_washer_machine_stop_state: "stop" + ulm_custom_card_washer_job_state: + ulm_custom_card_washer_label_idle: "idle" + ulm_custom_card_washer_label_configuring: "configure" + ulm_custom_card_washer_label_running: "run" + ulm_custom_card_washer_delayed_start: + ulm_custom_card_washer_delayed_starttime: + ulm_custom_card_washer_job_states: + state1: + name: + icon: + state2: + name: + icon: + state3: + name: + icon: + state4: + name: + icon: + state5: + name: + icon: + ulm_custom_card_washer_start_action: + action: "none" + ulm_custom_card_washer_pause_action: + action: "none" + ulm_custom_card_washer_stop_action: + action: "none" + triggers_update: "all" + show_icon: false + show_label: false + show_name: false + show_state: false + show_last_changed: false + show_entity_picture: false + styles: + grid: + - grid-template-areas: > + [[[ + var rows = ["\'row1\'"]; + + if (!!variables.ulm_custom_card_washer_job_state) { + rows.push("\'row2\'"); + } + + if (!!variables.ulm_custom_card_washer_remote_control) { + rows.push("\'row3\'"); + } + + if (!!variables.ulm_custom_card_washer_delayed_start + && !!variables.ulm_custom_card_washer_delayed_starttime) { + rows.push("\'row4\'"); + } + + return rows.join(" "); + ]]] + - grid-template-columns: "1fr" + - grid-template-rows: "min-content" + - row-gap: "0px" + card: + - border-radius: "var(--border-radius)" + - box-shadow: "var(--box-shadow)" + - padding: "12px" + custom_fields: + row2: + - display: > + [[[ + return (!!variables.ulm_custom_card_washer_job_state + && !!variables.ulm_custom_card_washer_power + && !!states[variables.ulm_custom_card_washer_power]?.state + && states[variables.ulm_custom_card_washer_power].state === "on") ? "block" : "none"; + ]]] + row3: + - display: > + [[[ + return (!!variables.ulm_custom_card_washer_power + && !!states[variables.ulm_custom_card_washer_power]?.state + && states[variables.ulm_custom_card_washer_power].state === "on" + && !!variables.ulm_custom_card_washer_remote_control + && !!states[variables.ulm_custom_card_washer_remote_control]?.state + && states[variables.ulm_custom_card_washer_remote_control].state === "true") ? "block" : "none"; + ]]] + row4: + - display: > + [[[ + return (!!variables.ulm_custom_card_washer_power + && !!states[variables.ulm_custom_card_washer_power]?.state + && states[variables.ulm_custom_card_washer_power].state === "on" + && !!variables.ulm_custom_card_washer_remote_control + && !!states[variables.ulm_custom_card_washer_remote_control]?.state + && states[variables.ulm_custom_card_washer_remote_control].state === "true" + && !!variables.ulm_custom_card_washer_delayed_start + && !!states[variables.ulm_custom_card_washer_delayed_start]?.state + && states[variables.ulm_custom_card_washer_delayed_start].state === "on" + && !!variables.ulm_custom_card_washer_delayed_starttime) ? "block" : "none"; + ]]] + custom_fields: + row1: + card: + type: "custom:button-card" + template: + - "icon_info" + - "blue_on" + tap_action: + action: "more-info" + label: > + [[[ + if (!!variables.ulm_custom_card_washer_power + && !!states[variables.ulm_custom_card_washer_power]?.state + && states[variables.ulm_custom_card_washer_power].state === "on") { + if (!!variables.ulm_custom_card_washer_machine_state + && !!states[variables.ulm_custom_card_washer_machine_state]?.state + && states[variables.ulm_custom_card_washer_machine_state].state !== variables.ulm_custom_card_washer_machine_stop_state) { + if (!!variables.ulm_custom_card_washer_label_running) { + return variables.ulm_custom_card_washer_label_running; + } + } else { + if (!!variables.ulm_custom_card_washer_remote_control + && !!states[variables.ulm_custom_card_washer_remote_control]?.state + && states[variables.ulm_custom_card_washer_remote_control].state === "true" + && !!variables.ulm_custom_card_washer_delayed_start + && !!states[variables.ulm_custom_card_washer_delayed_start]?.state + && states[variables.ulm_custom_card_washer_delayed_start].state === "on") { + if (!!variables.ulm_custom_card_washer_label_configuring) { + return variables.ulm_custom_card_washer_label_configuring; + } + } else { + if (!!variables.ulm_custom_card_washer_label_idle) { + return variables.ulm_custom_card_washer_label_idle; + } + } + } + } else { + if (!!variables.ulm_custom_card_washer_label_idle) { + return variables.ulm_custom_card_washer_label_idle; + } + } + + var label = states[variables.ulm_custom_card_washer_power].state; + label = variables["ulm_" + label] ?? label; + + if (!!variables.ulm_custom_card_washer_machine_state + && !!states[variables.ulm_custom_card_washer_machine_state] + && !!states[variables.ulm_custom_card_washer_machine_state].state) { + var state = states[variables.ulm_custom_card_washer_machine_state].state; + label += " • " + variables["ulm_" + state] ?? state; + } + + return label; + ]]] + entity: "[[[ return variables.ulm_custom_card_washer_power; ]]]" + styles: + card: + - box-shadow: "none" + - padding: "0px" + row2: + card: + type: "custom:button-card" + styles: + img_cell: + - justify-items: "center" + grid: + - grid-template-areas: > + [[[ + var items = []; + + if (!!variables.ulm_custom_card_washer_job_states) { + if (!!variables.ulm_custom_card_washer_job_states.state1?.name + && !!variables.ulm_custom_card_washer_job_states.state1?.icon) { + items.push("item1"); + } + if (!!variables.ulm_custom_card_washer_job_states.state2?.name + && !!variables.ulm_custom_card_washer_job_states.state2?.icon) { + items.push("item2"); + } + if (!!variables.ulm_custom_card_washer_job_states.state3?.name + && !!variables.ulm_custom_card_washer_job_states.state3?.icon) { + items.push("item3"); + } + if (!!variables.ulm_custom_card_washer_job_states.state4?.name + && !!variables.ulm_custom_card_washer_job_states.state4?.icon) { + items.push("item4"); + } + if (!!variables.ulm_custom_card_washer_job_states.state5?.name + && !!variables.ulm_custom_card_washer_job_states.state5?.icon) { + items.push("item5"); + } + } + + return "\'" + items.join(" ") + "\'"; + ]]] + - grid-template-columns: > + [[[ + var columns = []; + + if (!!variables.ulm_custom_card_washer_job_states) { + if (!!variables.ulm_custom_card_washer_job_states.state1?.name + && !!variables.ulm_custom_card_washer_job_states.state1?.icon) { + columns.push("1fr"); + } + if (!!variables.ulm_custom_card_washer_job_states.state2?.name + && !!variables.ulm_custom_card_washer_job_states.state2?.icon) { + columns.push("1fr"); + } + if (!!variables.ulm_custom_card_washer_job_states.state3?.name + && !!variables.ulm_custom_card_washer_job_states.state3?.icon) { + columns.push("1fr"); + } + if (!!variables.ulm_custom_card_washer_job_states.state4?.name + && !!variables.ulm_custom_card_washer_job_states.state4?.icon) { + columns.push("1fr"); + } + if (!!variables.ulm_custom_card_washer_job_states.state5?.name + && !!variables.ulm_custom_card_washer_job_states.state5?.icon) { + columns.push("1fr"); + } + } + + return columns.join(" "); + ]]] + - grid-template-rows: "min-content" + - column-gap: "7px" + - justify-items: "center" + card: + - padding: "0px" + - box-shadow: "none" + - margin-top: "12px" + - border-radius: "var(--border-radius)" + - pointer-events: "none" + - background-color: "rgba(var(--color-theme), 0.05)" + - justify-items: "center" + custom_fields: + item1: + - display: > + [[[ + return (!!variables.ulm_custom_card_washer_job_states?.state1 + && !!variables.ulm_custom_card_washer_job_states.state1.name + && !!variables.ulm_custom_card_washer_job_states.state1.icon) ? "block" : "none"; + ]]] + item2: + - display: > + [[[ + return (!!variables.ulm_custom_card_washer_job_states?.state2 + && !!variables.ulm_custom_card_washer_job_states.state2.name + && !!variables.ulm_custom_card_washer_job_states.state2.icon) ? "block" : "none"; + ]]] + item3: + - display: > + [[[ + return (!!variables.ulm_custom_card_washer_job_states?.state3 + && !!variables.ulm_custom_card_washer_job_states.state3.name + && !!variables.ulm_custom_card_washer_job_states.state3.icon) ? "block" : "none"; + ]]] + item4: + - display: > + [[[ + return (!!variables.ulm_custom_card_washer_job_states?.state4 + && !!variables.ulm_custom_card_washer_job_states.state4.name + && !!variables.ulm_custom_card_washer_job_states.state4.icon) ? "block" : "none"; + ]]] + item5: + - display: > + [[[ + return (!!variables.ulm_custom_card_washer_job_states?.state5 + && !!variables.ulm_custom_card_washer_job_states.state5.name + && !!variables.ulm_custom_card_washer_job_states.state5.icon) ? "block" : "none"; + ]]] + custom_fields: + item1: + card: + type: "custom:button-card" + template: "custom_card_haven_washer_state" + icon: > + [[[ + return (!!variables.ulm_custom_card_washer_job_states?.state1 + && !!variables.ulm_custom_card_washer_job_states.state1.icon) + ? variables.ulm_custom_card_washer_job_states.state1.icon + : "mdi:cancel"; + ]]] + state: + - value: > + [[[ + return (!!variables.ulm_custom_card_washer_job_states?.state1 + && !!variables.ulm_custom_card_washer_job_states.state1.name) + ? variables.ulm_custom_card_washer_job_states.state1.name + : "unknown"; + ]]] + styles: + icon: + - transform: "scale(1.2)" + - color: "black" + card: + - background-color: "white" + entity: "[[[ return variables.ulm_custom_card_washer_job_state; ]]]" + item2: + card: + type: "custom:button-card" + template: "custom_card_haven_washer_state" + icon: > + [[[ + return (!!variables.ulm_custom_card_washer_job_states?.state2 + && !!variables.ulm_custom_card_washer_job_states.state2.icon) + ? variables.ulm_custom_card_washer_job_states.state2.icon + : "mdi:cancel"; + ]]] + state: + - value: > + [[[ + return (!!variables.ulm_custom_card_washer_job_states?.state2 + && !!variables.ulm_custom_card_washer_job_states.state2.name) + ? variables.ulm_custom_card_washer_job_states.state2.name + : "unknown"; + ]]] + styles: + icon: + - transform: "scale(1.2)" + - color: "black" + card: + - background-color: "white" + entity: "[[[ return variables.ulm_custom_card_washer_job_state; ]]]" + item3: + card: + type: "custom:button-card" + template: "custom_card_haven_washer_state" + icon: > + [[[ + return (!!variables.ulm_custom_card_washer_job_states?.state3 + && !!variables.ulm_custom_card_washer_job_states.state3.icon) + ? variables.ulm_custom_card_washer_job_states.state3.icon + : "mdi:cancel"; + ]]] + state: + - value: > + [[[ + return (!!variables.ulm_custom_card_washer_job_states?.state3 + && !!variables.ulm_custom_card_washer_job_states.state3.name) + ? variables.ulm_custom_card_washer_job_states.state3.name + : "unknown"; + ]]] + styles: + icon: + - transform: "scale(1.2)" + - color: "black" + card: + - background-color: "white" + entity: "[[[ return variables.ulm_custom_card_washer_job_state; ]]]" + item4: + card: + type: "custom:button-card" + template: "custom_card_haven_washer_state" + icon: > + [[[ + return (!!variables.ulm_custom_card_washer_job_states?.state4 + && !!variables.ulm_custom_card_washer_job_states.state4.icon) + ? variables.ulm_custom_card_washer_job_states.state4.icon + : "mdi:cancel"; + ]]] + state: + - value: > + [[[ + return (!!variables.ulm_custom_card_washer_job_states?.state4 + && !!variables.ulm_custom_card_washer_job_states.state4.name) + ? variables.ulm_custom_card_washer_job_states.state4.name + : "unknown"; + ]]] + styles: + icon: + - transform: "scale(1.2)" + - color: "black" + card: + - background-color: "white" + entity: "[[[ return variables.ulm_custom_card_washer_job_state; ]]]" + item5: + card: + type: "custom:button-card" + template: "custom_card_haven_washer_state" + icon: > + [[[ + return (!!variables.ulm_custom_card_washer_job_states?.state5 + && !!variables.ulm_custom_card_washer_job_states.state5.icon) + ? variables.ulm_custom_card_washer_job_states.state5.icon + : "mdi:cancel"; + ]]] + state: + - value: > + [[[ + return (!!variables.ulm_custom_card_washer_job_states?.state5 + && !!variables.ulm_custom_card_washer_job_states.state5.name) + ? variables.ulm_custom_card_washer_job_states.state5.name + : "unknown"; + ]]] + styles: + icon: + - transform: "scale(1.2)" + - color: "black" + card: + - background-color: "white" + entity: "[[[ return variables.ulm_custom_card_washer_job_state ]]]" + row3: + card: + type: "custom:button-card" + template: > + [[[ + return !!variables.ulm_custom_card_washer_delayed_start + && !!variables.ulm_custom_card_washer_delayed_starttime ? "list_3_items" : "list_2_items"; + ]]] + styles: + card: + - padding: "0px" + - margin-top: "12px" + custom_fields: + item3: + - display: > + [[[ + return (!!variables.ulm_custom_card_washer_delayed_start + && !!variables.ulm_custom_card_washer_delayed_starttime) ? "block" : "none"; + ]]] + custom_fields: + item1: + card: + type: "custom:button-card" + template: "widget_icon" + tap_action: + action: > + [[[ + if (!!states[variables.ulm_custom_card_washer_machine_state]?.state + && states[variables.ulm_custom_card_washer_machine_state].state === variables.ulm_custom_card_washer_machine_stop_state) { + return variables.ulm_custom_card_washer_start_action?.action ?? "none"; + } else { + return variables.ulm_custom_card_washer_pause_action?.action ?? "none"; + } + ]]] + entity: "[[[ return variables.ulm_custom_card_washer_start_action.entity; ]]]" + navigation_path: > + [[[ + return (!!states[variables.ulm_custom_card_washer_machine_state]?.state + && states[variables.ulm_custom_card_washer_machine_state].state === variables.ulm_custom_card_washer_machine_stop_state) + ? variables.ulm_custom_card_washer_start_action?.navigation_path + : variables.ulm_custom_card_washer_pause_action?.navigation_path; + ]]] + url_path: > + [[[ + return (!!states[variables.ulm_custom_card_washer_machine_state]?.state + && states[variables.ulm_custom_card_washer_machine_state].state === variables.ulm_custom_card_washer_machine_stop_state) + ? variables.ulm_custom_card_washer_start_action?.url_path + : variables.ulm_custom_card_washer_pause_action?.url_path; + ]]] + service: > + [[[ + return (!!states[variables.ulm_custom_card_washer_machine_state]?.state + && states[variables.ulm_custom_card_washer_machine_state].state === variables.ulm_custom_card_washer_machine_stop_state) + ? variables.ulm_custom_card_washer_start_action?.service + : variables.ulm_custom_card_washer_pause_action?.service; + ]]] + service_data: > + [[[ + return (!!states[variables.ulm_custom_card_washer_machine_state]?.state + && states[variables.ulm_custom_card_washer_machine_state].state === variables.ulm_custom_card_washer_machine_stop_state) + ? variables.ulm_custom_card_washer_start_action?.service_data + : variables.ulm_custom_card_washer_pause_action?.service_data; + ]]] + icon: > + [[[ + return (!!states[variables.ulm_custom_card_washer_machine_state]?.state + && states[variables.ulm_custom_card_washer_machine_state].state === variables.ulm_custom_card_washer_machine_stop_state) ? "mdi:play" : "mdi:pause"; + ]]] + state: + - operator: "template" + value: > + [[[ + return ((states[variables.ulm_custom_card_washer_machine_state].state === variables.ulm_custom_card_washer_machine_stop_state + && (!variables.ulm_custom_card_washer_start_action?.action + || (!!variables.ulm_custom_card_washer_start_action?.action + && variables.ulm_custom_card_washer_start_action.action === "none"))) + || (states[variables.ulm_custom_card_washer_machine_state].state !== variables.ulm_custom_card_washer_machine_stop_state + && (!variables.ulm_custom_card_washer_pause_action?.action + || (!!variables.ulm_custom_card_washer_pause_action?.action + && variables.ulm_custom_card_washer_pause_action.action === "none")))); + ]]] + styles: + icon: + - color: "rgba(var(--color-theme),0.2)" + entity: "[[[ return variables.ulm_custom_card_washer_machine_state; ]]]" + item2: + card: + type: "custom:button-card" + template: "widget_icon" + tap_action: + action: > + [[[ + return (!!variables.ulm_custom_card_washer_machine_state + && !!states[variables.ulm_custom_card_washer_machine_state]?.state + && states[variables.ulm_custom_card_washer_machine_state].state !== variables.ulm_custom_card_washer_machine_stop_state + && variables.ulm_custom_card_washer_stop_action?.action) ?? "none"; + ]]] + entity: "[[[ return variables.ulm_custom_card_washer_stop_action.entity; ]]]" + navigation_path: "[[[ return variables.ulm_custom_card_washer_stop_action.navigation_path; ]]]" + url_path: "[[[ return variables.ulm_custom_card_washer_stop_action.url_path; ]]]" + service: "[[[ return variables.ulm_custom_card_washer_stop_action.service; ]]]" + service_data: "[[[ return variables.ulm_custom_card_washer_stop_action.service_data; ]]]" + icon: "mdi:stop" + state: + - operator: "template" + value: > + [[[ + return ((!!variables.ulm_custom_card_washer_machine_state + && !!states[variables.ulm_custom_card_washer_machine_state]?.state + && states[variables.ulm_custom_card_washer_machine_state].state === variables.ulm_custom_card_washer_machine_stop_state) + || !variables.ulm_custom_card_washer_stop_action?.action + || (!!variables.ulm_custom_card_washer_stop_action?.action + && variables.ulm_custom_card_washer_stop_action.action === "none")); + ]]] + styles: + icon: + - color: "rgba(var(--color-theme),0.2)" + entity: "[[[ return variables.ulm_custom_card_washer_machine_state ]]]" + item3: + card: + type: "custom:button-card" + template: + - "widget_icon" + - "green_on" + tap_action: + action: > + [[[ + return (!!variables.ulm_custom_card_washer_machine_state + && !!states[variables.ulm_custom_card_washer_machine_state]?.state + && states[variables.ulm_custom_card_washer_machine_state].state === variables.ulm_custom_card_washer_machine_stop_state) + ? "toggle" + : "none"; + ]]] + state: + - operator: "template" + value: > + [[[ + return (!!variables.ulm_custom_card_washer_machine_state + && !!states[variables.ulm_custom_card_washer_machine_state]?.state + && states[variables.ulm_custom_card_washer_machine_state].state !== variables.ulm_custom_card_washer_machine_stop_state); + ]]] + styles: + icon: + - color: "rgba(var(--color-theme),0.2)" + entity: "[[[ return variables.ulm_custom_card_washer_delayed_start; ]]]" + row4: + card: + type: "custom:button-card" + template: "list_3_items" + styles: + card: + - padding: "0px" + - margin-top: "12px" + custom_fields: + item1: + card: + type: "custom:button-card" + template: "widget_icon" + tap_action: + action: "perform-action" + perform_action: "input_datetime.set_datetime" + target: + entity_id: "[[[ return variables.ulm_custom_card_washer_delayed_starttime; ]]]" + data: + time: > + [[[ + if (!!variables.ulm_custom_card_washer_delayed_starttime + && !!states[variables.ulm_custom_card_washer_delayed_starttime]?.attributes) { + var timestamp = states[variables.ulm_custom_card_washer_delayed_starttime].attributes.timestamp + + let unix_timestamp = timestamp - 4500; + // Create a new JavaScript Date object based on the timestamp + // multiplied by 1000 so that the argument is in milliseconds, not seconds. + var date = new Date(unix_timestamp * 1000); + // Hours part from the timestamp + var hours = date.getHours(); + // Minutes part from the timestamp + var minutes = "0" + date.getMinutes(); + // Seconds part from the timestamp + var seconds = "0" + date.getSeconds(); + // Will display time in 10:30:23 format + return hours + ":" + minutes.substr(-2) + ":" + seconds.substr(-2); + } else { + return "00:00:00"; + } + ]]] + icon: "mdi:arrow-down" + item2: + card: + type: "custom:button-card" + template: "custom_card_haven_washer_delayed_text" + tap_action: + action: "perform-action" + perform_action: "input_datetime.set_datetime" + target: + entity_id: "[[[ return variables.ulm_custom_card_washer_delayed_starttime; ]]]" + data: + time: > + [[[ + if (!!variables.ulm_custom_card_washer_delayed_starttime + && !!states[variables.ulm_custom_card_washer_delayed_starttime]?.attributes) { + var timestamp = states[variables.ulm_custom_card_washer_delayed_starttime].attributes.timestamp + + let unix_timestamp = timestamp - 3540; + // Create a new JavaScript Date object based on the timestamp + // multiplied by 1000 so that the argument is in milliseconds, not seconds. + var date = new Date(unix_timestamp * 1000); + // Hours part from the timestamp + var hours = date.getHours(); + // Minutes part from the timestamp + var minutes = "0" + date.getMinutes(); + // Seconds part from the timestamp + var seconds = "0" + date.getSeconds(); + // Will display time in 10:30:23 format + return hours + ":" + minutes.substr(-2) + ":" + seconds.substr(-2); + } else { + return "00:00:00"; + } + ]]] + hold_action: + action: "perform-action" + perform_action: "input_datetime.set_datetime" + target: + entity_id: "[[[ variables.ulm_custom_card_washer_delayed_starttime ]]]" + data: + time: > + [[[ + if (!!variables.ulm_custom_card_washer_delayed_starttime + && !!states[variables.ulm_custom_card_washer_delayed_starttime]?.attributes) { + var timestamp = states[variables.ulm_custom_card_washer_delayed_starttime].attributes.timestamp + + let unix_timestamp = timestamp - 3660; + // Create a new JavaScript Date object based on the timestamp + // multiplied by 1000 so that the argument is in milliseconds, not seconds. + var date = new Date(unix_timestamp * 1000); + // Hours part from the timestamp + var hours = date.getHours(); + // Minutes part from the timestamp + var minutes = "0" + date.getMinutes(); + // Seconds part from the timestamp + var seconds = "0" + date.getSeconds(); + // Will display time in 10:30:23 format + return hours + ":" + minutes.substr(-2) + ":" + seconds.substr(-2); + } else { + return "00:00:00"; + } + ]]] + entity: "[[[ return variables.ulm_custom_card_washer_delayed_starttime; ]]]" + item3: + card: + type: "custom:button-card" + template: "widget_icon" + tap_action: + action: "perform-action" + perform_action: "input_datetime.set_datetime" + target: + entity_id: "[[[ return variables.ulm_custom_card_washer_delayed_starttime ]]]" + data: + time: > + [[[ + if (!!variables.ulm_custom_card_washer_delayed_starttime + && !!states[variables.ulm_custom_card_washer_delayed_starttime]?.attributes) { + var timestamp = states[variables.ulm_custom_card_washer_delayed_starttime].attributes.timestamp + let unix_timestamp = timestamp - 2700; + // Create a new JavaScript Date object based on the timestamp + // multiplied by 1000 so that the argument is in milliseconds, not seconds. + var date = new Date(unix_timestamp * 1000); + // Hours part from the timestamp + var hours = date.getHours(); + // Minutes part from the timestamp + var minutes = "0" + date.getMinutes(); + // Seconds part from the timestamp + var seconds = "0" + date.getSeconds(); + // Will display time in 10:30:23 format + return hours + ":" + minutes.substr(-2) + ":" + seconds.substr(-2); + } else { + return "00:00:00"; + } + ]]] + icon: "mdi:arrow-up" + +custom_card_haven_washer_state: + show_icon: true + show_name: false + tap_action: + action: "none" + size: "20px" + styles: + card: + - box-shadow: "none" + - padding: "0px" + - border-radius: "50%" + - place-self: "center" + - height: "42px" + - width: "42px" + - pointer-events: "auto" + - background-color: "transparent" + grid: + - grid-template-areas: "'i'" + icon: + - color: "var(--google-grey)" + +custom_card_haven_washer_delayed_text: + template: + - "ulm_translation_engine" + tap_action: + action: "toggle" + show_icon: false + show_label: true + show_name: false + label: "[[[ return variables.ulm_translation_state ]]]" + styles: + state: + - color: "rgba(var(--color-theme),0.9)" + grid: + - grid-template-areas: "'l'" + card: + - box-shadow: "none" + - padding: "0px" + - background-color: "rgba(var(--color-theme),0.05)" + - border-radius: "14px" + - place-self: "center" + - height: "42px" + size: "20px" + color: "var(--google-grey)" diff --git a/custom_cards/custom_card_heat_pump/README.md b/custom_cards/custom_card_heat_pump/README.md index ad2b5543a..b5d0fac26 100644 --- a/custom_cards/custom_card_heat_pump/README.md +++ b/custom_cards/custom_card_heat_pump/README.md @@ -24,9 +24,9 @@ Initial release ## Images -![Heat_pump](Heat_pump.PNG) +![Heat_pump](../../docs/assets/img/Heat_pump.PNG) -![Heat_pump_gif](heat_pump.gif) +![Heat_pump_gif](../../docs/assets/img/heat_pump.gif) ## Usage diff --git a/custom_cards/custom_card_heat_pump/custom_card_heat_pump.yaml b/custom_cards/custom_card_heat_pump/custom_card_heat_pump.yaml index df0477091..b3097b1ba 100644 --- a/custom_cards/custom_card_heat_pump/custom_card_heat_pump.yaml +++ b/custom_cards/custom_card_heat_pump/custom_card_heat_pump.yaml @@ -99,10 +99,11 @@ custom_card_heat_pump: template: "widget_icon" icon: "mdi:arrow-down" tap_action: - action: "call-service" - service: "climate.set_temperature" - service_data: + action: "perform-action" + perform_action: "climate.set_temperature" + target: entity_id: "[[[ return entity.entity_id ]]]" + data: temperature: "[[[ return entity.attributes.temperature - entity.attributes.target_temp_step ]]]" item2: card: @@ -120,10 +121,11 @@ custom_card_heat_pump: template: "widget_icon" icon: "mdi:arrow-up" tap_action: - action: "call-service" - service: "climate.set_temperature" - service_data: + action: "perform-action" + perform_action: "climate.set_temperature" + target: entity_id: "[[[ return entity.entity_id ]]]" + data: temperature: "[[[ return entity.attributes.temperature + entity.attributes.target_temp_step ]]]" item3: card: @@ -133,19 +135,21 @@ custom_card_heat_pump: template: "widget_icon_juve" icon: "mdi:power" tap_action: - action: "call-service" - service: "climate.set_hvac_mode" - service_data: + action: "perform-action" + perform_action: "climate.set_hvac_mode" + target: entity_id: "[[[ return entity.entity_id ]]]" + data: hvac_mode: "off" - type: "custom:button-card" template: "widget_icon_juve" icon: "mdi:fire" tap_action: - action: "call-service" - service: "climate.set_hvac_mode" - service_data: + action: "perform-action" + perform_action: "climate.set_hvac_mode" + target: entity_id: "[[[ return entity.entity_id ]]]" + data: hvac_mode: "heat" styles: icon: @@ -170,10 +174,11 @@ custom_card_heat_pump: template: "widget_icon_juve" icon: "mdi:snowflake" tap_action: - action: "call-service" - service: "climate.set_hvac_mode" - service_data: + action: "perform-action" + perform_action: "climate.set_hvac_mode" + target: entity_id: "[[[ return entity.entity_id ]]]" + data: hvac_mode: "cool" styles: icon: @@ -198,10 +203,11 @@ custom_card_heat_pump: template: "widget_icon_juve" icon: "mdi:sync" tap_action: - action: "call-service" - service: "climate.set_hvac_mode" - service_data: + action: "perform-action" + perform_action: "climate.set_hvac_mode" + target: entity_id: "[[[ return entity.entity_id ]]]" + data: hvac_mode: "heat_cool" styles: icon: @@ -226,10 +232,11 @@ custom_card_heat_pump: template: "widget_icon_juve" icon: "mdi:water" tap_action: - action: "call-service" - service: "climate.set_hvac_mode" - service_data: + action: "perform-action" + perform_action: "climate.set_hvac_mode" + target: entity_id: "[[[ return entity.entity_id ]]]" + data: hvac_mode: "dry" styles: icon: @@ -254,10 +261,11 @@ custom_card_heat_pump: template: "widget_icon_juve" icon: "mdi:fan" tap_action: - action: "call-service" - service: "climate.set_hvac_mode" - service_data: + action: "perform-action" + perform_action: "climate.set_hvac_mode" + target: entity_id: "[[[ return entity.entity_id ]]]" + data: hvac_mode: "fan_only" styles: icon: diff --git a/custom_cards/custom_card_httpedo13_thermostat/custom_card_httpedo13_thermostat.yaml b/custom_cards/custom_card_httpedo13_thermostat/custom_card_httpedo13_thermostat.yaml index f1c44182c..254bf35c3 100644 --- a/custom_cards/custom_card_httpedo13_thermostat/custom_card_httpedo13_thermostat.yaml +++ b/custom_cards/custom_card_httpedo13_thermostat/custom_card_httpedo13_thermostat.yaml @@ -75,10 +75,11 @@ custom_card_httpedo13_thermostat_with_buttons: return 'var(--card-background-color)'; ]]] tap_action: - action: "call-service" - service: "climate.set_hvac_mode" - service_data: + action: "perform-action" + perform_action: "climate.set_hvac_mode" + target: entity_id: "[[[ return variables.entity ]]]" + data: hvac_mode: | [[[ if (states[variables.entity].state == "off"){ @@ -109,10 +110,11 @@ custom_card_httpedo13_thermostat_with_buttons: - "icon_info" - "custom_card_httpedo13_thermostat" tap_action: - action: "call-service" - service: "climate.set_hvac_mode" - service_data: + action: "perform-action" + perform_action: "climate.set_hvac_mode" + target: entity_id: "[[[ return variables.entity ]]]" + data: hvac_mode: | [[[ if (states[variables.entity].state == "off"){ @@ -157,11 +159,12 @@ custom_card_httpedo13_thermostat_with_buttons: template: "widget_icon_for_thermostat" entity: "[[[ return variables.entity ]]]" tap_action: - action: "call-service" - service: "climate.set_temperature" - service_data: - temperature: "[[[ return (parseFloat(states[variables.entity].attributes.temperature) - 0.5) ]]]" + action: "perform-action" + perform_action: "climate.set_temperature" + target: entity_id: "[[[ return variables.entity ]]]" + data: + temperature: "[[[ return (parseFloat(states[variables.entity].attributes.temperature) - 0.5) ]]]" icon: "mdi:minus" item2: card: @@ -177,11 +180,12 @@ custom_card_httpedo13_thermostat_with_buttons: template: "widget_icon_for_thermostat" entity: "[[[ return variables.entity ]]]" tap_action: - action: "call-service" - service: "climate.set_temperature" - service_data: - temperature: "[[[ return (parseFloat(states[variables.entity].attributes.temperature) + 0.5) ]]]" + action: "perform-action" + perform_action: "climate.set_temperature" + target: entity_id: "[[[ return variables.entity ]]]" + data: + temperature: "[[[ return (parseFloat(states[variables.entity].attributes.temperature) + 0.5) ]]]" icon: "mdi:plus" custom_card_httpedo13_thermostat_with_buttons_collapse: @@ -204,10 +208,11 @@ custom_card_httpedo13_thermostat_with_buttons_collapse: return 'var(--card-background-color)'; ]]] tap_action: - action: "call-service" - service: "climate.set_hvac_mode" - service_data: + action: "perform-action" + perform_action: "climate.set_hvac_mode" + target: entity_id: "[[[ return variables.entity ]]]" + data: hvac_mode: | [[[ if (states[variables.entity].state == "off"){ @@ -238,10 +243,11 @@ custom_card_httpedo13_thermostat_with_buttons_collapse: - "icon_info" - "custom_card_httpedo13_thermostat" tap_action: - action: "call-service" - service: "climate.set_hvac_mode" - service_data: + action: "perform-action" + perform_action: "climate.set_hvac_mode" + target: entity_id: "[[[ return variables.entity ]]]" + data: hvac_mode: | [[[ if (states[variables.entity].state == "off"){ @@ -291,11 +297,12 @@ custom_card_httpedo13_thermostat_with_buttons_collapse: template: "widget_icon_for_thermostat" entity: "[[[ return variables.entity ]]]" tap_action: - action: "call-service" - service: "climate.set_temperature" - service_data: - temperature: "[[[ return (parseFloat(states[variables.entity].attributes.temperature) - 0.5) ]]]" + action: "perform-action" + perform_action: "climate.set_temperature" + target: entity_id: "[[[ return variables.entity ]]]" + data: + temperature: "[[[ return (parseFloat(states[variables.entity].attributes.temperature) - 0.5) ]]]" icon: "mdi:minus" item2: card: @@ -311,11 +318,12 @@ custom_card_httpedo13_thermostat_with_buttons_collapse: template: "widget_icon_for_thermostat" entity: "[[[ return variables.entity ]]]" tap_action: - action: "call-service" - service: "climate.set_temperature" - service_data: - temperature: "[[[ return (parseFloat(states[variables.entity].attributes.temperature) + 0.5) ]]]" + action: "perform-action" + perform_action: "climate.set_temperature" + target: entity_id: "[[[ return variables.entity ]]]" + data: + temperature: "[[[ return (parseFloat(states[variables.entity].attributes.temperature) + 0.5) ]]]" icon: "mdi:plus" widget_current_temperature: diff --git a/custom_cards/custom_card_iAbadia_battery_chip/README.md b/custom_cards/custom_card_iAbadia_battery_chip/README.md new file mode 100644 index 000000000..ece9f3ec9 --- /dev/null +++ b/custom_cards/custom_card_iAbadia_battery_chip/README.md @@ -0,0 +1,58 @@ +--- +title: iAbadia's Battery Chip Custom Card +hide: + - toc +--- + + + +# Custom-card "Battery Chip" + +This is a `custom-card` or `custom-chip` to see your device's battery level at a glance. + +![Screenshot](../../docs/assets/img/custom_card_iAbadia_battery_chip.png) + +## Credits + +Author: Iñaki Abadia - 2024 +Version: 1.0.0 + +## Changelog + +
+1.0.0 +Initial release +
+ +## Requirements + +None + +## Usage + +```yaml +type: "custom:button-card" +template: custom_card_iAbadia_battery_chip +variables: + ulm_custom_card_iAbadia_battery_chip_entity: sensor.living_room_sensor_battery + ulm_custom_card_iAbadia_battery_chip_icon: mdi:thermostat + ulm_custom_card_iAbadia_battery_chip_warning: 30 + ulm_custom_card_iAbadia_battery_chip_danger: 10 +``` + +## Variables + +| Variable | Example | Required | Explanation | +| ---------------------------------------------- | -------------------- | -------- | ----------------------------------------------------- | +| ulm_custom_card_iAbadia_battery_chip_entity | `sensor.temperature` | ✓ | Battery entity | +| ulm_custom_card_iAbadia_battery_chip_icon | `mdi:thermometer` | ✘ | Icon to be displayed. Will default to mdi:battery | +| ulm_custom_card_iAbadia_battery_chip_warning | `20` | ✘ | Battery level below which to color as warning (yellow) | +| ulm_custom_card_iAbadia_battery_chip_danger | `10` | ✘ | Battery level below which to color as danger (red) | + +## Template Code + +??? note "Template Code" + + ```yaml title="custom_card_irmajavi_speedtest.yaml" + --8<-- "custom_cards/custom_card_iAbadia_battery_chip/custom_card_iAbadia_battery_chip.yaml" + ``` diff --git a/custom_cards/custom_card_iAbadia_battery_chip/custom_card_iAbadia_battery_chip.yaml b/custom_cards/custom_card_iAbadia_battery_chip/custom_card_iAbadia_battery_chip.yaml new file mode 100644 index 000000000..2f9dca3f7 --- /dev/null +++ b/custom_cards/custom_card_iAbadia_battery_chip/custom_card_iAbadia_battery_chip.yaml @@ -0,0 +1,38 @@ +--- +custom_card_iAbadia_battery_chip: + template: + - "chips" + variables: + ulm_custom_card_iAbadia_battery_chip_entity: "" + ulm_custom_card_iAbadia_battery_chip_icon: "" + ulm_custom_card_iAbadia_battery_chip_danger: "10" + ulm_custom_card_iAbadia_battery_chip_warning: "20" + show_icon: true + triggers_update: "all" + icon: > + [[[ + if (variables.ulm_custom_card_iAbadia_battery_chip_icon){ + return variables.ulm_custom_card_iAbadia_battery_chip_icon; + } else { + return "mdi:battery" + } + ]]] + entity: "[[[ return variables.ulm_custom_card_iAbadia_battery_chip_entity; ]]]" + tap_action: + action: "more-info" + entity: "[[[ return variables.ulm_custom_card_iAbadia_battery_chip_entity; ]]]" + styles: + icon: + - color: > + [[[ + let battery_level = Math.round((states[variables.ulm_custom_card_iAbadia_battery_chip_entity].state)/1); + if (battery_level > variables.ulm_custom_card_iAbadia_battery_chip_warning) { + return "var(--google-green)" + } else if (battery_level <= variables.ulm_custom_card_iAbadia_battery_chip_warning && battery_level > variables.ulm_custom_card_iAbadia_battery_chip_danger) { + return "var(--google-yellow)" + } else { + return "var(--google-red)" + } + ]]] + grid: + - grid-template-areas: "'i'" diff --git a/custom_cards/custom_card_imswel_medias/README.md b/custom_cards/custom_card_imswel_medias/README.md new file mode 100644 index 000000000..6e137338b --- /dev/null +++ b/custom_cards/custom_card_imswel_medias/README.md @@ -0,0 +1,81 @@ +--- +title: Custom Card Media +hide: + - toc +--- + + + +# Custom Card "Media" + +These are some `custom-card` for your plex, radarr and sonarr media libraries. + +![example-image-radarr](../../docs/assets/img/custom_card_imswel_medias/medias_upcoming_radarr.png) +![example-image-sonarr](../../docs/assets/img/custom_card_imswel_medias/medias_upcoming_sonarr.png)
+![example-image-plex](../../docs/assets/img/custom_card_imswel_medias/medias_library_plex.png) + +## Credits + +- Author: imswel - 2023 +- Version: 1.0.0 + +## Changelog + +
+1.0.0 +Initial release +
+ +## Requirements + +This card needs the following to function correctly: +| Component | Required | +| ----------------------------------------------------------------------------------------- | ---------------------------------- | +|[Plex Recently Added](https://github.com/NemesisRE/sensor.plex_recently_added) | Yes for **`Media Library Card`** | +|[Radarr Upcoming Media](https://github.com/custom-components/sensor.radarr_upcoming_media) | Yes for **`Media Upcoming Card`** | +|[Sonarr Upcoming Media](https://github.com/custom-components/sensor.sonarr_upcoming_media) | Yes for **`Media Upcoming Card`** | + +## Usage + +**Media Library Card** for [Plex Recently Added](https://github.com/NemesisRE/sensor.plex_recently_added) : + +![example-image-plex](../../docs/assets/img/custom_card_imswel_medias/medias_library_plex.png)
+| Variable | Default | Required | Notes | +| ----------------------------- | ------- | -------- | ----------------------------------------------------------------------- | +| ulm_custom_card_imswel_medias_index | 1 | Yes | The index of the item in your **Plex library** to show. | + +```yaml +- type: custom:button-card + template: "custom_card_imswel_medias_library" + entity: sensor.plex_recently_added + variables: + ulm_custom_card_imswel_medias_index: 1 +``` + +
+ +**Media Upcoming Card** for [Radarr Upcoming Media](https://github.com/custom-components/sensor.radarr_upcoming_media) & [Sonarr Upcoming Media](https://github.com/custom-components/sensor.sonarr_upcoming_media) : + +![example-image-radarr](../../docs/assets/img/custom_card_imswel_medias/medias_upcoming_radarr.png) +![example-image-sonarr](../../docs/assets/img/custom_card_imswel_medias/medias_upcoming_sonarr.png)
+| Variable | Default | Required | Notes | +| ----------------------------- | ------- | -------- | -------------------------------------------------------------------------------------------------------- | +| ulm_custom_card_imswel_medias_index | 1 | Yes | The index of the item in your **Radarr/Sonarr library** to show. | +| ulm_custom_card_imswel_medias_platform| radarr | Yes | The platform to choose depending on the selected entity.
Can be: **`radarr`** or **`sonarr`**.
| + +```yaml +- type: custom:button-card + template: "custom_card_imswel_medias_upcoming" + entity: sensor.sonarr_upcoming_media + variables: + ulm_custom_card_imswel_medias_index: 1 + ulm_custom_card_imswel_medias_platform: "sonarr" +``` + +## Template code + +??? note "Template Code" + + ```yaml title="custom_card_imswel_medias.yaml" + --8<-- "custom_cards/custom_card_imswel_medias/custom_card_imswel_medias.yaml" + ``` diff --git a/custom_cards/custom_card_imswel_medias/custom_card_imswel_medias.yaml b/custom_cards/custom_card_imswel_medias/custom_card_imswel_medias.yaml new file mode 100644 index 000000000..2dc14d022 --- /dev/null +++ b/custom_cards/custom_card_imswel_medias/custom_card_imswel_medias.yaml @@ -0,0 +1,223 @@ +--- +custom_card_imswel_medias: + show_icon: false + show_label: true + show_name: true + show_state: false + styles: + label: + - z-index: 2 + - color: "white" + - font-weight: "bold" + - font-size: "12px" + - filter: "opacity(60%)" + name: + - z-index: 2 + - color: "white" + - font-weight: "bold" + - font-size: "14px" + card: + - z-index: 0 + - border-radius: "var(--border-radius)" + - box-shadow: "var(--box-shadow)" + - background-size: "cover" + - background-position: "center center" + - text-shadow: > + [[[ + return entity == "undefined" ? "none" : "1px 1px 5px rgba(18, 22, 23, 0.9)"; + ]]] + +custom_card_imswel_medias_library: + template: + - "custom_card_imswel_medias" + - "ulm_translation_engine" + - "custom_card_imswel_medias_language_variables" + variables: + ulm_custom_card_imswel_medias_index: 1 + triggers_update: "[[[ return entity.entity_id; ]]]" + aspect_ratio: "5/2" + label: > + [[[ + if (entity.state == "unavailable" || entity.state == "undefined"){ + return variables.ulm_translation_unavailable; + } else{ + var data = entity.attributes.data; + if (data[variables.ulm_custom_card_imswel_medias_index].number == undefined){ + var number = '(' + data[variables.ulm_custom_card_imswel_medias_index].aired.split('-')[0] + ')'; + } else{ + var number = data[variables.ulm_custom_card_imswel_medias_index].number; + } + return `${data[variables.ulm_custom_card_imswel_medias_index].title} ${number}`; + } + ]]] + name: "[[[ return variables.ulm_custom_card_imswel_recentlyadded ]]]" + styles: + label: + - align-self: "start" + - justify-self: "start" + - margin-left: "12px" + name: + - align-self: "end" + - justify-self: "start" + - margin-left: "12px" + grid: + - grid-template-areas: "'icon .' 'n n' 'l l' '. .'" + - grid-template-rows: "auto repeat(2, min-content) 12px" + card: + - padding: "0px" + - background-image: > + [[[ + return entity === undefined || `url(${states[entity.entity_id].attributes.data[variables.ulm_custom_card_imswel_medias_index].fanart})`; + ]]] + - border: "none" + custom_fields: + icon: + - z-index: 2 + - align-self: "start" + - justify-self: "start" + - height: "24px" + - width: "24px" + - margin-left: "12px" + - margin-top: "12px" + blur: + - z-index: 1 + - position: "absolute" + - top: 0 + - left: 0 + - height: "100%" + - width: "100%" + - border-radius: "var(--border-radius)" + - background: "linear-gradient(rgba(0,0,0,0) 40%, rgba(0,0,0,0.8) 100%)" + custom_fields: + icon: > + + + + + blur: > + [[[ return entity === undefined ? null : "
"; ]]] + +custom_card_imswel_medias_upcoming: + template: + - "custom_card_imswel_medias" + - "ulm_translation_engine" + - "custom_card_imswel_medias_language_variables" + variables: + ulm_custom_card_imswel_medias_index: 1 + ulm_custom_card_imswel_medias_platform: > + [[[ + if (entity.entity_id.includes("sonarr")){ + return "sonarr"; + } else if(entity.entity_id.includes("plex")){ + return "plex"; + } else{ + return "radarr"; + } + ]]] + triggers_update: "all" + aspect_ratio: "3/4" + label: > + [[[ + var data = entity.attributes?.data; + var platform = variables.ulm_custom_card_imswel_medias_platform; + var airdate = new Date(data[variables.ulm_custom_card_imswel_medias_index].airdate); + + Date.prototype.addDays = function (days) { + const date = new Date(this.valueOf()); + date.setDate(date.getDate() + days); + return date; + } + + function formatRelease(release){ + if(release.includes("Available")){ + return "" + } else if (release.includes("In Theaters")){ + return variables.ulm_custom_card_imswel_in_theaters; + } + } + + function formatDate(date){ + var weekday = variables.ulm_custom_card_imswel_weekday; + var now = new Date(); + var tomorrow = now.addDays(1); + + var time = date - now; + var secs = parseInt((time / 1000), 10); + var days = Math.floor(secs / (3600*24)); + + if (days < 6){ + if (weekday[date.getDay()] == weekday[now.getDay()]){ + return variables.ulm_custom_card_imswel_today; + } else if (weekday[date.getDay()] == weekday[tomorrow.getDay()]){ + return variables.ulm_custom_card_imswel_tommorow; + } else{ + return weekday[date.getDay()]; + } + } else{ + return date.toLocaleDateString(variables.ulm_custom_card_imswel_locale); + } + } + + if(platform == "radarr"){ + var release = data[variables.ulm_custom_card_imswel_medias_index].release; + return formatDate(airdate) + " " + formatRelease(release); + } else if(platform == "sonarr"){ + return formatDate(airdate); + } + ]]] + name: > + [[[ + if (entity.state == "unavailable" || entity.state == "undefined"){ + return variables.ulm_translation_unavailable; + } else{ + var data = entity.attributes?.data; + var platform = variables.ulm_custom_card_imswel_medias_platform; + + if(platform == "radarr"){ + return `${data[variables.ulm_custom_card_imswel_medias_index].title}`; + } else if(platform =="sonarr"){ + var number = data[variables.ulm_custom_card_imswel_medias_index].number; + return `${data[variables.ulm_custom_card_imswel_medias_index].title} - ${number}`; + } + } + ]]] + styles: + icon: + label: + - align-self: "start" + - justify-self: "center" + name: + - align-self: "end" + - justify-self: "center" + state: + img_cell: + grid: + - grid-template-areas: "'. . .' '. n .' '. l .' '. . .'" + - grid-template-columns: "8px 1fr 8px" + - grid-template-rows: "auto repeat(2, min-content) 8px" + card: + - background-image: > + [[[ + return entity === undefined || `url(${states[entity.entity_id].attributes.data[variables.ulm_custom_card_imswel_medias_index].poster})`; + ]]] + - border: "none" + custom_fields: + overlay: + - z-index: 1 + - position: "absolute" + - top: 0 + - left: 0 + - height: "100%" + - width: "100%" + - border-radius: "var(--border-radius)" + - background: "linear-gradient(rgba(0,0,0,0) 50%, rgba(0,0,0,0.8) 100%)" + extra_styles: > + .ellipsis:not(#overlay){ + white-space: normal !important; + word-wrap: break-all; + max-height: 2.4em; + line-height: 1.2em; + } + custom_fields: + overlay: > + [[[ return entity === undefined ? null : "
"; ]]] diff --git a/custom_cards/custom_card_imswel_medias/languages/EN.yaml b/custom_cards/custom_card_imswel_medias/languages/EN.yaml new file mode 100644 index 000000000..55da51024 --- /dev/null +++ b/custom_cards/custom_card_imswel_medias/languages/EN.yaml @@ -0,0 +1,13 @@ +--- +# EN.yaml for custom_card_imswel_medias +custom_card_imswel_medias_language_variables: + variables: + ulm_custom_card_imswel_recentlyadded: "Recently added" + ulm_custom_card_imswel_in_theaters: "in theathers" + ulm_custom_card_imswel_weekday: > + [[[ + return ["Sunday","Monday","Thuesday","Wednesday","Thursday","Friday","Saturday"]; + ]]] + ulm_custom_card_imswel_today: "Today" + ulm_custom_card_imswel_tommorow: "Tommorow" + ulm_custom_card_imswel_locale: "en-US" diff --git a/custom_cards/custom_card_imswel_medias/languages/FR.yaml b/custom_cards/custom_card_imswel_medias/languages/FR.yaml new file mode 100644 index 000000000..3d984af34 --- /dev/null +++ b/custom_cards/custom_card_imswel_medias/languages/FR.yaml @@ -0,0 +1,13 @@ +--- +# FR.yaml for custom_card_imswel_medias +custom_card_imswel_medias_language_variables: + variables: + ulm_custom_card_imswel_recentlyadded: "Récemment ajouté" + ulm_custom_card_imswel_in_theaters: "au cinéma" + ulm_custom_card_imswel_weekday: > + [[[ + return ["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"]; + ]]] + ulm_custom_card_imswel_today: "Aujourd'hui" + ulm_custom_card_imswel_tommorow: "Demain" + ulm_custom_card_imswel_locale: "fr-FR" diff --git a/custom_cards/custom_card_imswel_person/README.md b/custom_cards/custom_card_imswel_person/README.md index 2562fa6ae..c8f5eeb52 100644 --- a/custom_cards/custom_card_imswel_person/README.md +++ b/custom_cards/custom_card_imswel_person/README.md @@ -14,10 +14,14 @@ This is a `custom-card` that improves the original person card (`card_person`) b ## Credits Author: imswel - 2022 -Version: 1.0.1 +Version: 1.0.2 ## Changelog +
+ 1.0.2 + UI fix and improvement. +
1.0.1 Breaking change: removed variable for zones, instead load all zones automatically. @@ -52,9 +56,9 @@ This card needs the following to function correctly: template: custom_card_imswel_person variables: ulm_card_imswel_person_entity: person.john - ulm_card_imswel_person_wifi_tracker: device_tracker.wifi_oneplus_6t - ulm_card_imswel_person_gps_tracker: device_tracker.oneplus_6t - ulm_card_imswel_person_findmy_script: script.find_my_oneplus_6t + ulm_card_imswel_person_wifi_tracker: device_tracker.my_phone_wifi + ulm_card_imswel_person_gps_tracker: device_tracker.my_phone + ulm_card_imswel_person_findmy_script: script.find_my_phone ulm_card_imswel_person_use_entity_picture: true ``` @@ -75,19 +79,19 @@ This card needs the following to function correctly: ulm_card_imswel_person_wifi_tracker - device_tracker.wifi_oneplus_6t + device_tracker.my_phone_wifi yes A device_tracker entity of the person based on wifi ulm_card_imswel_person_gps_tracker - device_tracker.oneplus_6t + device_tracker.my_phone yes A device_tracker entity of the person based on location ulm_card_imswel_person_findmy_script - script.find_my_oneplus_6t + script.find_my_phone yes A script entity that make ring your phone @@ -99,6 +103,27 @@ This card needs the following to function correctly: +#### Phone finder script example + +```yaml +find_my_phone: + sequence: + - service: notify.mobile_app_my_android + data: + message: command_volume_level + data: + media_stream: alarm_stream + command: 20 + - service: notify.mobile_app_my_android + data: + message: Home Assistant is searching your phone ! + data: + ttl: 0 + priority: high + channel: alarm_stream + mode: single +``` + ??? note "Template Code" ```yaml title="custom_card_imswel_person.yaml" diff --git a/custom_cards/custom_card_imswel_person/custom_card_imswel_person.yaml b/custom_cards/custom_card_imswel_person/custom_card_imswel_person.yaml index c7a210937..3c387afca 100644 --- a/custom_cards/custom_card_imswel_person/custom_card_imswel_person.yaml +++ b/custom_cards/custom_card_imswel_person/custom_card_imswel_person.yaml @@ -1,41 +1,13 @@ --- -find_my_phone_button: - template: - - "ulm_custom_card_imswel_person_language_variables" - tap_action: - action: "toggle" - icon: "mdi:volume-high" - name: "[[[ return variables.ulm_custom_card_imswel_person_findmy; ]]]" - size: "1.4em" - styles: - icon: - - color: "rgba(var(--color-blue),1)" - name: - - font-size: "1.06em" - - letterspacing: "0.015em" - grid: - - grid-template-areas: "'i n'" - - grid-column-gap: "0.3em" - card: - - color: "rgba(var(--color-blue),1)" - - background: "rgba(var(--color-blue),0.2" - - border-radius: "0.6em" - - padding: "1em 1.4em" - - width: "max-content" - - font-size: "1.06em" - - font-weight: "500" - - letter-spacing: "0.015em" - - box-shadow: "none" - custom_card_imswel_person: template: - - "icon_info_bg" - "ulm_translation_engine" + - "icon_info_bg" - "ulm_custom_card_imswel_person_language_variables" - "custom_popup_imswel_person" variables: ulm_card_imswel_person_use_entity_picture: false - triggers_update: "all" + triggers_update: "[[[ return variables.ulm_card_imswel_person_entity ]]]" show_entity_picture: "[[[ return variables.ulm_card_imswel_person_use_entity_picture ]]]" show_label: true show_name: true @@ -50,9 +22,19 @@ custom_card_imswel_person: ]]] label: > [[[ - let state = states[variables.ulm_card_imswel_person_entity].state - let option = ["home", "not_home", "unavailable", "unknown"] - return (option.includes(state)) ? variables.ulm_translation_state : state; + let state = states[variables.ulm_card_imswel_person_entity].state; + let option = ["home", "not_home", "unavailable", "unknown"]; + if (option.includes(state)){ + if (state == "home"){ + return variables.ulm_custom_card_imswel_person_home; + } else if (state == "not_home"){ + return variables.ulm_custom_card_imswel_person_not_home; + } else{ + return variables.ulm_translation_unavailable; + } + } else{ + return state; + } ]]] name: "[[[ return states[variables.ulm_card_imswel_person_entity].attributes.friendly_name ]]]" entity: "[[[ return variables.ulm_card_imswel_person_entity; ]]]" @@ -80,7 +62,11 @@ custom_card_imswel_person: - line-height: "14px" - background-color: > [[[ - if (states[variables.ulm_card_imswel_person_entity].state == 'home') { + let state = states[variables.ulm_card_imswel_person_entity].state; + let option = ["unavailable", "unknown"]; + if (option.includes(state)){ + return "rgba(var(--color-red),1)"; + } else if (state == 'home') { return "rgba(var(--color-blue),1)"; } else { return "rgba(var(--color-green),1)"; @@ -89,21 +75,24 @@ custom_card_imswel_person: custom_fields: notification: > [[[ - var zones = Object.values(states).filter((entity) => - entity.entity_id.startsWith("zone.") - ).map((entity) => entity.entity_id); + var zones = Object.values(states).filter((entity) => entity.entity_id.startsWith("zone.")).map((entity) => entity.entity_id); var person_location = states[variables.ulm_card_imswel_person_entity].state; - if (person_location !== 'home'){ - for (const item of zones){ - if (person_location == states[item]?.attributes?.friendly_name){ - var icon = (states[item].attributes.icon !== null) ? states[item].attributes.icon : 'mdi:help-circle'; - return ''; - } else if (person_location == 'not_home'){ - return ''; + let option = ["unavailable", "unknown"]; + if (option.includes(person_location)){ + return ''; + } else{ + if (person_location == "home"){ + return ''; + } else{ + for (const item of zones){ + if (person_location == states[item]?.attributes?.friendly_name){ + var icon = (states[item].attributes.icon !== null) ? states[item].attributes.icon : 'mdi:help-circle'; + return ''; + } else if (person_location == 'not_home'){ + return ''; + } } } - } else{ - return ''; } ]]] @@ -114,102 +103,153 @@ custom_popup_imswel_person: service: "browser_mod.popup" data: title: "[[[ return states[variables.ulm_card_imswel_person_entity].attributes.friendly_name ]]]" - style: - $: > - [[[ - if (hass.themes.theme.includes("desktop")){ - var dialog = ` - .mdc-dialog__surface{ - border-radius: var(--border-radius) !important; - } - `; - } else{ - var dialog = ""; - } - return ` - *{ - --secondary-background-color: none !important; - } - ${dialog} - `; - ]]] - hui-vertical-stack-card: - $: > - button-card { - align-self: center; - padding: 0.2em 0 2.3em 0; - } - hui-entities-card{ - padding: 0.8em 1.4em; - } - $hui-entities-card$: > - ha-card{ - box-shadow: none; - } - $hui-history-graph-card$: > - .content { - padding: 0 2.4em !important; - } - ha-card{ - box-shadow: none; - } - $hui-glance-card$: > - ha-card{ - box-shadow: none; + size: > + [[[ + const mediaQuery = window.matchMedia("(max-width: 800px)") + if (mediaQuery.matches) { + return "fullscreen"; + } + ]]] + style: > + --popup-padding-x: 0px; + --popup-padding-y: 0px; + card_mod: + style: + ha-dialog: > + .content .container{ + padding: 0 !important; } - $hui-map-card: - $: > - ha-icon-button { - color: rgba(var(--color-blue),1); - } - $ha-map: - $: > - .leaflet-control-attribution { - display: none; - } - .leaflet-touch .leaflet-control-layers, .leaflet-touch .leaflet-bar { - border: 2px solid rgba(var(--color-blue),0.4) !important; - } - .leaflet-bar a { - background-color: rgba(var(--color-blue),0.2) !important; - color: rgba(var(--color-blue),1) !important; - } - .leaflet-bar a:first-child { - border-bottom: 2px solid rgba(var(--color-blue),0.4) !important; - } - .leaflet-pane.leaflet-tile-pane { - filter: contrast(95%); - } content: type: "vertical-stack" cards: - type: "entities" + style: > + ha-card{ + box-shadow: none; + } entities: - entity: "[[[ return variables.ulm_card_imswel_person_entity; ]]]" secondary_info: "last-changed" - type: "history-graph" + style: > + ha-card{ + box-shadow: none; + } + hours_to_show: 8 entities: - entity: "[[[ return variables.ulm_card_imswel_person_entity; ]]]" - - type: "glance" - show_state: false - entities: - - entity: "[[[ return variables.ulm_card_imswel_person_wifi_tracker; ]]]" + name: "‎" + - type: "horizontal-stack" + cards: + - type: "custom:button-card" + template: "custom_card_imswel_person_glance_icon" + entity: "[[[ return variables.ulm_card_imswel_person_wifi_tracker; ]]]" name: "WiFi" icon: "mdi:wifi" - style: &state > - state-badge{ - color: {{ 'rgba(var(--color-blue),1)' if is_state(config.entity, 'home') }}; - filter: {{ 'opacity(100%)' if is_state(config.entity, 'home') else 'opacity(40%)'}}; - } - - entity: "[[[ return variables.ulm_card_imswel_person_gps_tracker; ]]]" + - type: "custom:button-card" + template: "custom_card_imswel_person_glance_icon" + entity: "[[[ return variables.ulm_card_imswel_person_gps_tracker; ]]]" name: "GPS" icon: "mdi:map-marker" - style: *state - type: "custom:button-card" - template: - - "find_my_phone_button" + template: "custom_card_imswel_person_findmy_button" entity: "[[[ return variables.ulm_card_imswel_person_findmy_script; ]]]" - type: "map" - aspect_ratio: "12x10" + style: + .: > + ha-card{ + box-shadow: none; + border-radius: 0px; + } + ha-map: + $: > + .leaflet-control-attribution { + display: none; + } + aspect_ratio: "90%" default_zoom: 16 entities: "[[[ return [variables.ulm_card_imswel_person_gps_tracker]; ]]]" + +custom_card_imswel_person_glance_icon: + variables: + color: "green" + state: "home" + tap_action: + action: "none" + triggers_update: "[[[ return entity.entity_id; ]]]" + show_label: false + show_state: false + size: "20px" + state: + - operator: "template" + value: "[[[ return entity.state == variables.state; ]]]" + styles: + icon: + - color: "[[[ return `rgba(var(--color-${variables.color}), 1)`; ]]]" + img_cell: + - background-color: "[[[ return `rgba(var(--color-${variables.color}), 0.2)`; ]]]" + styles: + icon: + - color: "rgba(var(--color-theme),0.2)" + name: + - margin-bottom: "12px" + - justify-self: "center" + - align-self: "start" + - font-weight: "regular" + - font-size: "14px" + img_cell: + - background-color: "rgba(var(--color-theme),0.05)" + - border-radius: "50%" + - place-self: "center" + - width: "42px" + - height: "42px" + grid: + - grid-template-areas: "'n' 'i'" + card: + - border-radius: "var(--border-radius)" + - box-shadow: "none" + +custom_card_imswel_person_findmy_button: + template: + - "ulm_custom_card_imswel_person_language_variables" + tap_action: + action: "toggle" + icon: "mdi:volume-high" + size: "1.4em" + name: "[[[ return variables.ulm_custom_card_imswel_person_findmy; ]]]" + styles: + icon: + - color: "rgba(var(--color-theme),0.4)" + name: + - font-size: "1.06em" + - letterspacing: "0.015em" + - color: "rgba(var(--color-theme),1)" + - filter: "opacity(60%)" + img_cell: + - margin-right: "4px" + grid: + - grid-template-areas: "'i n'" + - grid-column-gap: "0.3em" + card: + - border-radius: "var(--border-radius)" + - padding: "1em 1.4em" + - margin: "16px auto" + - width: "100%" + - font-size: "1.06em" + - box-shadow: "none" + - border: "1px solid rgba(var(--color-theme),0.4)" + extra_styles: > + :host{ + align-self: center !important; + } + ha-card:hover{ + background: rgba(var(--color-blue),0.2); + border: 1px solid rgba(var(--color-blue),0.1) !important; + } + ha-card:hover #name{ + color: rgba(var(--color-blue),1) !important; + filter: opacity(100%) !important; + } + ha-card:hover #icon{ + color: rgba(var(--color-blue),1) !important; + } diff --git a/custom_cards/custom_card_input_datetime/README.md b/custom_cards/custom_card_input_datetime/README.md index bd4d9a4fc..d6eb80449 100644 --- a/custom_cards/custom_card_input_datetime/README.md +++ b/custom_cards/custom_card_input_datetime/README.md @@ -27,7 +27,7 @@ Initial release - type: "custom:button-card" template: - card_input_datetime - entity: input_number.YOUR_INPUT_NUMBER_ENTITY + entity: input_datetime.YOUR_INPUT_DATETIME_ENTITY variables: ulm_card_input_datetime_name: "YOUR_NAME" ``` diff --git a/custom_cards/custom_card_input_datetime/card_input_datetime.yaml b/custom_cards/custom_card_input_datetime/card_input_datetime.yaml index dfee269de..9657ff71a 100644 --- a/custom_cards/custom_card_input_datetime/card_input_datetime.yaml +++ b/custom_cards/custom_card_input_datetime/card_input_datetime.yaml @@ -37,10 +37,11 @@ card_input_datetime: type: "custom:button-card" template: "widget_icon" tap_action: - action: "call-service" - service: "input_datetime.set_datetime" - service_data: + action: "perform-action" + perform_action: "input_datetime.set_datetime" + target: entity_id: "[[[ return entity.entity_id ]]]" + data: time: > [[[ var timestamp = entity.attributes.timestamp @@ -68,10 +69,11 @@ card_input_datetime: template: "widget_text" entity: "[[[ return entity.entity_id ]]]" tap_action: - action: "call-service" - service: "input_datetime.set_datetime" - service_data: + action: "perform-action" + perform_action: "input_datetime.set_datetime" + target: entity_id: "[[[ return entity.entity_id ]]]" + data: time: > [[[ var timestamp = entity.attributes.timestamp @@ -93,10 +95,11 @@ card_input_datetime: return formattedTime; ]]] hold_action: - action: "call-service" - service: "input_datetime.set_datetime" - service_data: + action: "perform-action" + perform_action: "input_datetime.set_datetime" + target: entity_id: "[[[ return entity.entity_id ]]]" + data: time: > [[[ var timestamp = entity.attributes.timestamp @@ -123,10 +126,11 @@ card_input_datetime: type: "custom:button-card" template: "widget_icon" tap_action: - action: "call-service" - service: "input_datetime.set_datetime" - service_data: + action: "perform-action" + perform_action: "input_datetime.set_datetime" + target: entity_id: "[[[ return entity.entity_id ]]]" + data: time: > [[[ var timestamp = entity.attributes.timestamp @@ -155,7 +159,7 @@ widget_text: show_icon: false show_label: true show_name: false - label: "[[[ return variables.ulm_translation_state_unit ]]]" + label: "[[[ return variables.ulm_translation_state ]]]" styles: grid: - grid-template-areas: "'l'" diff --git a/custom_cards/custom_card_input_number/card_input_number.yaml b/custom_cards/custom_card_input_number/card_input_number.yaml index f09ee0a07..2a33e0a7c 100644 --- a/custom_cards/custom_card_input_number/card_input_number.yaml +++ b/custom_cards/custom_card_input_number/card_input_number.yaml @@ -38,16 +38,18 @@ card_input_number: type: "custom:button-card" template: "widget_icon" tap_action: - action: "call-service" - service: | - [[[ - if( entity.entity_id.startsWith("input_number.") ) - return "input_number.decrement"; - if( entity.entity_id.startsWith("counter.") ) - return "counter.decrement"; - return ""; - ]]] - service_data: + action: "perform-action" + perform_action: | + [[[ + if( entity.entity_id.startsWith("input_number.") ) + return "input_number.decrement"; + else if( entity.entity_id.startsWith("counter.") ) + return "counter.decrement"; + else if( entity.entity_id.startsWith("select.") ) + return "select.select_previous"; + return ""; + ]]] + target: entity_id: "[[[ return entity.entity_id ]]]" icon: "mdi:arrow-down" item2: @@ -56,25 +58,27 @@ card_input_number: template: "widget_text" entity: "[[[ return entity.entity_id ]]]" tap_action: - action: "call-service" - service: "cover.stop_cover" - service_data: + action: "perform-action" + perform_action: "cover.stop_cover" + target: entity_id: "[[[ return entity.entity_id ]]]" item3: card: type: "custom:button-card" template: "widget_icon" tap_action: - action: "call-service" - service: | - [[[ - if( entity.entity_id.startsWith("input_number.") ) - return "input_number.increment"; - if( entity.entity_id.startsWith("counter.") ) - return "counter.increment"; - return ""; - ]]] - service_data: + action: "perform-action" + perform_action: | + [[[ + if( entity.entity_id.startsWith("input_number.") ) + return "input_number.increment"; + else if( entity.entity_id.startsWith("counter.") ) + return "counter.increment"; + else if( entity.entity_id.startsWith("select.") ) + return "select.select_next"; + return ""; + ]]] + target: entity_id: "[[[ return entity.entity_id ]]]" icon: "mdi:arrow-up" @@ -91,7 +95,7 @@ widget_text: show_icon: false show_label: true show_name: false - label: "[[[ return variables.ulm_translation_state_unit ]]]" + label: "[[[ return variables.ulm_translation_state ]]]" styles: grid: - grid-template-areas: "'l'" diff --git a/custom_cards/custom_card_irmajavi_entities/custom_card_irmajavi_entities.yaml b/custom_cards/custom_card_irmajavi_entities/custom_card_irmajavi_entities.yaml index 8e68bb55f..40cbb5027 100644 --- a/custom_cards/custom_card_irmajavi_entities/custom_card_irmajavi_entities.yaml +++ b/custom_cards/custom_card_irmajavi_entities/custom_card_irmajavi_entities.yaml @@ -107,7 +107,7 @@ custom_card_irmajavi_entities: custom_widget_irmajavi: show_label: true show_icon: false - label: "[[[ return variables.ulm_translation_state_unit ]]]" + label: "[[[ return variables.ulm_translation_state ]]]" styles: name: - justify-self: "center" diff --git a/custom_cards/custom_card_irmajavi_speedtest/custom_card_irmajavi_speedtest.yaml b/custom_cards/custom_card_irmajavi_speedtest/custom_card_irmajavi_speedtest.yaml index d4a204be1..0c126cd39 100644 --- a/custom_cards/custom_card_irmajavi_speedtest/custom_card_irmajavi_speedtest.yaml +++ b/custom_cards/custom_card_irmajavi_speedtest/custom_card_irmajavi_speedtest.yaml @@ -30,11 +30,9 @@ custom_card_irmajavi_speedtest: show_name: true show_icon: true label: >- - [[[ return variables.ulm_custom_card_irmajavi_speedtest_router_model - ]]] + [[[ return variables.ulm_custom_card_irmajavi_speedtest_router_model ]]] name: >- - [[[ return variables.ulm_custom_card_irmajavi_speedtest_router_name - ]]] + [[[ return variables.ulm_custom_card_irmajavi_speedtest_router_name ]]] icon: "mdi:wifi" styles: icon: @@ -72,9 +70,9 @@ custom_card_irmajavi_speedtest: card: type: "custom:button-card" tap_action: - action: "call-service" - service: "homeassistant.update_entity" - service_data: + action: "perform-action" + perform_action: "homeassistant.update_entity" + target: entity_id: - "[[[ return variables.ulm_custom_card_irmajavi_speedtest_download_speed_entity]]]" - "[[[ return variables.ulm_custom_card_irmajavi_speedtest_upload_speed_entity]]]" @@ -146,15 +144,13 @@ custom_card_irmajavi_speedtest: item1: card: type: "custom:button-card" - tap_action: - action: "more-info" color: "var(--google-blue)" show_label: true show_icon: false name: "[[[ return variables.ulm_custom_card_irmajavi_speedtest_download ]]]" entity: >- [[[ return - variables.ulm_custom_card_irmajavi_speedtest_download_speed_entity; + variables.ulm_custom_card_irmajavi_speedtest_download_speed_entity; ]]] label: | [[[ @@ -209,10 +205,10 @@ custom_card_irmajavi_speedtest: [[[ var state1 = ""; if (states[variables.ulm_custom_card_irmajavi_speedtest_upload_speed_entity].state){ - var state1 = states[variables.ulm_custom_card_irmajavi_speedtest_upload_speed_entity].state; - if (states[variables.ulm_custom_card_irmajavi_speedtest_upload_speed_entity].attributes.unit_of_measurement){ - state1 += states[variables.ulm_custom_card_irmajavi_speedtest_upload_speed_entity].attributes.unit_of_measurement; - } + var state1 = states[variables.ulm_custom_card_irmajavi_speedtest_upload_speed_entity].state; + if (states[variables.ulm_custom_card_irmajavi_speedtest_upload_speed_entity].attributes.unit_of_measurement){ + state1 += states[variables.ulm_custom_card_irmajavi_speedtest_upload_speed_entity].attributes.unit_of_measurement; + } } return state1; ]]] diff --git a/custom_cards/custom_card_media_player_sonos/custom_card_media_player_sonos.yaml b/custom_cards/custom_card_media_player_sonos/custom_card_media_player_sonos.yaml index 9bfc4c1cc..3213ca9f0 100644 --- a/custom_cards/custom_card_media_player_sonos/custom_card_media_player_sonos.yaml +++ b/custom_cards/custom_card_media_player_sonos/custom_card_media_player_sonos.yaml @@ -58,9 +58,9 @@ card_media_player_sonos_with_controls: type: "custom:button-card" template: "widget_icon" tap_action: - action: "call-service" - service: "media_player.volume_down" - service_data: + action: "perform-action" + perform_action: "media_player.volume_down" + target: entity_id: "[[[ return variables.ulm_card_media_player_with_controls_entity ]]]" icon: "mdi:volume-minus" item2: @@ -69,9 +69,9 @@ card_media_player_sonos_with_controls: template: "widget_icon" entity: "[[[ return variables.ulm_card_media_player_with_controls_entity ]]]" tap_action: - action: "call-service" - service: "media_player.media_play_pause" - service_data: + action: "perform-action" + perform_action: "media_player.media_play_pause" + target: entity_id: "[[[ return variables.ulm_card_media_player_with_controls_entity ]]]" icon: "mdi:pause" state: @@ -84,9 +84,9 @@ card_media_player_sonos_with_controls: type: "custom:button-card" template: "widget_icon" tap_action: - action: "call-service" - service: "media_player.volume_up" - service_data: + action: "perform-action" + perform_action: "media_player.volume_up" + target: entity_id: "[[[ return variables.ulm_card_media_player_with_controls_entity ]]]" icon: "mdi:volume-plus" diff --git a/custom_cards/custom_card_mpse_printer/custom_card_mpse_printer.yaml b/custom_cards/custom_card_mpse_printer/custom_card_mpse_printer.yaml index 3cf1542f1..56fad13d0 100644 --- a/custom_cards/custom_card_mpse_printer/custom_card_mpse_printer.yaml +++ b/custom_cards/custom_card_mpse_printer/custom_card_mpse_printer.yaml @@ -41,36 +41,37 @@ custom_card_mpse_printer: color: "black" entities: - entity: "[[[ return variables.ulm_card_printer_black_name ]]]" - style: | - bar-card-currentbar{ - border: 0.01rem solid rgba(var(--color-theme),.4); - } - bar-card-backgroundbar{ - display: none; - } - bar-card-name{ - width: 2rem; - margin-right: 40px !important; - } - bar-card-value{ - width: 2rem; - margin-left: 40px !important; - justify-content: center; - display: flex; - color: grey; - } - bar-card-background{ - margin: 4px 0 4px 0 !important; - text-align: initial; - } - ha-card{ - --bar-card-border-radius: 5px; - border-radius: 0px; - box-shadow: none; - } - #states{ - padding: 0 16px; - } + card_mod: + style: | + bar-card-currentbar{ + border: 0.01rem solid rgba(var(--color-theme),.4); + } + bar-card-backgroundbar{ + display: none; + } + bar-card-name{ + width: 2rem; + margin-right: 40px !important; + } + bar-card-value{ + width: 2rem; + margin-left: 40px !important; + justify-content: center; + display: flex; + color: grey; + } + bar-card-background{ + margin: 4px 0 4px 0 !important; + text-align: initial; + } + ha-card{ + --bar-card-border-radius: 5px; + border-radius: 0px; + box-shadow: none; + } + #states{ + padding: 0 16px; + } item3: card: type: "custom:bar-card" @@ -84,36 +85,37 @@ custom_card_mpse_printer: color: "rgb(250,255,0)" entities: - entity: "[[[ return variables.ulm_card_printer_yellow_name ]]]" - style: | - bar-card-currentbar{ - border: 0.01rem solid rgba(var(--color-theme),.4); - } - bar-card-backgroundbar{ - display: none; - } - bar-card-name{ - width: 2rem; - margin-right: 40px !important; - } - bar-card-value{ - width: 2rem; - margin-left: 40px !important; - justify-content: center; - display: flex; - color: grey; - } - bar-card-background{ - margin: 4px 0 4px 0 !important; - text-align: initial; - } - ha-card{ - --bar-card-border-radius: 5px; - border-radius: 0px; - box-shadow: none; - } - #states{ - padding: 0 16px; - } + card_mod: + style: | + bar-card-currentbar{ + border: 0.01rem solid rgba(var(--color-theme),.4); + } + bar-card-backgroundbar{ + display: none; + } + bar-card-name{ + width: 2rem; + margin-right: 40px !important; + } + bar-card-value{ + width: 2rem; + margin-left: 40px !important; + justify-content: center; + display: flex; + color: grey; + } + bar-card-background{ + margin: 4px 0 4px 0 !important; + text-align: initial; + } + ha-card{ + --bar-card-border-radius: 5px; + border-radius: 0px; + box-shadow: none; + } + #states{ + padding: 0 16px; + } item4: card: type: "custom:bar-card" @@ -127,36 +129,37 @@ custom_card_mpse_printer: color: "rgb(248,0,255)" entities: - entity: "[[[ return variables.ulm_card_printer_magenta_name ]]]" - style: | - bar-card-currentbar{ - border: 0.01rem solid rgba(var(--color-theme),.4); - } - bar-card-backgroundbar{ - display: none; - } - bar-card-name{ - width: 2rem; - margin-right: 40px !important; - } - bar-card-value{ - width: 2rem; - margin-left: 40px !important; - justify-content: center; - display: flex; - color: grey; - } - bar-card-background{ - margin: 4px 0 4px 0 !important; - text-align: initial; - } - ha-card{ - --bar-card-border-radius: 5px; - border-radius: 0px; - box-shadow: none; - } - #states{ - padding: 0 16px; - } + card_mod: + style: | + bar-card-currentbar{ + border: 0.01rem solid rgba(var(--color-theme),.4); + } + bar-card-backgroundbar{ + display: none; + } + bar-card-name{ + width: 2rem; + margin-right: 40px !important; + } + bar-card-value{ + width: 2rem; + margin-left: 40px !important; + justify-content: center; + display: flex; + color: grey; + } + bar-card-background{ + margin: 4px 0 4px 0 !important; + text-align: initial; + } + ha-card{ + --bar-card-border-radius: 5px; + border-radius: 0px; + box-shadow: none; + } + #states{ + padding: 0 16px; + } item5: card: type: "custom:bar-card" @@ -170,36 +173,37 @@ custom_card_mpse_printer: color: "rgb(0,255,255)" entities: - entity: "[[[ return variables.ulm_card_printer_cyan_name ]]]" - style: | - bar-card-currentbar{ - border: 0.01rem solid rgba(var(--color-theme),.4); - } - bar-card-backgroundbar{ - display: none; - } - bar-card-name{ - width: 2rem; - margin-right: 40px !important; - } - bar-card-value{ - width: 2rem; - margin-left: 40px !important; - justify-content: center; - display: flex; - color: grey; - } - bar-card-background{ - margin: 4px 0 4px 0 !important; - text-align: initial; - } - ha-card{ - --bar-card-border-radius: 5px; - border-radius: 0px; - box-shadow: none; - } - #states{ - padding: 0 16px 16px 16px; - } + card_mod: + style: | + bar-card-currentbar{ + border: 0.01rem solid rgba(var(--color-theme),.4); + } + bar-card-backgroundbar{ + display: none; + } + bar-card-name{ + width: 2rem; + margin-right: 40px !important; + } + bar-card-value{ + width: 2rem; + margin-left: 40px !important; + justify-content: center; + display: flex; + color: grey; + } + bar-card-background{ + margin: 4px 0 4px 0 !important; + text-align: initial; + } + ha-card{ + --bar-card-border-radius: 5px; + border-radius: 0px; + box-shadow: none; + } + #states{ + padding: 0 16px 16px 16px; + } custom_card_mpse_printer_blue: state: - styles: diff --git a/custom_cards/custom_card_mpse_thermostat/custom_card_mpse_thermostat.yaml b/custom_cards/custom_card_mpse_thermostat/custom_card_mpse_thermostat.yaml index c8870299a..ab63cb2fd 100644 --- a/custom_cards/custom_card_mpse_thermostat/custom_card_mpse_thermostat.yaml +++ b/custom_cards/custom_card_mpse_thermostat/custom_card_mpse_thermostat.yaml @@ -85,10 +85,11 @@ custom_card_mpse_thermostat: template: "widget_icon" icon: "mdi:arrow-down" tap_action: - action: "call-service" - service: "climate.set_temperature" - service_data: + action: "perform-action" + perform_action: "climate.set_temperature" + target: entity_id: "[[[ return entity.entity_id ]]]" + data: temperature: "[[[ return entity.attributes.temperature - entity.attributes.target_temp_step ]]]" item2: card: @@ -106,8 +107,9 @@ custom_card_mpse_thermostat: template: "widget_icon" icon: "mdi:arrow-up" tap_action: - action: "call-service" - service: "climate.set_temperature" - service_data: + action: "perform-action" + perform_action: "climate.set_temperature" + target: entity_id: "[[[ return entity.entity_id ]]]" + data: temperature: "[[[ return entity.attributes.temperature + entity.attributes.target_temp_step ]]]" diff --git a/custom_cards/custom_card_neekster_update/custom_card_neekster_update.yaml b/custom_cards/custom_card_neekster_update/custom_card_neekster_update.yaml index 792e5101b..749e83ff9 100644 --- a/custom_cards/custom_card_neekster_update/custom_card_neekster_update.yaml +++ b/custom_cards/custom_card_neekster_update/custom_card_neekster_update.yaml @@ -131,9 +131,9 @@ card_neekster_update: hold_action: action: "more-info" tap_action: - action: "call-service" - service: "update.install" - service_data: + action: "perform-action" + perform_action: "update.install" + target: entity_id: "[[[ return entity.entity_id ]]]" icon: "mdi:package-down" item2: @@ -142,13 +142,13 @@ card_neekster_update: template: "widget_icon" entity: "[[[ return entity.entity_id ]]]" hold_action: - action: "call-service" - service: "update.clear_skipped" - service_data: + action: "cperform-action" + perform_action: "update.clear_skipped" + target: entity_id: "[[[ return entity.entity_id ]]]" tap_action: - action: "call-service" - service: "update.skip" - service_data: + action: "perform-action" + perform_action: "update.skip" + target: entity_id: "[[[ return entity.entity_id ]]]" icon: "mdi:cancel" diff --git a/custom_cards/custom_card_nik_clock/custom_card_nik_clock.yaml b/custom_cards/custom_card_nik_clock/custom_card_nik_clock.yaml index bb7860f0f..e85f8476f 100644 --- a/custom_cards/custom_card_nik_clock/custom_card_nik_clock.yaml +++ b/custom_cards/custom_card_nik_clock/custom_card_nik_clock.yaml @@ -32,14 +32,14 @@ custom_card_nik_clock: action: > [[[ if (variables.ulm_custom_card_nik_clock_switch_enable){ - return 'call-service' + return 'perform-action' } else{ return 'none' } ]]] - service: "input_boolean.toggle" - service_data: + perform_action: "input_boolean.toggle" + target: entity_id: "[[[ return variables.ulm_custom_card_nik_clock_switch ]]]" styles: card: diff --git a/custom_cards/custom_card_nik_door/custom_card_nik_door.yaml b/custom_cards/custom_card_nik_door/custom_card_nik_door.yaml index 58a53a644..b533f2dc1 100644 --- a/custom_cards/custom_card_nik_door/custom_card_nik_door.yaml +++ b/custom_cards/custom_card_nik_door/custom_card_nik_door.yaml @@ -112,9 +112,9 @@ custom_card_nik_door: icon: "mdi:lock-open-variant" entity: "[[[ return entity.entity_id ]]]" tap_action: - action: "call-service" - service: "lock.open" - service_data: + action: "perform-action" + perform_action: "lock.open" + target: entity_id: "[[[ return variables.ulm_custom_card_entity_1_lock ]]]" state: - value: "Open" @@ -136,9 +136,9 @@ custom_card_nik_door: icon: "mdi:lock" entity: "[[[ return entity.entity_id ]]]" tap_action: - action: "call-service" - service: "lock.lock" - service_data: + action: "perform-action" + perform_action: "lock.lock" + target: entity_id: "[[[ return variables.ulm_custom_card_entity_1_lock ]]]" state: - value: "Closed & Locked" diff --git a/custom_cards/custom_card_nik_tablet/custom_card_nik_tablet.yaml b/custom_cards/custom_card_nik_tablet/custom_card_nik_tablet.yaml index aa8398ca8..07168fbbe 100644 --- a/custom_cards/custom_card_nik_tablet/custom_card_nik_tablet.yaml +++ b/custom_cards/custom_card_nik_tablet/custom_card_nik_tablet.yaml @@ -100,9 +100,9 @@ custom_card_nik_tablet: entity: "[[[ return variables.ulm_custom_card_nik_tablet_restart ]]]" icon: "mdi:restart-alert" tap_action: - action: "call-service" - service: "button.press" - service_data: + action: "perform-action" + perform_action: "button.press" + target: entity_id: "[[[ return variables.ulm_custom_card_nik_tablet_restart ]]]" item2: card: @@ -121,9 +121,9 @@ custom_card_nik_tablet: entity: "[[[ return variables.ulm_custom_card_nik_tablet_reload ]]]" icon: "mdi:reload" tap_action: - action: "call-service" - service: "button.press" - service_data: + action: "perform-action" + perform_action: "button.press" + target: entity_id: "[[[ return variables.ulm_custom_card_nik_tablet_reload ]]]" item4: card: diff --git a/custom_cards/custom_card_paddy_dwd_pollen/custom_card_paddy_dwd_pollen.yaml b/custom_cards/custom_card_paddy_dwd_pollen/custom_card_paddy_dwd_pollen.yaml index 1fee063b8..86cf79ab5 100644 --- a/custom_cards/custom_card_paddy_dwd_pollen/custom_card_paddy_dwd_pollen.yaml +++ b/custom_cards/custom_card_paddy_dwd_pollen/custom_card_paddy_dwd_pollen.yaml @@ -2,7 +2,7 @@ custom_card_paddy_dwd_pollen: template: - "card_generic_swap" - - "custom_card_paddy_dwd_pollen_language_variables" + - "ulm_custom_card_paddy_dwd_pollen_language_variables" variables: ulm_card_generic_swap_name: "[[[ return variables.ulm_custom_card_paddy_dwd_pollen_name; ]]]" ulm_card_generic_swap_icon: "[[[ return variables.ulm_custom_card_paddy_dwd_pollen_icon; ]]]" @@ -17,27 +17,6 @@ custom_card_paddy_dwd_pollen: card: type: "custom:button-card" entity: "[[[ return entity.entity_id ]]]" - item2: - card: - type: "custom:button-card" - entity: "[[[ return entity.entity_id ]]]" - label: > - [[[ - if (entity.state == "6"){ - return variables.custom_card_paddy_dwd_pollen_6; - } else if (entity.state == "5"){ - return variables.custom_card_paddy_dwd_pollen_5; - } else if (entity.state == "4"){ - return variables.custom_card_paddy_dwd_pollen_4; - } else if (entity.state == "3"){ - return variables.custom_card_paddy_dwd_pollen_3; - } else if (entity.state == "2"){ - return variables.custom_card_paddy_dwd_pollen_2; - } else if (entity.state == "1"){ - return variables.custom_card_paddy_dwd_pollen_1; - } - return variables.custom_card_paddy_dwd_pollen_none; - ]]] state: - value: "6" styles: @@ -67,3 +46,24 @@ custom_card_paddy_dwd_pollen: styles: icon: - color: "rgba(var(--color-theme),0.2)" + item2: + card: + type: "custom:button-card" + entity: "[[[ return entity.entity_id ]]]" + label: > + [[[ + if (entity.state == "6"){ + return variables.ulm_custom_card_paddy_dwd_pollen_6; + } else if (entity.state == "5"){ + return variables.ulm_custom_card_paddy_dwd_pollen_5; + } else if (entity.state == "4"){ + return variables.ulm_custom_card_paddy_dwd_pollen_4; + } else if (entity.state == "3"){ + return variables.ulm_custom_card_paddy_dwd_pollen_3; + } else if (entity.state == "2"){ + return variables.ulm_custom_card_paddy_dwd_pollen_2; + } else if (entity.state == "1"){ + return variables.ulm_custom_card_paddy_dwd_pollen_1; + } + return variables.ulm_custom_card_paddy_dwd_pollen_none; + ]]] diff --git a/custom_cards/custom_card_paddy_dwd_pollen/languages/de.yaml b/custom_cards/custom_card_paddy_dwd_pollen/languages/de.yaml index be9723597..06b5d8a1f 100644 --- a/custom_cards/custom_card_paddy_dwd_pollen/languages/de.yaml +++ b/custom_cards/custom_card_paddy_dwd_pollen/languages/de.yaml @@ -1,10 +1,10 @@ --- -custom_card_paddy_dwd_pollen_language_variables: +ulm_custom_card_paddy_dwd_pollen_language_variables: variables: - custom_card_paddy_dwd_pollen_6: "hoch" - custom_card_paddy_dwd_pollen_5: "mittel bis hoch" - custom_card_paddy_dwd_pollen_4: "mittel" - custom_card_paddy_dwd_pollen_3: "gering bis mittel" - custom_card_paddy_dwd_pollen_2: "gering" - custom_card_paddy_dwd_pollen_1: "keine bis gering" - custom_card_paddy_dwd_pollen_none: "keine" + ulm_custom_card_paddy_dwd_pollen_6: "hoch" + ulm_custom_card_paddy_dwd_pollen_5: "mittel bis hoch" + ulm_custom_card_paddy_dwd_pollen_4: "mittel" + ulm_custom_card_paddy_dwd_pollen_3: "gering bis mittel" + ulm_custom_card_paddy_dwd_pollen_2: "gering" + ulm_custom_card_paddy_dwd_pollen_1: "keine bis gering" + ulm_custom_card_paddy_dwd_pollen_none: "keine" diff --git a/custom_cards/custom_card_paddy_dwd_pollen/languages/en.yaml b/custom_cards/custom_card_paddy_dwd_pollen/languages/en.yaml index 2e1ab807f..ae15ef735 100644 --- a/custom_cards/custom_card_paddy_dwd_pollen/languages/en.yaml +++ b/custom_cards/custom_card_paddy_dwd_pollen/languages/en.yaml @@ -1,10 +1,10 @@ --- -custom_card_paddy_dwd_pollen_language_variables: +ulm_custom_card_paddy_dwd_pollen_language_variables: variables: - custom_card_paddy_dwd_pollen_6: "high" - custom_card_paddy_dwd_pollen_5: "medium to high" - custom_card_paddy_dwd_pollen_4: "medium" - custom_card_paddy_dwd_pollen_3: "low to mediuml" - custom_card_paddy_dwd_pollen_2: "low" - custom_card_paddy_dwd_pollen_1: "none to low" - custom_card_paddy_dwd_pollen_none: "none" + ulm_custom_card_paddy_dwd_pollen_6: "high" + ulm_custom_card_paddy_dwd_pollen_5: "medium to high" + ulm_custom_card_paddy_dwd_pollen_4: "medium" + ulm_custom_card_paddy_dwd_pollen_3: "low to mediuml" + ulm_custom_card_paddy_dwd_pollen_2: "low" + ulm_custom_card_paddy_dwd_pollen_1: "none to low" + ulm_custom_card_paddy_dwd_pollen_none: "none" diff --git a/custom_cards/custom_card_paddy_dwd_pollen/languages/es.yaml b/custom_cards/custom_card_paddy_dwd_pollen/languages/es.yaml index 274ee9bd4..789edbaca 100644 --- a/custom_cards/custom_card_paddy_dwd_pollen/languages/es.yaml +++ b/custom_cards/custom_card_paddy_dwd_pollen/languages/es.yaml @@ -1,10 +1,10 @@ --- -custom_card_paddy_dwd_pollen_language_variables: +ulm_custom_card_paddy_dwd_pollen_language_variables: variables: - custom_card_paddy_dwd_pollen_6: "alto" - custom_card_paddy_dwd_pollen_5: "medio a alto" - custom_card_paddy_dwd_pollen_4: "medio" - custom_card_paddy_dwd_pollen_3: "bajo a medio" - custom_card_paddy_dwd_pollen_2: "bajo" - custom_card_paddy_dwd_pollen_1: "ninguno a bajo" - custom_card_paddy_dwd_pollen_none: "ninguno" + ulm_custom_card_paddy_dwd_pollen_6: "alto" + ulm_custom_card_paddy_dwd_pollen_5: "medio a alto" + ulm_custom_card_paddy_dwd_pollen_4: "medio" + ulm_custom_card_paddy_dwd_pollen_3: "bajo a medio" + ulm_custom_card_paddy_dwd_pollen_2: "bajo" + ulm_custom_card_paddy_dwd_pollen_1: "ninguno a bajo" + ulm_custom_card_paddy_dwd_pollen_none: "ninguno" diff --git a/custom_cards/custom_card_paddy_dwd_pollen/languages/pl.yaml b/custom_cards/custom_card_paddy_dwd_pollen/languages/pl.yaml index a3f4092fb..4bf91dd47 100644 --- a/custom_cards/custom_card_paddy_dwd_pollen/languages/pl.yaml +++ b/custom_cards/custom_card_paddy_dwd_pollen/languages/pl.yaml @@ -1,10 +1,10 @@ --- -custom_card_paddy_dwd_pollen_language_variables: +ulm_custom_card_paddy_dwd_pollen_language_variables: variables: - custom_card_paddy_dwd_pollen_6: "bardzo wysokie" - custom_card_paddy_dwd_pollen_5: "wysokie" - custom_card_paddy_dwd_pollen_4: "średnie" - custom_card_paddy_dwd_pollen_3: "umiarkowane" - custom_card_paddy_dwd_pollen_2: "słabe" - custom_card_paddy_dwd_pollen_1: "bardzo słabe" - custom_card_paddy_dwd_pollen_none: "brak" + ulm_custom_card_paddy_dwd_pollen_6: "bardzo wysokie" + ulm_custom_card_paddy_dwd_pollen_5: "wysokie" + ulm_custom_card_paddy_dwd_pollen_4: "średnie" + ulm_custom_card_paddy_dwd_pollen_3: "umiarkowane" + ulm_custom_card_paddy_dwd_pollen_2: "słabe" + ulm_custom_card_paddy_dwd_pollen_1: "bardzo słabe" + ulm_custom_card_paddy_dwd_pollen_none: "brak" diff --git a/custom_cards/custom_card_paddy_waste_collection/README.md b/custom_cards/custom_card_paddy_waste_collection/README.md index a5bae83a2..37b411e4e 100644 --- a/custom_cards/custom_card_paddy_waste_collection/README.md +++ b/custom_cards/custom_card_paddy_waste_collection/README.md @@ -25,6 +25,10 @@ Initial release 1.0.1 Fix for UI Minimalist v1.0.1.
+
+1.0.2 +Fixed the bug where card doesn't show at all +
## Usage @@ -67,12 +71,12 @@ This card needs the following to function correctly: yes Your waste collection sensor. See HA example on how to configure. -ulm_custom_card_paddy_waste_collection_name +ulm_card_generic_swap_name Paper no -ulm_custom_card_paddy_waste_collection_icon +ulm_card_generic_swap_icon mdi:trash-can no diff --git a/custom_cards/custom_card_paddy_waste_collection/custom_card_paddy_waste_collection.yaml b/custom_cards/custom_card_paddy_waste_collection/custom_card_paddy_waste_collection.yaml index 93209fa1a..e7ef7becd 100644 --- a/custom_cards/custom_card_paddy_waste_collection/custom_card_paddy_waste_collection.yaml +++ b/custom_cards/custom_card_paddy_waste_collection/custom_card_paddy_waste_collection.yaml @@ -3,8 +3,8 @@ custom_card_paddy_waste_collection: template: - "card_generic_swap" variables: - ulm_card_generic_swap_name: "[[[ return variables.ulm_custom_card_paddy_waste_collection_name; ]]]" - ulm_card_generic_swap_icon: "[[[ return variables.ulm_custom_card_paddy_waste_collection_icon; ]]]" + ulm_card_generic_swap_name: "[[[ return entity.name; ]]]" + ulm_card_generic_swap_icon: "[[[ return entity.icon; ]]]" state: - operator: "template" value: "[[[ return states[entity.entity_id].attributes.daysTo == 0; ]]]" @@ -20,6 +20,7 @@ custom_card_paddy_waste_collection: - border: "2px solid var(--card-background-color)" - font-size: "12px" - line-height: "14px" + - z-index: "1" - background-color: > [[[ return "rgba(var(--color-red),1)"; @@ -38,6 +39,7 @@ custom_card_paddy_waste_collection: - border: "2px solid var(--card-background-color)" - font-size: "12px" - line-height: "14px" + - z-index: "1" - background-color: > [[[ return "rgba(var(--color-red),1)"; @@ -55,6 +57,7 @@ custom_card_paddy_waste_collection: - border: "2px solid var(--card-background-color)" - font-size: "12px" - line-height: "14px" + - z-index: "1" - background-color: > [[[ return "rgba(var(--color-red),1)"; diff --git a/custom_cards/custom_card_person_chip/custom_card_person_chip.yaml b/custom_cards/custom_card_person_chip/custom_card_person_chip.yaml index 34749170a..ea32ac12a 100644 --- a/custom_cards/custom_card_person_chip/custom_card_person_chip.yaml +++ b/custom_cards/custom_card_person_chip/custom_card_person_chip.yaml @@ -13,7 +13,7 @@ custom_card_person_chip: label: > [[[ let state = states[variables.ulm_custom_card_person_chip_entity].state; - return hass.resources[hass["language"]]["component.person" + ".state._." + state] || state; + return hass.resources[hass["language"]]["component.person.entity_component._.state." + state] || state; ]]] show_entity_picture: true entity_picture: "[[[ return states[variables.ulm_custom_card_person_chip_entity].attributes.entity_picture ]]]" diff --git a/custom_cards/custom_card_person_info/custom_card_person_info.yaml b/custom_cards/custom_card_person_info/custom_card_person_info.yaml index acb796c03..7326cc567 100644 --- a/custom_cards/custom_card_person_info/custom_card_person_info.yaml +++ b/custom_cards/custom_card_person_info/custom_card_person_info.yaml @@ -33,7 +33,7 @@ card_person_info: return `Driving - ${variables.ulm_translation_state}`; } else { let state = states[variables.ulm_card_person_entity].state; - return hass.resources[hass["language"]]["component.person" + ".state._." + state] ? hass.resources[hass["language"]]["component.person" + ".state._." + state] : state; + return hass.resources[hass["language"]]["component.person.entity_component._.state." + state] ? hass.resources[hass["language"]]["component.person.entity_component._.state." + state] : state; } ]]] name: "[[[ return states[variables.ulm_card_person_entity].attributes.friendly_name ]]]" diff --git a/custom_cards/custom_card_saxel_fan/README.md b/custom_cards/custom_card_saxel_fan/README.md index ee00eb69f..1c0f2b70f 100644 --- a/custom_cards/custom_card_saxel_fan/README.md +++ b/custom_cards/custom_card_saxel_fan/README.md @@ -108,6 +108,30 @@ This card needs the following to function correctly: no true/false if the fan speed row should collapse when the fan is turned off. Default: true + + ulm_card_fan_horizontal + true + no + Single Line Horizontal Control. Collapsible MUST be false for this currently. Default: false + + + ulm_show_button + false + no + Set to false to remove the Button and have a full width Slider. Default: true + + + ulm_button_icon + mdi:button + no + Set the icon for the Button. Default: mdi:rotate-3d-variant + + + ulm_button_service + fan.toggle + no + Name of the Service Call on button press. Default: fan.oscillate + oscillate_attribute oscillate diff --git a/custom_cards/custom_card_saxel_fan/custom_card_saxel_fan.yaml b/custom_cards/custom_card_saxel_fan/custom_card_saxel_fan.yaml index 929626fc0..14b60ab0f 100644 --- a/custom_cards/custom_card_saxel_fan/custom_card_saxel_fan.yaml +++ b/custom_cards/custom_card_saxel_fan/custom_card_saxel_fan.yaml @@ -1,4 +1,5 @@ --- +### Card Fan ### custom_card_saxel_fan: template: - "custom_card_saxel_fan_common" @@ -56,29 +57,90 @@ custom_card_saxel_fan_blue: # Common template, don't use custom_card_saxel_fan_common: + template: + - "ulm_translation_engine" + - "ulm_language_variables" + - "icon_info_bg" variables: - collapsable: true mainSliderColor: secondarySliderColor: + ulm_card_fan_horizontal: false + collapsable: true + ulm_card_fan_temp_attribute: "temp" + ulm_card_fan_hum_attribute: "hum" + always_show_attributes: false + ulm_show_button: true + ulm_button_icon: "mdi:rotate-3d-variant" + ulm_button_service: "fan.oscillate" oscillate_attribute: "oscillate" - template: - - "ulm_translation_engine" - - "icon_info_bg" hold_action: action: "more-info" label: |- [[[ - if (entity.state === 'on') { - return `${entity.attributes.percentage}%`; + if (entity.state != 'unavailable') { + let temp_str = ''; + if (variables.ulm_card_fan_temp_attribute) { + var temp = Math.round(entity.attributes[variables.ulm_card_fan_temp_attribute]); + temp_str = ' • ' + (temp ? temp : '0') + '°C'; + } + let hum_str = ''; + if (variables.ulm_card_fan_hum_attribute) { + var hum = Math.round(entity.attributes[variables.ulm_card_fan_hum_attribute]); + hum_str = ' • ' + (hum ? hum : '0') + '%'; + } + + if (entity.state == 'off') { + if (variables.always_show_attributes == true) { + return variables.ulm_off + temp_str + hum_str + } else { + return variables.ulm_off + } + } else if (entity.state == 'on') { + if (entity.attributes.percentage != null) { + var per = entity.attributes.percentage; + let per_str = (per ? per : '0') + '%'; + return per_str + temp_str + hum_str; + } else { + return variables.ulm_on + } + } } else { - return variables.ulm_translation_state; + return variables.ulm_unavailable; } ]]] styles: grid: - - grid-template-areas: "'i n n' 'i l l' 'slider slider button'" - - grid-template-columns: "min-content 2fr 1fr" - - grid-template-rows: "min-content min-content min-content" + - grid-template-areas: > + [[[ + if (!variables.ulm_card_fan_horizontal) { + if (!variables.ulm_show_button) { + return "'i n n slider slider slider' 'i l l . slider slider slider'" + } else { + return "'i n n slider slider button' 'i l l . slider slider button'" + } + } else { + if (!variables.ulm_show_button) { + return "'i n n' 'i l l' 'slider slider slider'" + } else { + return "'i n n' 'i l l' 'slider slider button'" + } + ]]] + - grid-template-columns: > + [[[ + if (!variables.ulm_card_fan_horizontal) { + return "min-content 2fr 1fr 1fr 1fr 1fr" + } else { + return "min-content 2fr 1fr" + } + ]]] + - grid-template-rows: > + [[[ + if (!variables.ulm_card_fan_horizontal) { + return "min-content min-content" + } else { + return "min-content min-content min-content" + } + ]]] custom_fields: slider: - margin-top: |- @@ -133,13 +195,14 @@ custom_card_saxel_fan_common: state: "[[[ return variables.collapsable ? 'on' : entity.state; ]]]" card: type: "custom:button-card" - icon: "mdi:rotate-3d-variant" + icon: "[[[ return variables.ulm_button_icon ]]]" entity: "[[[ return entity.entity_id ]]]" tap_action: - action: "call-service" - service: "fan.oscillate" - service_data: + action: "perform-action" + perform_action: "[[[ return variables.ulm_button_service ]]]" + target: entity_id: "[[[ return entity.entity_id; ]]]" + data: oscillating: "[[[ return !entity.attributes[variables.oscillate_attribute] ]]]" template: - "widget_icon" diff --git a/custom_cards/custom_card_scenes/README.md b/custom_cards/custom_card_scenes/README.md index db64478f9..01562ba97 100644 --- a/custom_cards/custom_card_scenes/README.md +++ b/custom_cards/custom_card_scenes/README.md @@ -3,6 +3,7 @@ title: Scenes Card Custom-card hide: - toc --- + # Custom-card "Scenes Card" @@ -21,76 +22,76 @@ Version: 1.2.0
1.2.0 - ```yaml - #OLD +```yaml +#OLD - type: "custom:button-card" - template: - - card_scenes - variables: - entity_1: "scene.YOUR_SCENE" - entity_2: "scene.YOUR_SCENE" - entity_3: "scene.YOUR_SCENE" - entity_4: "scene.YOUR_SCENE" - entity_5: "scene.YOUR_SCENE" - name_1: "YOUR_NAME" - name_2: "YOUR_NAME" - name_3: "YOUR_NAME" - name_4: "YOUR_NAME" - name_5: "YOUR_NAME" - icon_1: "mdi:YOUR_ICON" - icon_2: "mdi:YOUR_ICON" - icon_3: "mdi:YOUR_ICON" - icon_4: "mdi:YOUR_ICON" - icon_5: "mdi:YOUR_ICON" - color_icon_1: "yellow" - color_icon_2: "blue" - color_icon_3: "purple" - color_icon_4: "green" - color_icon_5: "red" - color_bg_1: "yellow" - color_bg_2: "blue" - color_bg_3: "purple" - color_bg_4: "green" - color_bg_5: "red" - ``` - - ```yaml - #NEW + template: + - card_scenes + variables: + entity_1: "scene.YOUR_SCENE" + entity_2: "scene.YOUR_SCENE" + entity_3: "scene.YOUR_SCENE" + entity_4: "scene.YOUR_SCENE" + entity_5: "scene.YOUR_SCENE" + name_1: "YOUR_NAME" + name_2: "YOUR_NAME" + name_3: "YOUR_NAME" + name_4: "YOUR_NAME" + name_5: "YOUR_NAME" + icon_1: "mdi:YOUR_ICON" + icon_2: "mdi:YOUR_ICON" + icon_3: "mdi:YOUR_ICON" + icon_4: "mdi:YOUR_ICON" + icon_5: "mdi:YOUR_ICON" + icon_color_1: "yellow" + icon_color_2: "blue" + icon_color_3: "purple" + icon_color_4: "green" + icon_color_5: "red" + bg_color_1: "yellow" + bg_color_2: "blue" + bg_color_3: "purple" + bg_color_4: "green" + bg_color_5: "red" +``` + +```yaml +#NEW - type: "custom:button-card" - template: - - card_scenes - variables: - entity_1: - entity_id: "scene.YOUR_SCENE" - icon: "mdi:YOUR_ICON" - icon_color: "yellow" - name: "YOUR_NAME" - bg_color: "yellow" - entity_2: - entity_id: "scene.YOUR_SCENE" - icon: "mdi:YOUR_ICON" - icon_color: "blue" - name: "YOUR_NAME" - bg_color: "blue" - entity_3: - entity_id: "scene.YOUR_SCENE" - icon: "mdi:YOUR_ICON" - icon_color: "purple" - name: "YOUR_NAME" - bg_color: "purple" - entity_4: - entity_id: "scene.YOUR_SCENE" - icon: "mdi:YOUR_ICON" - icon_color: "green" - name: "YOUR_NAME" - bg_color: "green" - entity_5: - entity_id: "scene.YOUR_SCENE" - icon: "mdi:YOUR_ICON" - icon_color: "red" - name: "YOUR_NAME" - bg_color: "red" - ``` + template: + - card_scenes + variables: + entity_1: + entity_id: "scene.YOUR_SCENE" + icon: "mdi:YOUR_ICON" + icon_color: "yellow" + name: "YOUR_NAME" + bg_color: "yellow" + entity_2: + entity_id: "scene.YOUR_SCENE" + icon: "mdi:YOUR_ICON" + icon_color: "blue" + name: "YOUR_NAME" + bg_color: "blue" + entity_3: + entity_id: "scene.YOUR_SCENE" + icon: "mdi:YOUR_ICON" + icon_color: "purple" + name: "YOUR_NAME" + bg_color: "purple" + entity_4: + entity_id: "scene.YOUR_SCENE" + icon: "mdi:YOUR_ICON" + icon_color: "green" + name: "YOUR_NAME" + bg_color: "green" + entity_5: + entity_id: "scene.YOUR_SCENE" + icon: "mdi:YOUR_ICON" + icon_color: "red" + name: "YOUR_NAME" + bg_color: "red" +```
diff --git a/custom_cards/custom_card_scenes/card_scenes.yaml b/custom_cards/custom_card_scenes/card_scenes.yaml index d316b54c8..c4b2cd5dc 100644 --- a/custom_cards/custom_card_scenes/card_scenes.yaml +++ b/custom_cards/custom_card_scenes/card_scenes.yaml @@ -57,8 +57,8 @@ card_scenes: color_icon: "[[[ return variables.entity_1.icon_color ]]]" color_bg: "[[[ return variables.entity_1.bg_color ]]]" tap_action: - action: "call-service" - service: | + action: "perform-action" + perform_action: | [[[ let domain = variables.entity_1.entity_id.substr(0, variables.entity_1.entity_id.indexOf(".")); if (domain == "automation") { @@ -67,7 +67,7 @@ card_scenes: return "homeassistant.turn_on" } ]]] - service_data: + target: entity_id: "[[[ return variables.entity_1.entity_id ]]]" item2: card: @@ -80,8 +80,8 @@ card_scenes: color_icon: "[[[ return variables.entity_2.icon_color ]]]" color_bg: "[[[ return variables.entity_2.bg_color ]]]" tap_action: - action: "call-service" - service: | + action: "perform-action" + perform_action: | [[[ let domain = variables.entity_2.entity_id.substr(0, variables.entity_2.entity_id.indexOf(".")); if (domain == "automation") { @@ -90,7 +90,7 @@ card_scenes: return "homeassistant.turn_on" } ]]] - service_data: + target: entity_id: "[[[ return variables.entity_2.entity_id ]]]" item3: card: @@ -103,8 +103,8 @@ card_scenes: color_icon: "[[[ return variables.entity_3.icon_color ]]]" color_bg: "[[[ return variables.entity_3.bg_color ]]]" tap_action: - action: "call-service" - service: | + action: "perform-action" + perform_action: | [[[ let domain = variables.entity_3.entity_id.substr(0, variables.entity_3.entity_id.indexOf(".")); if (domain == "automation") { @@ -113,7 +113,7 @@ card_scenes: return "homeassistant.turn_on" } ]]] - service_data: + target: entity_id: "[[[ return variables.entity_3.entity_id ]]]" item4: card: @@ -126,8 +126,8 @@ card_scenes: color_icon: "[[[ return variables.entity_4.icon_color ]]]" color_bg: "[[[ return variables.entity_4.bg_color ]]]" tap_action: - action: "call-service" - service: | + action: "perform-action" + perform_action: | [[[ let domain = variables.entity_4.entity_id.substr(0, variables.entity_4.entity_id.indexOf(".")); if (domain == "automation") { @@ -136,7 +136,7 @@ card_scenes: return "homeassistant.turn_on" } ]]] - service_data: + target: entity_id: "[[[ return variables.entity_4.entity_id ]]]" item5: card: @@ -149,8 +149,8 @@ card_scenes: color_icon: "[[[ return variables.entity_5.icon_color ]]]" color_bg: "[[[ return variables.entity_5.bg_color ]]]" tap_action: - action: "call-service" - service: | + action: "perform-action" + perform_action: | [[[ let domain = variables.entity_5.entity_id.substr(0, variables.entity_5.entity_id.indexOf(".")); if (domain == "automation") { @@ -159,7 +159,7 @@ card_scenes: return "homeassistant.turn_on" } ]]] - service_data: + target: entity_id: "[[[ return variables.entity_5.entity_id ]]]" card_scenes_pill: diff --git a/custom_cards/custom_card_schumijo_car/custom_card_schumijo_car.yaml b/custom_cards/custom_card_schumijo_car/custom_card_schumijo_car.yaml index e546e2431..9a8b567e4 100644 --- a/custom_cards/custom_card_schumijo_car/custom_card_schumijo_car.yaml +++ b/custom_cards/custom_card_schumijo_car/custom_card_schumijo_car.yaml @@ -109,6 +109,13 @@ ulm_custom_card_schumijo_ca_popup: browser_mod: service: "browser_mod.popup" data: + size: > + [[[ + const mediaQuery = window.matchMedia('(max-width: 800px)') + if (mediaQuery.matches) { + return 'fullscreen' + } + ]]] title: "Map" style: $: > diff --git a/custom_cards/custom_card_schumijo_flower/README.md b/custom_cards/custom_card_schumijo_flower/README.md index 518095d67..cbf595d7f 100644 --- a/custom_cards/custom_card_schumijo_flower/README.md +++ b/custom_cards/custom_card_schumijo_flower/README.md @@ -14,8 +14,9 @@ This is a `custom-card` to display a plant entity. Shows state of the plant and ## Credits -Author: schumijo - 2021 -Version: 1.1.0 +- Author: schumijo - 2021 +- Update 2.0.0 : Ashino - 2024 +- Version: 2.0.0 ## Changelog @@ -28,6 +29,11 @@ Initial release Fix language files for beta5 Updated README
+
+2.0.0 +Add support to lovelace-flower-card from Olen (advanced forked version) +Updated README +
## Usage @@ -38,6 +44,10 @@ Updated README ulm_card_flower_entity: plant.bonsai_ficus ulm_card_flower_name: Bonsai Ficus ulm_card_flower_species: "ficus retusa" + ulm_card_flower_show_bars: + - temperature + - humidity + - moisture ``` #### Variables @@ -67,11 +77,30 @@ Updated README yes The species of your plant + +ulm_card_flower_show_bars + +- temperature +
+- moisture +
+- humidity + +no +The bar you want to display. Any of : +
  • illuminance
  • +
  • humidity
  • +
  • moisture
  • +
  • conductivity
  • +
  • temperature
  • +
  • dli
  • + + ## Requirements -Need [lovelace-flower-card](https://github.com/thomasloven/lovelace-flower-card) +Need [lovelace-flower-card](https://github.com/Olen/lovelace-flower-card) ## Template code diff --git a/custom_cards/custom_card_schumijo_flower/custom_card_schumijo_flower.yaml b/custom_cards/custom_card_schumijo_flower/custom_card_schumijo_flower.yaml index 6703e826a..655661ca1 100644 --- a/custom_cards/custom_card_schumijo_flower/custom_card_schumijo_flower.yaml +++ b/custom_cards/custom_card_schumijo_flower/custom_card_schumijo_flower.yaml @@ -77,6 +77,7 @@ card_flower: type: "custom:flower-card" entity: "[[[ return variables.ulm_card_flower_entity ]]]" species: "[[[ return variables.ulm_card_flower_species ]]]" + show_bars: "[[[ return variables.ulm_card_flower_show_bars ]]]" card_mod: style: | ha-card{ diff --git a/custom_cards/custom_card_sisimomo_printer/README.md b/custom_cards/custom_card_sisimomo_printer/README.md index 005d04ea2..79e47b369 100644 --- a/custom_cards/custom_card_sisimomo_printer/README.md +++ b/custom_cards/custom_card_sisimomo_printer/README.md @@ -17,36 +17,59 @@ The card has support any number of ink sensors under the state of the printer. T Author: [Sisimomo](https://github.com/sisimomo) (based on [hiddevanbrussel pictures](https://community.home-assistant.io/t/lovelace-ui-minimalist/322687/203)) Version: 0.1.0 +Contributors: + +- [ByteFloater](https://github.com/bytefloater) Version 0.2.0 + ## Changelog -
    - 0.1.0 - Initial release. +
    + 0.1.0 - Initial Release + +- Initial release + +
    +
    + 0.2.0 - Added additional cases + +- Added support for other cartridge types (tricolor) +- Added further error checking for previously uncaught states +- Added support for the IPP 'unavailable' state +- Added CSS for better theming of error screens +- Added card string translation files +- Changed `text-transform` of label to capitalize +- Changed `ulm_unavailable` to `ulm_translation_unavailable` +- Removed some unnecessary inline stylings +- Fixed the handling of unavailable and idle state styling +
    ## Card options -| Options | Required | Notes | +| Options | Required | Description | |--------------|------------------|----------------| | entity | :material-check: | The entity_id for the large card | ## Variables -| Variable | Required | Notes | +| Variable | Required | Description | |----------------------------------------|------------------|----------------| -| printer_name | :material-close: | If not provide, will use the friendly name of the provided entity | -| cartridges | :material-close: | A list of `Cartridge entity` object (see below) | +| printer_name | :material-close: | The chosen display name of the printer.
    If not provided, will use the friendly name of the provided entity. | +| cartridges | :material-close: | A list of `Cartridge entity` objects. (See below) | ## Cartridge entity -| Variable | Required | Notes | Requirement | +| Variable | Required | Description | Requirement | |------------|------------------|----------------|-------------| | label | :material-check: | The label for the ink sensor. For better aesthetic, keep this string short eg: "BK", "Y", "M", "C", "PB" | | -| entity_id | :material-check: | The entity_id of the ink sensor | Must be a value between 0-100 (percentage) | -| color | :material-close: | The color of the ink bar | Must be a [CSS Legal Color Value](https://www.w3schools.com/cssref/css_colors_legal.asp). | +| entity_id | :material-check: | The entity_id of the ink sensor | Must be a value between 0-100 (percentage). | +| type | :material-close: | The type of cartridge associated with the ink sensor | Must be either 'unicolor' or 'tricolor'.
    If not provided, 'unicolor' is assumed for backwards compatibility. | +| color | :material-check: | The color of the ink bar | For unicolor cartridges, must be a single [CSS Legal Color Value](https://www.w3schools.com/cssref/css_colors_legal.asp). For tricolor cartridges, 3 colours are required. (See usage for more info) | ## Usage +### Unicolor Printers + ```yaml - type: "custom:button-card" template: "custom_card_sisimomo_printer" @@ -56,24 +79,52 @@ Version: 0.1.0 cartridges: - label: "BK" entity_id: sensor.printer_black_ink + type: unicolor color: "black" - label: "B" entity_id: sensor.printer_photo_black_ink + type: unicolor color: "black" - label: "Y" entity_id: sensor.printer_yellow_ink + type: unicolor color: "rgba(var(--color-yellow), 1)" - label: "M" entity_id: sensor.printer_magenta_ink + type: unicolor color: "#F84B7A" - label: "C" entity_id: sensor.printer_cyan_ink + type: unicolor color: "#427EDE" - label: "PB" entity_id: sensor.printer_photo_blue_ink + type: unicolor color: "#9272BE" ``` +### Tricolor Printers + +```yaml +- type: "custom:button-card" + template: custom_card_sisimomo_printer + entity: sensor.canon_mg3600_series + variables: + ulm_card_printer_name: Canon MG3650 + cartridges: + - label: "Col" + entity_id: sensor.canon_mg3600_series_black + type: tricolor + color: + - cyan + - magenta + - yellow + - label: "BK" + entity_id: sensor.canon_mg3600_series_black + type: unicolor + color: black +``` + ## Template code ??? note "Template Code" diff --git a/custom_cards/custom_card_sisimomo_printer/custom_card_sisimomo_printer.yaml b/custom_cards/custom_card_sisimomo_printer/custom_card_sisimomo_printer.yaml index acb4004e8..b80018dd8 100644 --- a/custom_cards/custom_card_sisimomo_printer/custom_card_sisimomo_printer.yaml +++ b/custom_cards/custom_card_sisimomo_printer/custom_card_sisimomo_printer.yaml @@ -1,6 +1,11 @@ --- custom_card_sisimomo_printer: - template: "ulm_language_variables" + template: + - "ulm_translation_engine" + - "ulm_language_variables" + variables: + printer_name: "[[[ entity.attributes.friendly_name; ]]]" + ulm_idle: "idle" show_icon: false show_label: false show_name: false @@ -24,18 +29,24 @@ custom_card_sisimomo_printer: type: "custom:button-card" template: | [[[ - return entity.state.toLowerCase() != variables.ulm_idle && entity.state.toLowerCase() != variables.ulm_unavailable ? [ "icon_info", "blue_no_state" ] : [ "icon_info" ]; + return ( + entity.state.toLowerCase() != variables.ulm_idle.toLowerCase() + && entity.state.toLowerCase() != variables.ulm_translation_unavailable.toLowerCase() + ? [ "icon_info", "blue_no_state" ] : [ "icon_info" ] + ); ]]] tap_action: action: "more-info" label: "[[[ return entity.state; ]]]" - name: "[[[ return variables.printer_name !== undefined ? variables.printer_name : entity.attributes.friendly_name; ]]]" + name: "[[[ return variables.printer_name; ]]]" entity: "[[[ return entity.entity_id; ]]]" styles: card: - padding: "0" - "--mdc-ripple-press-opacity": 0.12 - cursor: "pointer" + label: + - text-transform: "capitalize" cartridges: | [[[ // Source: https://stackoverflow.com/a/56266358 @@ -45,25 +56,53 @@ custom_card_sisimomo_printer: return s.color !== ''; } + let toner_info_available = true; if (variables.cartridges !== undefined ? Array.isArray(variables.cartridges) && variables.cartridges.length > 0 : false) { let errorArray = []; variables.cartridges.forEach(cartridge => { let index = variables.cartridges.indexOf(cartridge); + let valid_cartridge_types = ['unicolor', 'tricolor'] + // Confirm that the label is provided. if (cartridge.label === undefined) { errorArray.push(`cartridges.[${index}].label: You must provide a value.`); } - // Confirm that the color is provided and is a valid color css. - if (cartridge.color === undefined) { + + // Confirm that a valid cartridge type is provided, if not default to 'unicolor' + // for backwards compatibility with older configuration files + if (cartridge.type === undefined) { + cartridge.type = 'unicolor' + } else if (!valid_cartridge_types.includes(cartridge.type)) { + errorArray.push(`cartridges.[${index}].type: You must provide a valid cartridge type`); + } + + // Confirm that the color is provided and is valid color css. + if (cartridge.color !== undefined) { + if (cartridge.type === 'unicolor') { + if (typeof cartridge.color === 'string' || cartridge.color instanceof String ? !isColor(cartridge.color) : false) { + errorArray.push(`cartridges.[${index}].color: You must provide a single valid CSS color value.`); + } + } else if (Array.isArray(cartridge.color) && cartridge.color.length === 3 ? cartridge.type === 'tricolor' : false) { + cartridge.color.forEach(color => { + let col_index = cartridge.color.indexOf(color); + if (!isColor(String(color))) { + errorArray.push(`cartridges.[${index}].color.[${col_index}]: You must provide a single valid CSS color value.`); + } + }); + } else { + errorArray.push(`cartridges.[${index}].color: Invalid combination of colour and type.`); + } + } else { errorArray.push(`cartridges.[${index}].color: You must provide a value.`); - } else if (!isColor(cartridge.color)) { - errorArray.push(`cartridges.[${index}].color: You must provide a valid css color value.`); } + // Confirm that the entity_id is provided, is a valid entity_id, a integer and a value between 0 and 100 inclusively. if (cartridge.entity_id === undefined) { errorArray.push(`cartridges.[${index}].entity_id: You must provide a value.`); } else if (states[cartridge.entity_id] === undefined) { errorArray.push(`cartridges.[${index}].entity_id: You must provide a existing entity_id.`); + } else if (String(states[cartridge.entity_id].state).toLowerCase() === String(variables.ulm_translation_unavailable).toLowerCase()) { + toner_info_available = false; } else if (isNaN(states[cartridge.entity_id].state) || typeof states[cartridge.entity_id].state === "boolean") { errorArray.push(`cartridges.[${index}].entity_id: You must provide a entity representing an integer.`); } else if (states[cartridge.entity_id].state < 0 || states[cartridge.entity_id].state > 100) { @@ -71,52 +110,114 @@ custom_card_sisimomo_printer: } }); if (errorArray.length > 0) { - return `
    - ⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️ -