ekutner / home-connect-hass

Alternative (and improved) Home Connect integration for Home Assistant
MIT License
494 stars 53 forks source link

Use Translation with mushroom-template-card #338

Closed MelleD closed 4 months ago

MelleD commented 4 months ago

Hey,

is it possible to use the translation from: https://github.com/ekutner/home-connect-hass?tab=readme-ov-file#local-vs-server- into a mushroom-template-card?

I would like to show the operation state in a mushroom-template-card, but then i see the BSH key. Is it possible to reuse the translation?

Example

    type: custom:mushroom-template-card
    primary: Waschmaschine
    icon: mdi:washing-machine
    secondary: |-
      {{states("sensor.xxx_bsh_common_status_operationstate")}}
    icon_color: |-
      {% if is_state('sensor.xxx_bsh_common_status_operationstate','BSH.Common.EnumType.OperationState.Run') %}
        blue
      {% else %}
        grey
      {% endif %}
ekutner commented 4 months ago

It's a HA limitation. You can try using the "Custom templates" integration from HACS, which is supposed to add such functionality but I haven't tested it myself, or you can switch so server translation mode.

MelleD commented 4 months ago

Works nice :). Thanks for the quick answer