CJNE / ha-myenergi

Home Assistant integration for MyEnergi devices
MIT License
134 stars 28 forks source link

Unlock Zappi from HA, Schedule charge from HA, Frontend lovelace card #323

Open sabbie-github opened 1 year ago

sabbie-github commented 1 year ago

Thank you for the work on this integration - much appreciated! Would it be possible to add the functionality to:

Also, does anyone have a fully functional frontend lovelace card for Zappi? I am using the Charger Card from @tmjo, but that is written for a different charger and not specific to zappi. I have made some edits to make it fit, but I am only a beginner with next to no experience here. Anyone else have a better, all-in-one frontend card?

Could anyone help me get the boost/eco/eco+/stop selector working in code section "group1" so the dropdown actually calls the relevant service? I can't get it to work, probably @tmjo would know best, the original card is his great work I have tried to adapt here...

image of my card and the code: zappi Screenshot 2023-02-17 130622 zappi Screenshot 2023-02-17 130622 select

type: custom:charger-card
title: Zappi EV Charger
entity: sensor.myenergi_zappi_xxx_status
customCardTheme: theme_transp_white
customImage: /local/media/white_zappi-removebg-preview.png
brand: zappi
show_leds: false
details:
  status:
    entity_id: sensor.myenergi_zappi_xxx_status
  substatus:
    entity_id: null
    unit_show: true
  smartcharging:
    entity_id: switch.myenergi_zappi_xxx_charge_mode
  currentlimits:
    - Fast
    - Eco
    - Eco+
    - Stopped
  statetext:
    Charging: Charging
    Paused: Paused
    Stopped: Stopped
    Completed: Complete
    Boosting: Boosting
  collapsiblebuttons:
    group1:
      text: Charger Mode
      icon: mdi:speedometer
    group2:
      text: Info
      icon: mdi:information
    group3:
      text: Settings
      icon: mdi:cog
  info_left:
    - entity_id: sensor.myenergi_zappi_xxx_plug_status
      text: Connection Status
    - entity_id: sensor.myenergi_xxx_power_charging
      text: Charge Power NOW
      unit_show: true
      icon: mdi:car-electric
  info_right:
    - entity_id: sensor.bmw_530e_remaining_battery_percent
      text: Car Battery Charge %
      icon: mdi:car-electric-outline
      unit_show: true
  group1:
    - entity_id: select.myenergi_zappi_xxx_charge_mode
      tap_action:
        action: call-service
        service: select.select_option
        data:
          option: Eco
        target:
          entity_id: select.myenergi_zappi_xxx_charge_mode
  group2:
    - entity_id: sensor.myenergi_xxx_power_charging
      unit_show: true
      text: Charge NOW
      icon: mdi:car-electric
    - entity_id: sensor.myenergi_zappi_xxx_charge_added_session
      unit_show: true
      text: Charge in Last Session
    - entity_id: sensor.myenergi_zappi_xxx_energy_used_today
      unit_show: true
      text: Grid Use Today
      icon: mdi:transmission-tower-export
    - entity_id: sensor.bmw_530e_remaining_battery_percent
      unit_show: true
      icon: mdi:battery-charging-medium
      text: Car Battery Charge %
    - entity_id: sensor.myenergi_xxx_voltage_grid
      unit_show: true
      text: Grid Voltage
      icon: mdi:flash-triangle-outline
    - entity_id: sensor.myenergi_xxx_frequency_grid
      unit_show: true
      text: Grid Frequency
  group3:
    - entity_id: number.myenergi_zappi_xxx_device_priority
      unit_show: true
      text: Device Priority
    - entity_id: number.myenergi_zappi_xxx_minimum_green_level
      unit_show: true
      text: Minimum Green Level
  stats:
    default:
      - entity_id: sensor.myenergi_zappi_xxx_charge_added_session
        text: Charge in Last Session
        unit_show: true
      - entity_id: select.myenergi_zappi_xxx_charge_mode
        text: Charge Mode
    Charging:
      - entity_id: sensor.myenergi_zappi_xxx_charge_added_session
        text: Charge in Last Session
        unit_show: true
      - entity_id: sensor.myenergi_xxx_power_charging
        text: Charge Power Now
        unit_show: true
      - entity_id: select.myenergi_zappi_xxx_charge_mode
        text: Charge Mode
    Paused:
      - entity_id: sensor.myenergi_zappi_xxx_charge_added_session
        text: Charge in Last Session
        unit_show: true
      - entity_id: select.myenergi_zappi_xxx_charge_mode
        text: Charge Mode
    Completed:
      - entity_id: sensor.myenergi_zappi_xxx_charge_added_session
        text: Charge in Last Session
        unit_show: true
      - entity_id: select.myenergi_zappi_xxx_charge_mode
        text: Charge Mode
    Boosting:
      - entity_id: sensor.myenergi_zappi_xxx_charge_added_session
        text: Charge in Last Session
        unit_show: true
      - entity_id: sensor.myenergi_xxx_power_charging
        text: Charge Power Now
        unit_show: true
      - entity_id: select.myenergi_zappi_xxx_charge_mode
        text: Charge Mode
lhumb commented 1 year ago

please show

customImage: /local/media/white_zappi-removebg-preview.png

found one at https://cdn.shopify.com/s/files/1/0551/6004/5615/products/zappi2_1200x1200.png?v=1642844080 but: where to put it?

sabbie-github commented 1 year ago

Go on file editor and load it to your local media directory that you will use to link w the above code I used code customImage: /local/media/white_zappi-removebg-preview.png Meaning I loaded the image to my local/media folder

lhumb commented 1 year ago

Ok -- I found the location inside my directories so that customImage: /local/media/zappi_white_223x302.png is displayed: /home/homeassistant/.homeassistant/www/media/zappi_white_223x302.png

Thank you very much

scott400k commented 1 year ago

Hi Guys, Are we any closer to adding a button to the integration to "unlock" the charger please?

LeiChat commented 1 year ago

Hi Guys, Are we any closer to adding a button to the integration to "unlock" the charger please?

I don't believe that's possible via the current myenergi API, so third party integrations are not going to be able to offer that functionality.

AJediIAm commented 1 year ago

@sabbie-github : A home assistant integration should be kept simple and only integrate (as the name suggests) 3rd party functionality in an home assistant eco system. Things like UI cards and scheduling are features which home assistant provides to varying degrees of genericness. In theorie, HA would only need one scheduling componenten in stead of each EV charger integration building their own.

I'm aware that Zappi has also scheduling capabilities, but as far as I know, this is not exposed through the API.

rastislavpapp commented 11 months ago

@AJediIAm , scheduling is exposed, see https://myenergi.info/endpoints-for-setting-zappi-boost-timers-t951.html ... I've just tried it and it works.

AJediIAm commented 11 months ago

@AJediIAm , scheduling is exposed, see https://myenergi.info/endpoints-for-setting-zappi-boost-timers-t951.html ... I've just tried it and it works.

+1 for the feature request than ;)

reedy commented 9 months ago

Hi Guys, Are we any closer to adding a button to the integration to "unlock" the charger please?

https://github.com/CJNE/pymyenergi/commit/04e932dc61d7173bafb1565825e0a14bb16733ba adds the command to the underlying API integration...

Also, cross ref #95

narjekdjcusbe commented 7 months ago

It looks like this has been released - how do we access it in the integration? I can't find any sensor/state/entity/action to view or change the locked status. Am I missing something?

G6EJD commented 7 months ago

It has to be added, so you need to wait for the author to do the work, or propose the change yourself having worked out the new code requirements.

frankvandenhurk commented 1 week ago

Would be really nice if someone would be able to add this