tmjo / charger-card

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

go-e Charger #57

Open tomik671108 opened 1 year ago

tomik671108 commented 1 year ago

Good morning. I really like the created card. I would like to adapt the card to my go-e Charger myself, but I don't know if I can do it, I'm not that advanced yet. Is it possible to include the go-e Charger in the list of devices?. Documentation needed: https://github.com/goecharger/go-eCharger-API-v2 https://github.com/syssi/homeassistant-goecharger-mqtt The behavior of the LEDs is described in the user manual: https://strapi-s3-bucket.s3.eu-central-1.amazonaws.com/20230613_go_e_Charger_Gemini_FLEX_INSTALLATION_AND_OPERATING_GUIDE_EN_WEB_V1_2_832adb73fc.pdf Regards tomik67

tmjo commented 1 year ago

Hi!

Thanks for your kind words. I'd love to add support for your charger, but kindly read the wiki on how-to first. Let me know if anything is unclear.

Cheers!

tomik671108 commented 1 year ago

Hi. Thank you for your great work and for directing me to the wiki on howto. Thanks to this, I was able to configure the appearance of the card, sensors and switches. The problem is the input select implementation of which I have a couple. I get the same list to choose from every time: currentlimits1:

My checkboxes look like this:

Cable unlock mode.: select.go_echarger_212417_ust

    legacy_options={
        "0": "Normal",
        "1": "Auto Unlock",
        "2": "Always Locked",
    },

Force state.: select.go_echarger_212417_frc

    legacy_options={
        "0": "Neutral",
        "1": "Don't charge",
        "2": "Charge",
    },

Logic mode.: select.go_echarger_212417_lmo

    legacy_options={
        "3": "Default",
        "4": "Eco mode",
        "5": "Automatic Stop",
    },

Phase switch mode.: select.go_echarger_212417_psm

    legacy_options={
        "0": "Auto",
        "1": "Force single phase",
        "2": "Force three phases",
    },

These input selects are originally configured as a slider:

Maximum current limit.: number.go_echarger_212417_ama

    key="ama",
    name="Maximum current limit",
    entity_category=EntityCategory.CONFIG,
    device_class=NumberDeviceClass.CURRENT,
    native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
    entity_registry_enabled_default=True,
    disabled=False,
    native_max_value=32,
    native_min_value=6,
    native_step=1,
),

Requested current.: number.go_echarger_212417_amp

    key="amp",
    name="Requested current",
    entity_category=EntityCategory.CONFIG,
    device_class=NumberDeviceClass.CURRENT,
    native_unit_of_measurement=ELECTRIC_CURRENT_AMPERE,
    entity_registry_enabled_default=True,
    disabled=False,
    native_max_value=32,
    native_min_value=6,
    native_step=1,
),

These input selects are originally configured as fields to manually enter values:

Automatic stop energy.: number.go_echarger_212417_ate

    key="ate",
    name="Automatic stop energy",
    entity_category=EntityCategory.CONFIG,
    device_class=NumberDeviceClass.ENERGY,
    native_unit_of_measurement=ENERGY_WATT_HOUR,
    entity_registry_enabled_default=True,
    disabled=False,
    native_max_value=100000,
    native_min_value=1,
    native_step=1,
),

Automatic stop time.: number.go_echarger_212417_att

    key="att",
    name="Automatic stop time",
    entity_category=EntityCategory.CONFIG,
    device_class=None,
    native_unit_of_measurement=TIME_SECONDS,
    entity_registry_enabled_default=True,
    disabled=False,
    native_max_value=86400,
    native_min_value=60,
    native_step=1,
),

I'd be grateful if you could point me in the right direction. With gratitude tomik67

tmjo commented 1 year ago

Hi,

Sounds nice you are having progress!

Unfortunately the select-entity is not fully supported "natively" as it wasn't available when the card was initially made. It seems quite popular these days, so I'll take a look at implementing it better (but don't expect it to happen very soon though, days are too full right now).

You probably already know, but a basic implementation works, for instance something like:

  group2:
    - entity_id: select.go_echarger_212417_ust
      text: Your custom text if you want one

The above will open the HA default UI when clicking on the select entity of the card, so it's not using the card dropdown items and gives an additional step which is of course not the intetion of the card. If there was a service to call, the card has an option to use custom dropdownitems. The current limit list is used as default, so you would have to specify to use those dropdowns like the below example:

  group2:
    - entity_id: select.go_echarger_212417_ust
      text: Your text if you want one
      type: dropdown
      dropdownitems:
        - Normal
        - Auto Unlock
        - Always Locked

Yet, the card does nothing with the selection. You'd have to specify a service call for that to happen which works well for "regular" services. I see that the select integration provides a service call named select.select_option which in theory may work with the card. Something like:

  group2:
    - entity_id: select.go_echarger_212417_ust
      text: Your text if you want one
      type: dropdown
      dropdownitems:
        - Normal
        - Auto Unlock
        - Always Locked
      service: select.select_option
      service_data:
        target:
          entity_id: select.go_echarger_212417_ust
        data:
          option: '#SERVICEVAL#'

I'm not sure if the select integration requires the value (for instance 0) or if it allows for the text (for instance "Normal") to be sent. Something like the below should in theory work, but I couldn't get it running when doing a quick test on one of my select-entities:

  group2:
    - entity_id: select.pump1
      text: Pump1
      type: dropdown
      dropdownitems:
        - 'Off'
        - Medium
        - High
      service: select.select_option
      service_data:
        target:
          - entity_id: select.pump1
        data:
          - option: '#SERVICEVAL#'

The value #SERVICEVAL is replaced by the card to selected value when executing the call. Either I did some silly mistakes in my test here, or there is some kind of bug or mismatch with the select service call. Perhaps you could fool around with it and see if you get it working or what error messages you get?

tomik671108 commented 1 year ago

I tried this:

- entity_id: select.go_echarger_212417_lmo
  text: Logic_mode
  type: dropdown
  dropdownitems:
    - Default
    - Eco mode
    - Automatic Stop
  service: select.select_option
  service_data:
    target:
      entity_id: select.go_echarger_212417_lmo
    data:
      option: '#SERVICEVAL#'

... the checkbox shows up correctly, but I get the following message:: Failed to call select/select_option service. extra keys not allowed @ data['data']

When I call it directly from the entity, I get the following message: The state has changed to "Eco mode" triggered by the select.select_option service

tmjo commented 1 year ago

Yeah, that's what I got. There might be some incompatability. I'll see if I can fix it.

tomik671108 commented 1 year ago

It would be great

tomik671108 commented 1 year ago

I think I managed to get this function to work properly, now it looks like this and works:

` - entity_id: select.go_echarger_212417_lmo text: Logic mode icon: mdi:format-list-checkbox type: dropdown dropdownitems:

....and the forum post on this topic was helpful.: https://smarthome.community/topic/1008/home-assistant-service-call-json-formatting-question/8 ....where it says: "Yeaup I have run into this issue with as well, for some reason HA doesn't like it.target"

tomik671108 commented 1 year ago

I'm sorry that the code looks like this, before when I pasted the formatting was correct, in the preview I have it normally.

IamMattM commented 9 months ago

I have just stumbled across this post. Recently acquired a go-e gemini and will be interested to read through the progress made here.

By the way are you aware of the go-e (mqtt) HACS integration ? https://github.com/syssi/homeassistant-goecharger-mqtt

and the older http api v1: https://github.com/cathiele/homeassistant-goecharger

K3vb3rt commented 7 months ago

I just installed the Gemini as well. Is anyone so kind and shares his code for a nice Gemini card (template)? Im not able to configure :-(

IamMattM commented 7 months ago

I just installed the Gemini as well. Is anyone so kind and shares his code for a nice Gemini card (template)? Im not able to configure :-(

I have not had the opportunity to look into it myself since, but I gather that @tomik671108 might already have sussed out the required yaml for the card and a new const_goe.ts supporting the Go-e gemini (using go-e mqtt integration) ?

If so it would be great to have visibility of this if working for you @tomik671108 ?

tomik671108 commented 7 months ago

My card looks like this:

Zrzut ekranu 2024-04-11 o 20 23 26

At the top, on the left side, I have placed additional information that you can remove if you do not need it, from the top they are:

Here is the configuration page:

Zrzut ekranu 2024-04-11 o 20 24 27

Photos of the charger to choose from:

go-e-charger-gemini-22-kw_frontansicht

go-e-charger-gemini-22-kw-laden-frontansicht

You need to put them in the Home Assistant folder, for example: config//local/assets/go-e-charger-gemini-22-kw_frontansicht.png

And now the code that works for me, fill out the configuration page, confirm, go to "show code editor" and paste the code, but replace the entities with your own, the code is in the attachment because it formats incorrectly.:

go-e_card.txt

K3vb3rt commented 7 months ago

Thank you soooo much!! Much appreciate it :-) Made my day <3

IamMattM commented 7 months ago

@tomik671108 You're a STAR ! This card looks great ! Thank you for taking the time to post back all of this information, and share the outcome of your effort in porting the card for the go-e EVSE. Looks very neat indeed.

IamMattM commented 6 months ago

@tmjo @tomik671108 Got your version of the custom card for my go-e EVSE working as per your clear instructions (needed HACS custom brand icon package for the hyundai logo)

image

I was wondering if you had or already knew of a way to use an animated .gif overlay that would be triggered when the charger is active ? What name should it take ?

go-e-ChargingOverlay,gif