question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expose Charging Rate (Amps)

See original GitHub issue

Is your feature request related to a problem? Please describe. I would like to be able to directly control the car’s charging rate. THis is now possible via the new API endpoint CHARGING_AMPS (requires vehicle 2021.36.5+).

Describe the solution you’d like A number entity that lets you set the current, from 5 amps to the vehicle maximum (too tricky? Could just use 48, but some cars won’t take more than 32).

Describe alternatives you’ve considered Just calling the custom api via the below from an automation triggered by an input_number works well, but it would be nice to be able to rate limit it, check for errors etc.

service: tesla_custom.api
data:
  command: CHARGING_AMPS
  parameters:
    path_vars:
      vehicle_id: '{{ state_attr(''binary_sensor.<car_name>_online_sensor'', ''id'') }}'
    charging_amps: 16

Additional context Until now i’ve been using TWCManager to control the charge rate using the wall charger itself. The use case being to track solar production and charge your car using solar power exclusively. TWCManager is somewhat error prone. The codebase is a bit unstable, and it requires a hardware hack i’d just as soon eliminate if possible.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:15 (10 by maintainers)

github_iconTop GitHub Comments

5reactions
purcell-labcommented, Nov 21, 2021

Great EV charging tracking solar production which was up and down during the day. (Need to switch from teslafi sensors to tesla custom component sensors).

Cross posting: https://github.com/tmjo/charger-card/issues/12 https://github.com/tmjo/charger-card/issues/6

Using the following HA Customs Components:

EV Charger Card Tesla Style Power Card Tesla Custom Component SolarEdge MODBUS

Screenshot 2021-11-21 14 14 08

sensors.yaml: [ Create template values in the same structure as required via Easee Charger card ]

    easee_charger_status:
      friendly_name: "Easee EV Charger - TeslaFi"
      value_template: '{{ states("sensor.teslafi_charging_state") }}'
      attribute_templates:
        name: '{{ states("sensor.teslafi_carname") }}'
        sessionEnergy: '{{ states("sensor.teslafi_energy_added_kw") }}'
        totalPower: '{{ states("sensor.teslafi_power") }}'
        ratedCurrent: '32'
        siteKey: 'XXX'
        
    easee_charger_power:
      friendly_name: "Easee Power"
      value_template: '{{ states("sensor.ev_power") }}'
      unit_of_measurement: W
        
    easee_charger_session_energy:
      friendly_name: "Easee Energy"
      unit_of_measurement: kWh
      value_template: '{{ states("sensor.teslafi_energy_added_kw") }}'
        
    easee_charger_online:
      friendly_name: "Easee Onine"
      value_template: '{{ states("binary_sensor.duka_online_sensor") }}'

    easee_charger_smart_charging:
      friendly_name: "Easee Smart Charging"
      value_template: '{{ states("switch.duka_charger_switch") }}'
    
    easee_charger_current:
      friendly_name: "Easee Current"
      unit_of_measurement: A
      value_template: '{{ states("sensor.teslafi_charger_actual_current") }}'

    easee_charger_voltage:
      friendly_name: "Easee Voltage"
      unit_of_measurement: V
      value_template: '{{ states("sensor.teslafi_charger_voltage") }}'
      
    easee_charger_update_available:
      friendly_name: "Easee Update Available"
      unit_of_measurement: V
      value_template: '{{ states("binary_sensor.duka_update_available_sensor") }}'

Card Configuration: [ Configure Charger Card and include buttons to charger switch and solar tracking ]

type: custom:charger-card
entity: sensor.easee_charger_status
chargerImage: Anthracite
compact_view: false
show_stats: true
stats:
  default:
    - entity_id: sensor.duka_charging_rate_sensor
      attribute: charger_actual_current
      subtitle: Actual Current
      unit: A
    - entity_id: sensor.duka_charging_rate_sensor
      attribute: charge_current_request
      subtitle: Requested Current
      unit: A
    - entity_id: sensor.duka_charging_rate_sensor
      attribute: time_left
      subtitle: Time Left
      unit: h
    - entity_id: switch.duka_charger_switch
      subtitle: Charger Switch
    - entity_id: automation.tesla_charging
      subtitle: Solar Tracking
shortcuts:
  - name: Tesla High
    service: script.tesla_high
    icon: mdi:solar-power
    service_data: '16'
show_name: true
show_leds: true
show_status: true
show_collapsibles: true
show_toolbar: true
customCardTheme: theme_default

automation.tesla_charging [Every minute, if car is charging, during daylight call script to set desired charging current]

alias: Tesla Charging
description: ''
trigger:
  - platform: time_pattern
    minutes: '*'
condition:
  - condition: state
    entity_id: binary_sensor.duka_charger_sensor
    state: Charging
    attribute: charging_state
    for:
      hours: 0
      minutes: 0
      seconds: 0
      milliseconds: 0
  - condition: sun
    before: sunset
    after: sunrise
action:
  - service: script.tesla_solar
mode: single

script.tesla_solar: [ Call tesla_custom.api to set CHARGING_AMPS = PV generation / Voltage / Phases ]

alias: Tesla Solar
sequence:
  - service: tesla_custom.api
    data:
      command: CHARGING_AMPS
      parameters:
        path_vars:
          vehicle_id: '{{ state_attr(''binary_sensor.duka_online_sensor'', ''id'') }}'
        charging_amps: >-
          {{ (states('sensor.modbus_generation')|int /
          states('sensor.ev_phases')|int /
          states('sensor.ev_voltage')|int)|int}}
mode: single
1reaction
purcell-labcommented, Nov 20, 2021

Playing with some templates and the config has gotten me this far today.

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

How Many AMPs To Charge A Car Battery: Uncover The Fact
The common answer is a range of 4 to 7.5 amps.​​ Your equipment will avoid the risk of overcharging and reach the maximum...
Read more >
Measure Your Charger's Amperage to Make Sure It's Working
How to Test Your Wireless & AC Chargers [Android 5.0+]Full Tutorial: ...
Read more >
Charging Terminology To Know - Charger Harbor
Amps refers to the current or energy rate that is being transferred to the device that is being charged. Amps can refer to...
Read more >
FAQ Why it is important to get UBS port charger with 2.4 A?
Why it is important to get UBS port charger with 2.4 A? The power output level of a charger is measured in amps...
Read more >
Confused about volts, amps, and watts? - PengoHome.com
What really affects the charging speed is actually Watts, and Watt = Volt x Amps. Therefore, the larger amperage is to increase the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found