hombach / ioBroker.teslafi

links TeslaFi API data to be used in ioBroker
https://github.com/hombach/ioBroker.teslafi
MIT License
1 stars 0 forks source link

feature request: "managed_charging_start_time" #29

Closed Enno-von-Schwerin closed 2 weeks ago

Enno-von-Schwerin commented 3 weeks ago

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.

Enno-von-Schwerin commented 3 weeks ago

and add the value: "managed_charging_start_time" as well to see witch time the car will start charging.

hombach commented 3 weeks ago

guess the first value you wanna need is "managed_charging_active" - two times the same is probably a typo.

hombach commented 3 weeks ago

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.

Enno-von-Schwerin commented 3 weeks ago

sorry did not test it by myself have to drain my battery for testing until tomorrow

can test it from tomorrow evening on

Enno-von-Schwerin commented 3 weeks ago

if charging is stopped, charger is plugged in and time is set for charging start,

JSON looks like: image

see marked lines

hombach commented 2 weeks ago

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"
hombach commented 2 weeks ago

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.

hombach commented 2 weeks ago

implemented for 0.4.0

hombach commented 2 weeks ago

0.4.0 released to NPM