tmjo / charger-card

A lovelace card for electrical vehicle (EV) home chargers and charging robots.
MIT License
88 stars 58 forks source link

Pulling wrong language entity's #66

Open Andurilll opened 1 month ago

Andurilll commented 1 month ago

Checklist:

Release with the issue: Working with Main Branch when manually added

Last working release (if known): X Browser and Operating System:

Description of problem:

image

The Voltage and Power entity got put in english but my HA-Setup is german. Can we somehow change it so it pulls the right entity from start? sensor.p6_spannung = sensor.p6_voltage sensor.p6_leistung = sensor.p6_power

maybe there are more, the card is not fully functional yet

Javascript errors shown in the web inspector (if applicable):

Additional information:

tmjo commented 1 month ago

Hi @Andurilll and thanks for using the card.

Testing with German language seems to translate just fine in my test setup. See gif animation below.

chrome_frNvhodIfU

Could you provide a screenshot of where it is not showing correctly?

Nothing appeared in the errors you tried to include here. To my knowledge, the card is working fine. I am using it myself for several things. Anyways, you can always edit the text attribute (in the code you posted) to anything you would like. For instance in you put: text: My spannung it should show "My spannung".

Andurilll commented 1 month ago

Amazing Card you Made👌🏻

I was not talking about whats shown on the card. I meant the entity's

When i configured the card first i added the sensor.p6_status and choose the manufacturer. This worked as a Charm and build somehow the whole yaml of the card:

type: custom:charger-card
customCardTheme: theme_transp_white
chargerImage: Black
compact_view: true
entity: sensor.p6_status
show_leds: true
show_status: true
show_collapsibles: false
show_stats: true
brand: easee
details:
  name:
    entity_id: sensor.p6_status
    attribute: name
  location:
    entity_id: sensor.p6_status
    attribute: site_name
  status:
    entity_id: sensor.p6_status
  substatus:
    entity_id: sensor.p6_reason_for_no_current
  smartcharging:
    entity_id: switch.p6_smart_charging
  currentlimits:
    - 0
    - 6
    - 10
    - 16
    - 20
    - 25
    - 32
  statetext:
    disconnected: disconnected
    awaiting_start: awaiting_start
    charging: charging
    completed: completed
    error: error
    ready_to_charge: ready_to_charge
  collapsiblebuttons:
    group1:
      text: click_for_group1
      icon: mdi:speedometer
    group2:
      text: click_for_group2
      icon: mdi:information
    group3:
      text: click_for_group3
      icon: mdi:cog
  info_left:
    - entity_id: binary_sensor.p6_online
      text: online
  info_right:
    - entity_id: sensor.p6_spannung
      text: voltage
      unit_show: true
    - entity_id: sensor.p6_leistung
      text: power
      unit_show: true
  group1:
    - entity_id: sensor.p6_dynamic_charger_limit
      text: dyn_charger_limit
      service: easee.set_charger_dynamic_limit
      service_data:
        device_id: 8a4()
        current: '#SERVICEVAL#'
    - entity_id: sensor.p6_dynamic_circuit_limit
      text: dyn_circuit_limit
      service: easee.set_circuit_dynamic_limit
      service_data:
        device_id: 8a4()
        currentP1: '#SERVICEVAL#'
    - entity_id: sensor.p6_max_charger_limit
      text: max_charger_limit
      service: easee.set_charger_max_limit
      service_data:
        device_id: 8a4()
        current: '#SERVICEVAL#'
    - entity_id: sensor.p6_max_circuit_limit
      text: max_circuit_limit
      service: easee.set_circuit_max_limit
      service_data:
        device_id: 8a4a()
        currentP1: '#SERVICEVAL#'
    - entity_id: sensor.p6_offline_circuit_limit
      text: offline_circuit_limit
      service: easee.set_circuit_offline_limit
      service_data:
        device_id: 8a4()
        currentP1: '#SERVICEVAL#'
  group2:
    - entity_id: binary_sensor.p6_online
      text: online
    - entity_id: sensor.p6_voltage
      text: voltage
      unit_show: true
    - entity_id: sensor.p6_power
      text: power
      unit_show: true
    - entity_id: sensor.p6_current
      text: charger_current
      unit_show: true
    - entity_id: sensor.p6_circuit_current
      text: circuit_current
      unit_show: true
    - entity_id: sensor.p6_energy_per_hour
      text: energy_per_hour
      unit_show: true
    - entity_id: sensor.p6_session_energy
      text: session_energy
      unit_show: true
    - entity_id: sensor.p6_lifetime_energy
      text: lifetime_energy
      unit_show: true
  group3:
    - entity_id: switch.p6_is_enabled
      text: enabled
    - entity_id: switch.p6_enable_idle_current
      text: idle_current
    - entity_id: binary_sensor.p6_cable_locked
      text: cable_locked
    - entity_id: switch.p6_cable_locked_permanently
      text: perm_cable_locked
    - entity_id: switch.p6_smart_charging
      text: smart_charging
    - entity_id: sensor.p6_cost_per_kwh
      text: cost_per_kwh
    - entity_id: binary_sensor.p6_update_available
      text: update_available
    - entity_id: binary_sensor.p6_basic_schedule
      text: schedule
  stats:
    default:
      - entity_id: sensor.p6_session_energy
        text: session_energy
        unit_show: true
      - entity_id: switch.p6_cable_locked_permanently
        text: cable_locked
      - entity_id: binary_sensor.p6_basic_schedule
        text: schedule
    disconnected:
      - entity_id: sensor.p6_session_energy
        text: session_energy
        unit_show: true
      - entity_id: switch.p6_cable_locked_permanently
        text: cable_locked
      - entity_id: calculated
        text: used_limit
        unit: A
        unit_show: true
        calc_function: min
        calc_entities:
          - entity_id: sensor.p6_dynamic_charger_limit
          - entity_id: sensor.p6_dynamic_circuit_limit
          - entity_id: sensor.p6_max_charger_limit
          - entity_id: sensor.p6_max_circuit_limit
          - entity_id: sensor.p6_offline_circuit_limit
    awaiting_start:
      - entity_id: sensor.p6_session_energy
        text: session_energy
        unit_show: true
      - entity_id: binary_sensor.p6_basic_schedule
        text: schedule
      - entity_id: switch.p6_smart_charging
        text: smart_charging
      - entity_id: calculated
        text: used_limit
        unit: A
        unit_show: true
        calc_function: min
        calc_entities:
          - entity_id: sensor.p6_dynamic_charger_limit
          - entity_id: sensor.p6_dynamic_circuit_limit
          - entity_id: sensor.p6_max_charger_limit
          - entity_id: sensor.p6_max_circuit_limit
          - entity_id: sensor.p6_offline_circuit_limit
    charging:
      - entity_id: sensor.p6_session_energy
        text: session_energy
        unit_show: true
      - entity_id: sensor.p6_energy_per_hour
        text

The card looked fine but was not working. I inspected the Code and realised the entites are on english and not Germany

I changed this entity manually and the it works:

info_right:
    - entity_id: sensor.p6_spannung
      text: voltage
      unit_show: true
    - entity_id: sensor.p6_leistung
      text: power

Here you See the old entity's ((what is the plural of entity?))

group2:
    - entity_id: binary_sensor.p6_online
      text: online
    - entity_id: sensor.p6_voltage
      text: voltage
      unit_show: true
    - entity_id: sensor.p6_power
      text: power
      unit_show: true

These are still not working. I guess they would if i Change them all.

Why are the entites of my Setup in German? And why does the card build the yaml with english entity's?

Note: i setup the easee-integration and your card yesterday. Maybe this is related All the entities are on german:

https://github.com/user-attachments/assets/21873421-82ab-4420-8011-63c83799a297

Do you need more information?

tmjo commented 1 month ago

Ah, right, now I understand. HA enabled translation of entity names some time ago, and it was implemented by the Easee integration as well. This is currently not supported by the card and will take some effort to make it happen, not sure if I will make it a priority any time soon. Sorry for that.

But it should work fine just setting it up manually. You should find the German translation of entity names here if needed.

FlokkieB commented 1 week ago

Hi, reading this thread i have some questions. I saw there is a Dutch translation, but all the states in my card are in English. Following the link above i tried to find where the Dutch translation is. Can’t find it. Could you pls help me and explain where i can find where the card and translation are stored?

Andurilll commented 1 week ago

All translations are here: https://github.com/nordicopen/easee_hass/tree/master/custom_components/easee/translations

If there is no durch there is no durch translation yet. Maybe you want to add one?

FlokkieB commented 1 week ago

Sure i can add one but Dutch is already there. But i don’t see it in my card. Could that be because i did ‘t select a brand? As the translation is made for easee?

FlokkieB commented 1 week ago

Sorry, some confusion. I was talking about the charger card and i am setting it up for a Zappi. Your answer was about another project (easee) i think?