Closed Enno-von-Schwerin closed 2 weeks ago
and add the value: "managed_charging_start_time" as well to see witch time the car will start charging.
guess the first value you wanna need is "managed_charging_active" - two times the same is probably a typo.
Looks like "managed_charging_active" and "managed_charging_start_time" remains "" empty if car isn't plugged in. And also remains "" when plugged in and power is available....
Have you tried this? IMHO it will get active during charging, and then tell you the time it started.
sorry did not test it by myself have to drain my battery for testing until tomorrow
can test it from tomorrow evening on
if charging is stopped, charger is plugged in and time is set for charging start,
JSON looks like:
see marked lines
time code to be converted in local time:
import { fromUnixTime, format } from 'date-fns';
function convertUnixToLocalTime(unixTimestamp: number, dateFormat = "dd.MM.yyyy HH:mm:ss"): string {
const date = fromUnixTime(unixTimestamp);
return format(date, dateFormat);
}
// Example
const timestamp = 1731031200; // Unix-Timestamp
console.log(convertUnixToLocalTime(timestamp)); // z.B. "10.11.2024 00:00:00"
according to TeslaFi service the parameter "managed_charging_active" isn*t used.... so values are more or less "by accident". So for this feature request parameter "scheduled_charging_start_time" will be used, only.
implemented for 0.4.0
0.4.0 released to NPM
please add value "managed_charging_start_time" to the objects read from teslafi_API
to see if the car will start charging immedeatly after pluging in or at a specified time.