wimaha / TeslaBleHttpProxy

TeslaBleHttpProxy is a program written in Go that receives HTTP requests and forwards them via Bluetooth to a Tesla vehicle. The program can, for example, be easily used together with evcc.
Apache License 2.0
28 stars 5 forks source link

sending charge_stop instead of charge_start #9

Closed bill340 closed 3 months ago

bill340 commented 3 months ago

If I start charging in evcc ny switching from "off" to "fast", a "charge_stop" command is sent instead of a "charge_start" command. The charge_stop gets an error: [Error]failed to stop charge: car could not execute command: not_charging

Here are the logs of evcc and BLEproxy:

[site ] DEBUG 2024/06/21 15:14:03 ---- [lp-1 ] DEBUG 2024/06/21 15:14:03 charge power: 0W [lp-2 ] DEBUG 2024/06/21 15:14:03 charge power: 0W [site ] DEBUG 2024/06/21 15:14:03 pv power: 3399W [site ] DEBUG 2024/06/21 15:14:03 battery soc: 40% [site ] DEBUG 2024/06/21 15:14:03 battery power: -1640W [site ] DEBUG 2024/06/21 15:14:03 grid meter: -15W [site ] DEBUG 2024/06/21 15:14:03 battery has priority at soc 40% (< 40%) [site ] DEBUG 2024/06/21 15:14:03 site power: 85W [lp-2 ] DEBUG 2024/06/21 15:14:03 !! active phases: 3p = min(0p measured 0p vehicle 3p physical 0p charger) [lp-2 ] DEBUG 2024/06/21 15:14:03 charger status: B [lp-2 ] DEBUG 2024/06/21 15:14:06 set charge mode: now [site ] DEBUG 2024/06/21 15:14:06 ---- [lp-1 ] DEBUG 2024/06/21 15:14:06 charge power: 0W [lp-2 ] DEBUG 2024/06/21 15:14:06 charge power: 0W [site ] DEBUG 2024/06/21 15:14:06 pv power: 3363W [site ] DEBUG 2024/06/21 15:14:06 battery soc: 40% [site ] DEBUG 2024/06/21 15:14:06 battery power: -1620W [site ] DEBUG 2024/06/21 15:14:06 grid meter: -0W [site ] DEBUG 2024/06/21 15:14:06 battery has priority at soc 40% (< 40%) [site ] DEBUG 2024/06/21 15:14:06 site power: 100W [lp-2 ] DEBUG 2024/06/21 15:14:06 !! active phases: 3p = min(0p measured 0p vehicle 3p physical 0p charger) [lp-2 ] DEBUG 2024/06/21 15:14:06 charger status: B [lp-2 ] DEBUG 2024/06/21 15:14:06 charger enable [lp-2 ] DEBUG 2024/06/21 15:14:06 !! active phases: 3p = min(0p measured 0p vehicle 3p physical 0p charger) [lp-2 ] DEBUG 2024/06/21 15:14:06 wake-up timer: start [site ] DEBUG 2024/06/21 15:14:23 ---- [lp-1 ] DEBUG 2024/06/21 15:14:23 charge power: 0W [lp-2 ] DEBUG 2024/06/21 15:14:23 charge power: 0W [site ] DEBUG 2024/06/21 15:14:23 pv power: 2850W [site ] DEBUG 2024/06/21 15:14:23 battery soc: 40% [site ] DEBUG 2024/06/21 15:14:23 battery power: -1110W [site ] DEBUG 2024/06/21 15:14:23 grid meter: 5W [site ] DEBUG 2024/06/21 15:14:23 battery has priority at soc 40% (< 40%) [site ] DEBUG 2024/06/21 15:14:23 site power: 105W [lp-1 ] DEBUG 2024/06/21 15:14:23 !! active phases: 3p = min(0p measured 0p vehicle 3p physical 0p charger) [lp-1 ] DEBUG 2024/06/21 15:14:23 charger status: B [site ] DEBUG 2024/06/21 15:14:43 ---- [lp-1 ] DEBUG 2024/06/21 15:14:43 charge power: 0W [lp-2 ] DEBUG 2024/06/21 15:14:43 charge power: 0W [site ] DEBUG 2024/06/21 15:14:43 pv power: 2728W [site ] DEBUG 2024/06/21 15:14:43 battery soc: 40% [site ] DEBUG 2024/06/21 15:14:43 battery power: -970W [site ] DEBUG 2024/06/21 15:14:43 grid meter: 12W [site ] DEBUG 2024/06/21 15:14:43 battery has priority at soc 40% (< 40%) [site ] DEBUG 2024/06/21 15:14:43 site power: 112W [lp-2 ] DEBUG 2024/06/21 15:14:43 !! active phases: 3p = min(0p measured 0p vehicle 3p physical 0p charger) [lp-2 ] DEBUG 2024/06/21 15:14:43 charger status: B [lp-2 ] DEBUG 2024/06/21 15:14:43 wake-up charger, attempts left: 5 [site ] DEBUG 2024/06/21 15:15:03 ---- [lp-1 ] DEBUG 2024/06/21 15:15:03 charge power: 0W [lp-2 ] DEBUG 2024/06/21 15:15:03 charge power: 0W [site ] DEBUG 2024/06/21 15:15:03 pv power: 2666W [site ] DEBUG 2024/06/21 15:15:03 battery soc: 40% [site ] DEBUG 2024/06/21 15:15:03 battery power: -950W [site ] DEBUG 2024/06/21 15:15:03 grid meter: -1W [site ] DEBUG 2024/06/21 15:15:03 battery has priority at soc 40% (< 40%) [site ] DEBUG 2024/06/21 15:15:03 site power: 99W [lp-1 ] DEBUG 2024/06/21 15:15:03 !! active phases: 3p = min(0p measured 0p vehicle 3p physical 0p charger) [lp-1 ] DEBUG 2024/06/21 15:15:03 charger status: B


2024/06/21 17:14:00 Connecting to vehicle... 2024/06/21 17:14:03 sending command "charge_stop"... 2024/06/21 17:14:04 stop retrying after 3 attempts 2024/06/21 17:14:04 The command "charge_stop" was canceled: 2024/06/21 17:14:04 [Error]failed to stop charge: car could not execute command: not_charging 2024/06/21 17:14:05 handle command: charge_stop (VIN: LRWYGCEKXNC351138) 2024/06/21 17:14:05 Connecting to vehicle... 2024/06/21 17:14:06 received command "charge_stop" (VIN: LRWYGCEKXNC351138) with body: map[] 2024/06/21 17:14:08 sending command "charge_stop"... 2024/06/21 17:14:09 [Error]failed to stop charge: car could not execute command: not_charging 2024/06/21 17:14:09 retrying in 3 seconds 2024/06/21 17:14:12 Connecting to vehicle... 2024/06/21 17:14:15 sending command "charge_stop"... 2024/06/21 17:14:16 [Error]failed to stop charge: car could not execute command: not_charging 2024/06/21 17:14:16 retrying in 6 seconds 2024/06/21 17:14:22 Connecting to vehicle... 2024/06/21 17:14:24 sending command "charge_stop"... 2024/06/21 17:14:25 [Error]failed to stop charge: car could not execute command: not_charging 2024/06/21 17:14:25 retrying in 12 seconds 2024/06/21 17:14:37 Connecting to vehicle... 2024/06/21 17:14:39 sending command "charge_stop"... 2024/06/21 17:14:40 [Error]failed to stop charge: car could not execute command: not_charging 2024/06/21 17:14:40 retrying in 24 seconds 2024/06/21 17:14:43 received command "wake_up" (VIN: LRWYGCEKXNC351138) with body: map[] 2024/06/21 17:15:04 Connecting to vehicle... 2024/06/21 17:15:06 sending command "charge_stop"... 2024/06/21 17:15:08 [Error]failed to stop charge: car could not execute command: not_charging 2024/06/21 17:15:08 retrying in 48 seconds 2024/06/21 17:15:23 received command "charge_stop" (VIN: LRWYGCEKXNC351138) with body: map[] 2024/06/21 17:15:23 received command "wake_up" (VIN: LRWYGCEKXNC351138) with body: map[] 2024/06/21 17:15:56 Connecting to vehicle... 2024/06/21 17:15:58 sending command "charge_stop"... 2024/06/21 17:15:59 stop retrying after 3 attempts 2024/06/21 17:15:59 The command "charge_stop" was canceled: 2024/06/21 17:15:59 [Error]failed to stop charge: car could not execute command: not_charging 2024/06/21 17:16:00 handle command: wake_up (VIN: LRWYGCEKXNC351138) 2024/06/21 17:16:00 Connecting to vehicle... 2024/06/21 17:16:02 sending command "wake_up"... 2024/06/21 17:16:03 The command "wake_up" was successfully executed. 2024/06/21 17:16:04 handle command: charge_stop (VIN: LRWYGCEKXNC351138) 2024/06/21 17:16:04 Connecting to vehicle... 2024/06/21 17:16:07 sending command "charge_stop"... 2024/06/21 17:16:08 [Error]failed to stop charge: car could not execute command: not_charging 2024/06/21 17:16:08 retrying in 3 seconds

bill340 commented 3 months ago

Ok, found the problem in my evcc.yaml... Had still the ".chargeenable" variable in the second car... Sorry!!

"http://192.168.2.110:8080/api/1/vehicles/XP7YGCEK8RB277602/command/{{if .chargeenable}}charge_start{{else}}charge_stop{{end}}" to "http://192.168.2.110:8080/api/1/vehicles/XP7YGCEK8RB277602/command/{{if .enable}}charge_start{{else}}charge_stop{{end}}"