evcc-io / evcc

Sonne tanken ☀️🚘
https://evcc.io
MIT License
3.56k stars 660 forks source link

Tesla Client timeout and and current mismatch errors #14237

Closed infinus closed 5 months ago

infinus commented 5 months ago

Describe the bug

Recently updated Tesla to 2024.14.9 version and EVCC is having errors not sure if related but updated last night and this morning having issues.

1st issue: I can see the vehicle status but cannot control charging. Vehicle is charging at 17A per Tesla app.

I get a charger logic error: current mismatch error and http: request canceled (Client.Timeout exceeded while awaiting headers)

Steps to reproduce

  1. update Tesla 2.Try to control charging
  2. ...

Configuration details

# open evcc at http://evcc.local:7070
network:
  schema: http
  host: evcc.local # .local suffix announces the hostname on MDNS
  port: 7070

log: trace

# unique installation id
plant: 5e866f7fa74360b3e83390f7677cc63bcaa6a0e5542a0cdccffec90af47b531c

interval: 10s # control cycle interval

sponsortoken: *Removed*

meters:
- type: template
  template: enphase
  usage: grid
  host: 192.168.1.225
  token: *removed*
  name: grid1
- type: template
  template: enphase
  usage: pv
  host: 192.168.1.225
  token: *removed*
  name: pv2

chargers:
- type: template
  template: twc3
  host: 192.168.1.108
  name: TWC

vehicles:
- name: Infinus
  type: template
  template: tesla
  accessToken: *removed*
  refreshToken: *removed*
  vin: 5YJ3E1EC6MF849726
  capacity: 74 # kWh
  control: true

loadpoints:
- title: Home
  charger: TWC
  vehicle: Infinus
  mode: pv

tariffs:
  currency: USD
  grid:
    # static grid price summer
    type: fixed
    price: 0.0925875 # [currency]/kWh
    zones:
      - days: Mo-Fr
        hours: 16-19
        price: 0.25797 # USD/kWh
      - days: Sa,So
        price: 0.0925875 # USD/kWh
    # Static grid price winter:
#    type: fixed
#    price: 0.0926325 # [currency]/kWh
#    zones:
#      - days: Mo-Fr
#        hours: 10-15
#        price: 0.0262125 # USD/kWh
#        hours: 16-19
#        price: 0.2440725 # USD/kWh
#      - days: Sa,So
#        price: 0.0926325 # USD/kWh

  feedin:
    # rate for feeding excess (pv) energy to the grid
    type: fixed
    price: 0.0 # [currency]/kWh

site:
  title: Home
  meters:
    grid: grid1
    pv:
    - pv2

Log details

`[twc3 ] TRACE 2024/06/07 11:49:38 GET http://192.168.1.108/api/1/vitals
[twc3 ] TRACE 2024/06/07 11:49:38 {"contactor_closed":true,"vehicle_connected":true,"session_s":1892,"grid_v":238.3,"grid_hz":59.945,"vehicle_current_a":17.3,"currentA_a":7.9,"currentB_a":9.4,"currentC_a":9.4,"currentN_a":7.8,"voltageA_v":241.2,"voltageB_v":240.8,"voltageC_v":118.6,"relay_coil_v":6.2,"pcba_temp_c":54.0,"handle_temp_c":42.6,"mcu_temp_c":53.4,"uptime_s":711406,"input_thermopile_uv":-1149,"prox_v":1.5,"pilot_high_v":-0.0,"pilot_low_v":4.6,"session_energy_wh":2148.400,"config_status":5,"evse_state":11,"current_alerts":[],"evse_not_ready_reasons":[1]}
[lp-1 ] DEBUG 2024/06/07 11:49:38 charge voltages: [241 0 0]V
[lp-1 ] DEBUG 2024/06/07 11:49:38 detected connected phases: 1p
[lp-1 ] DEBUG 2024/06/07 11:49:38 detected active phases: 1p
[lp-1 ] DEBUG 2024/06/07 11:49:38 !! session: chargeRater.chargedEnergy=2.1 - chargedAtStartup=0.0
[lp-1 ] DEBUG 2024/06/07 11:49:38 charger status: C
[lp-1 ] DEBUG 2024/06/07 11:49:38 soc estimated: 60.12% (vehicle: 60.00%)
[lp-1 ] DEBUG 2024/06/07 11:49:38 vehicle soc: 60%
[lp-1 ] DEBUG 2024/06/07 11:49:38 vehicle soc limit: 90%
[lp-1 ] DEBUG 2024/06/07 11:49:38 vehicle range: 260km
[lp-1 ] WARN 2024/06/07 11:49:38 charger logic error: current mismatch (got 14A, expected 17A)
[lp-1 ] DEBUG 2024/06/07 11:49:38 pv charge current: 11.6A = 14A + -2.42A (557W @ 1p)
[tesla ] TRACE 2024/06/07 11:49:38 POST https://tesla.evcc.io/api/1/vehicles/5YJ3E1EC6MF849726/command/set_charging_amps
[tesla ] TRACE 2024/06/07 11:49:48 {"charging_amps": 11}
[lp-1 ] ERROR 2024/06/07 11:49:48 max charge current 11A: Post "https://tesla.evcc.io/api/1/vehicles/5YJ3E1EC6MF849726/command/set_charging_amps": net/http: request canceled (Client.Timeout exceeded while awaiting headers)`

Tesla Trace:

`[tesla ] TRACE 2024/06/07 11:48:12 POST https://tesla.evcc.io/api/1/vehicles/5YJ3E1EC6MF849726/command/set_charging_amps
[tesla ] TRACE 2024/06/07 11:48:22 {"charging_amps": 6}
[tesla ] TRACE 2024/06/07 11:48:25 POST https://tesla.evcc.io/api/1/vehicles/5YJ3E1EC6MF849726/command/set_charging_amps
[tesla ] TRACE 2024/06/07 11:48:35 {"charging_amps": 5}
[tesla ] TRACE 2024/06/07 11:48:38 GET https://fleet-api.prd.na.vn.cloud.tesla.com/api/1/vehicles/5YJ3E1EC6MF849726/vehicle_data
[tesla ] TRACE 2024/06/07 11:48:38 {"response":{"id":1493095239254069,"user_id":1761349,"vehicle_id":164144749364,"vin":"5YJ3E1EC6MF849726","color":null,"access_type":"OWNER","granular_access":{"hide_private":false},"tokens":["6e5293892ef311ff","0162d4c292ea8bed"],"state":"online","in_service":false,"id_s":"1493095239254069","calendar_enabled":true,"api_version":76,"backseat_token":null,"backseat_token_updated_at":null,"ble_autopair_enrolled":false,"charge_state":{"battery_heater_on":false,"battery_level":60,"battery_range":161.73,"charge_amps":17,"charge_current_request":17,"charge_current_request_max":48,"charge_enable_request":true,"charge_energy_added":2.01,"charge_limit_soc":90,"charge_limit_soc_max":100,"charge_limit_soc_min":50,"charge_limit_soc_std":80,"charge_miles_added_ideal":8.0,"charge_miles_added_rated":8.0,"charge_port_cold_weather_mode":false,"charge_port_color":"\u003cinvalid\u003e","charge_port_door_open":true,"charge_port_latch":"Engaged","charge_rate":14.9,"charger_actual_current":17,"charger_phases":1,"charger_pilot_current":48,"charger_power":4,"charger_voltage":241,"charging_state":"Charging","conn_charge_cable":"SAE","est_battery_range":160.53,"fast_charger_brand":"\u003cinvalid\u003e","fast_charger_present":false,"fast_charger_type":"ACSingleWireCAN","ideal_battery_range":161.73,"max_range_charge_counter":0,"minutes_to_full_charge":305,"not_enough_power_to_heat":null,"off_peak_charging_enabled":false,"off_peak_charging_times":"all_week","off_peak_hours_end_time":360,"preconditioning_enabled":false,"preconditioning_times":"all_week","scheduled_charging_mode":"Off","scheduled_charging_pending":false,"scheduled_charging_start_time":null,"scheduled_charging_start_time_app":0,"scheduled_departure_time":1697457600,"scheduled_departure_time_minutes":300,"supercharger_session_trip_planner":false,"time_to_full_charge":5.08,"timestamp":1717786118531,"trip_charging":false,"usable_battery_level":60,"user_charge_enable_request":null},"climate_state":{"allow_cabin_overheat_protection":true,"auto_seat_climate_left":false,"auto_seat_climate_right":false,"battery_heater":false,"battery_heater_no_power":null,"cabin_overheat_protection":"FanOnly","cabin_overheat_protection_actively_cooling":false,"climate_keeper_mode":"off","cop_activation_temperature":"High","defrost_mode":0,"driver_temp_setting":15.0,"fan_status":0,"hvac_auto_request":"On","inside_temp":36.9,"is_auto_conditioning_on":false,"is_climate_on":false,"is_front_defroster_on":false,"is_preconditioning":false,"is_rear_defroster_on":false,"left_temp_direction":0,"max_avail_temp":28.0,"min_avail_temp":15.0,"outside_temp":39.5,"passenger_temp_setting":15.0,"remote_heater_control_enabled":false,"right_temp_direction":0,"seat_heater_left":0,"seat_heater_rear_center":0,"seat_heater_rear_left":0,"seat_heater_rear_right":0,"seat_heater_right":0,"side_mirror_heaters":false,"supports_fan_only_cabin_overheat_protection":true,"timestamp":1717786118531,"wiper_blade_heater":false},"drive_state":{"power":-4,"shift_state":null,"speed":null,"timestamp":1717786118531},"gui_settings":{"gui_24_hour_time":false,"gui_charge_rate_units":"kW","gui_distance_units":"mi/hr","gui_range_display":"Rated","gui_temperature_units":"F","gui_tirepressure_units":"Psi","show_range_units":false,"timestamp":1717786118531},"parked_accessory":{"aux_park_lamps":"NaPremium","badge_version":0,"can_accept_navigation_requests":true,"can_actuate_trunks":true,"car_special_type":"base","car_type":"model3","charge_port_type":"US","cop_user_set_temp_supported":true,"dashcam_clip_save_supported":true,"default_charge_to_max":false,"driver_assist":"TeslaAP3","ece_restrictions":false,"efficiency_package":"M32021","eu_vehicle":false,"exterior_color":"PearlWhite","exterior_trim":"Black","exterior_trim_override":"","has_air_suspension":false,"has_ludicrous_mode":false,"has_seat_cooling":false,"headlamp_type":"Premium","interior_trim_type":"White2","key_version":2,"motorized_charge_port":true,"paint_color_override":"253,255,231,0.7,0.04","performance_package":"Performance","plg":true,"pws":true,"rear_drive_unit":"PM216MOSFET","rear_seat_heaters":1,"rear_seat_type":0,"rhd":false,"roof_color":"RoofColorGlass","seat_type":null,"sentry_preview_supported":true,"spoiler_type":"Passive","sun_roof_installed":null,"supports_qr_pairing":false,"third_row_seats":"None","timestamp":1717786118532,"trim_badging":"p74d","use_range_badging":true,"utc_offset":-25200,"webcam_selfie_supported":true,"webcam_supported":true,"wheel_type":"UberTurbine20Gunpowder"},"vehicle_config":{"aux_park_lamps":"NaPremium","badge_version":0,"can_accept_navigation_requests":true,"can_actuate_trunks":true,"car_special_type":"base","car_type":"model3","charge_port_type":"US","cop_user_set_temp_supported":true,"dashcam_clip_save_supported":true,"default_charge_to_max":false,"driver_assist":"TeslaAP3","ece_restrictions":false,"efficiency_package":"M32021","eu_vehicle":false,"exterior_color":"PearlWhite","exterior_trim":"Black","exterior_trim_override":"","has_air_suspension":false,"has_ludicrous_mode":false,"has_seat_cooling":false,"headlamp_type":"Premium","interior_trim_type":"White2","key_version":2,"motorized_charge_port":true,"paint_color_override":"253,255,231,0.7,0.04","performance_package":"Performance","plg":true,"pws":true,"rear_drive_unit":"PM216MOSFET","rear_seat_heaters":1,"rear_seat_type":0,"rhd":false,"roof_color":"RoofColorGlass","seat_type":null,"sentry_preview_supported":true,"spoiler_type":"Passive","sun_roof_installed":null,"supports_qr_pairing":false,"third_row_seats":"None","timestamp":1717786118532,"trim_badging":"p74d","use_range_badging":true,"utc_offset":-25200,"webcam_selfie_supported":true,"webcam_supported":true,"wheel_type":"UberTurbine20Gunpowder"},"vehicle_state":{"api_version":76,"autopark_state_v3":"unavailable","calendar_supported":true,"car_version":"2024.14.9 0b82f700aebe","center_display_state":0,"dashcam_clip_save_available":true,"dashcam_state":"Recording","df":0,"dr":0,"fd_window":0,"feature_bitmask":"fbdffbff,24cbc7f","fp_window":0,"ft":0,"homelink_device_count":3,"homelink_nearby":true,"is_user_present":false,"locked":false,"media_info":{"audio_volume":0.0,"audio_volume_increment":0.333333,"audio_volume_max":10.333333,"media_playback_status":"Playing","now_playing_album":"","now_playing_artist":"","now_playing_duration":232000,"now_playing_elapsed":61000,"now_playing_source":"AppleMusic","now_playing_station":"","now_playing_title":""},"media_state":{"remote_control_enabled":true},"notifications_supported":true,"odometer":53839.512942,"parsed_calendar_supported":true,"pf":0,"pr":0,"rd_window":0,"remote_start":false,"remote_start_enabled":true,"remote_start_supported":true,"rp_window":0,"rt":0,"santa_mode":0,"sentry_mode":false,"sentry_mode_available":true,"service_mode":false,"service_mode_plus":false,"software_update":{"download_perc":0,"expected_duration_sec":2700,"install_perc":1,"status":"","version":" "},"speed_limit_mode":{"active":false,"current_limit_mph":50.0,"max_limit_mph":120,"min_limit_mph":50.0,"pin_code_set":true},"timestamp":1717786118531,"tpms_hard_warning_fl":false,"tpms_hard_warning_fr":false,"tpms_hard_warning_rl":false,"tpms_hard_warning_rr":false,"tpms_last_seen_pressure_time_fl":1717752768,"tpms_last_seen_pressure_time_fr":1717752739,"tpms_last_seen_pressure_time_rl":1717752739,"tpms_last_seen_pressure_time_rr":1717752738,"tpms_pressure_fl":3.0,"tpms_pressure_fr":3.25,"tpms_pressure_rl":2.975,"tpms_pressure_rr":2.85,"tpms_rcp_front_value":2.9,"tpms_rcp_rear_value":2.9,"tpms_soft_warning_fl":false,"tpms_soft_warning_fr":false,"tpms_soft_warning_rl":false,"tpms_soft_warning_rr":false,"valet_mode":false,"valet_pin_needed":false,"vehicle_name":"Infinus","vehicle_self_test_progress":0,"vehicle_self_test_requested":false,"webcam_available":true}}}
[tesla ] TRACE 2024/06/07 11:48:38 POST https://tesla.evcc.io/api/1/vehicles/5YJ3E1EC6MF849726/command/set_charging_amps
[tesla ] TRACE 2024/06/07 11:48:48 {"charging_amps": 13}`

What type of operating system are you running?

Docker container

Version

0.126.6

TobiasHuber1980 commented 5 months ago

Siehe https://github.com/evcc-io/evcc/issues/14226

infinus commented 5 months ago

I do not see error 429 Too Many Requests in any of my logs so I'm not sure if it is related.

Likemike24 commented 5 months ago

Had the same issue and short after that I got 429 too many requests. It must be related.

infinus commented 5 months ago

You are right maybe an hour or two after this started I got the 429 also.