UI-Lovelace-Minimalist / UI

UI-Lovelace-Minimalist is a "theme" for HomeAssistant
https://ui-lovelace-minimalist.github.io/UI/
Other
1.63k stars 430 forks source link

Can't get bottom line of custom entities card to render #1066

Open frantathefranta opened 1 year ago

frantathefranta commented 1 year ago

Describe the bug I'm getting this error in the bottom row of entities when using this custom card: ButtonCardJSTemplateError: TypeError: undefined is not an object (evaluating 'variables.ulm_translation_state_unit') in 'return variables.ulm_translation_state_unit'

To Reproduce Installed the custom card through the Devices&Services config menu. Minimalist UI version is the latest hotfix. Using this card config (sensors are real and have readings, I tried changing the names as well but no success):

 - type: custom:button-card
    template: custom_card_irmajavi_entities
    variables:
      ulm_custom_card_irmajavi_entities_entity_1: sensor.attic_temp_and_humidity_humidityd
      ulm_custom_card_irmajavi_entities_entity_2: sensor.bedroom_temp_and_humidity_humidity
      ulm_custom_card_irmajavi_entities_entity_3: sensor.cara_office_temp_and_humidity_humidity
      ulm_custom_card_irmajavi_entities_entity_4: sensor.outside_temp_and_humidity_humidity
      ulm_custom_card_irmajavi_entities_name_1: Voltage
      ulm_custom_card_irmajavi_entities_name_2: Temperature
      ulm_custom_card_irmajavi_entities_name_3: AC Power
      ulm_custom_card_irmajavi_entities_name_4: Current
      ulm_custom_card_irmajavi_entities_name: System Status
      ulm_custom_card_irmajavi_entities: sensor.outside_temp_and_humidity_humidity
      ulm_custom_card_irmajavi_entities_icon: mdi:sofa

Expected behavior I would like it to look like the screenshot on the linked page.

Screenshots

image

Additional context Nothing comes to mind

aherbjornsen commented 1 year ago

Don't know if you've already figured this out by yourself, but there is a missing "template:" in the custom_widget_irmajavi definition in the custom card yaml. It should look like this:

custom_widget_irmajavi:
  template:
    - "ulm_translation_engine"
  show_label: true
(...)
1liminal1 commented 1 year ago

Hey there,

I'm had the same issue?

This is worked for me in the end

custom_widget_irmajavi:
  template:
    - "ulm_translation_engine"
  show_label: true
  show_icon: false
  label: "[[[ return variables.ulm_translation_state_unit ]]]"
  styles:
    name:
      - justify-self: "center"
      - align-self: "start"
      - font-weight: "bolder"
      - font-size: "12px"
      - filter: "opacity(40%)"
    label:
      - margin-top: "10px"
      - justify-self: "center"
      - font-weight: "bold"
      - font-size: "14px"
    grid:
      - grid-template-areas: "'l' 'n'"
      - grid-template-columns: "1fr"
      - grid-template-rows: "min-content min-content"
    card:
      - box-shadow: "none"
1liminal1 commented 1 year ago

Does anyone know how to get the icon to show properly?

Thanks