fleet-telemetry icon indicating copy to clipboard operation
fleet-telemetry copied to clipboard

Which field provides the ChargingState?

Open virtualzone opened this issue 1 year ago • 12 comments

Hi there,

I'm trying to retrieve the ChargingState from the telemetry data. I assumed this was returned in the ChargeState.

I assumed that ChargeState had type charging_value, so I could check i.e. for ChargeStateDisconnected (enum value 1).

However, ChargeState only returns a string_value which is Idlewhenever the vehicle is not charging.

Help is appreciated, thanks in advance!

virtualzone avatar Mar 02 '24 07:03 virtualzone

I'm also interested in this question. Our use case requires knowing all the different charging states.

Currently we use charge_state.charging_state in the Fleet API vehicle data.

jbanyer avatar Mar 02 '24 09:03 jbanyer

ChargeState:/ ChargeEnableRequest: seems to change when charging starts/ stops:

https://github.com/teslamotors/fleet-telemetry/issues/127#issuecomment-1999095245

purcell-lab avatar Mar 15 '24 07:03 purcell-lab

As far as I can see, ChargingState returns rather useless Idle/Enabled string value, the expected enum ChargingState is always default (ie. ChargingStateUnknown). So in short, it does not seem to be yet fully implemented. Emailed support about it, no response yet.

peetermeos avatar Mar 24 '24 11:03 peetermeos

@agbpatro are you able to comment on this? It's very important for our use case (chargehq.net). Thanks.

jbanyer avatar Apr 11 '24 00:04 jbanyer

For ChargeState , value should be stored in string

agbpatro avatar Apr 11 '24 06:04 agbpatro

@agbpatro Developers want to know how to access the ChargingState values like Disconnected, Charging, Complete, listed here: https://github.com/teslamotors/fleet-telemetry/blob/0431c0fa97158bbac5d2c7fb2eb0b517e2c95530/protos/vehicle_data.proto#L181

ChargeState does not provide this (it provides "Idle" or "Enable") and it appears there is no way to retrieve this field. This is a very important field for virtually all third party apps. Is there a way to get the ChargingState?

stx avatar Apr 11 '24 06:04 stx

I see yeah. That is not supported yet. Will update the thread here once its available

agbpatro avatar Apr 11 '24 16:04 agbpatro

@agbpatro Thanks for the update! FYI this is a major blocker for all consumer and charging apps in moving to fleet telemetry from data requests. That field is needed to know what the car is doing and to know when to issue start/stop charging commands.

stx avatar Apr 11 '24 18:04 stx

@agbpatro thanks, just reiterating @stx's comment that this issue is preventing us from moving to fleet telemetry. I did email [email protected] about it on 18th March but haven't had a reply. Cheers.

jbanyer avatar Apr 11 '24 21:04 jbanyer

@jbanyer FYI we have observed three states from Streaming that map to polled values:

"Idle": "stopped", #streaming "QualifyLineConfig": "starting", #streaming "Enable": "charging", #streaming

https://github.com/Teslemetry/hass-teslemetry/blob/eb3e886e8222010d2e131c5092e5dd94f0444a18/custom_components/teslemetry/sensor.py#L49

Bre77 avatar Apr 14 '24 00:04 Bre77

I see yeah. That is not supported yet. Will update the thread here once its available

Any Updates on this?

And is there currently a way to get the information that the user connects or disconnects the charger? And when the charging completes (not stopped)?

Urkman avatar Jun 19 '24 09:06 Urkman

One more on this: A user off my App was charging at a "32 kWh am EnBW HPC". But the charging_state was Idle for the whole time...

Any idea on this?

Urkman avatar Jun 26 '24 17:06 Urkman