alandtse / tesla

Tesla custom integration for Home Assistant. This requires a refresh token be generated by third-party apps to login.
Apache License 2.0
599 stars 99 forks source link

Charge voltage #561

Open 27andrea opened 1 year ago

27andrea commented 1 year ago

To manage a charge session using the Solar power,the charge voltage is necessary . Can you implement it?

craigrouse commented 1 year ago

I think you mean current, which is exposed by the integration as "Charging Amps". Voltage is a constant 230 (or thereabouts), so 7.4kW is 32A (32230), and the lowest you can go is 5A (5230) or 1.1kW, then in 1A increments from there.

27andrea commented 1 year ago

I think you mean current, which is exposed by the integration as "Charging Amps". Voltage is a constant 230 (or thereabouts), so 7.4kW is 32A (32230), and the lowest you can go is 5A (5230) or 1.1kW, then in 1A increments from there.

The problem is that voltage is not costant.it Can be 210 volt or 219 or 237 volt So i cannot calculate it

craigrouse commented 1 year ago

@27andrea I see your point, though for my own use, I just build enough margin in so I never pull from the grid if the aim is to just charge from excess solar . If you have the Tesla Wall Connector Gen 3, the voltage is exposed in Home Assistant by default through the Tesla Wall Connector integration, so perhaps that's an option for you? I'm not sure if the charging voltage is even available on the Tesla vehicle API, but if it is, I'm not sure it would update quickly enough for your use case. The wall connector's local API, on the other hand, updates instantly. As a point of interest, our grid tolerance here in the UK is -6%, +10%, giving a minimum of 216.2V and a maximum of 253, but my own supply rarely goes below 227V or above 240V.

27andrea commented 1 year ago

I don't have tesla wall connector and i use the charger of the tesla. The problem as i said is that i have 300 watt of difference that is a lot. So i cannot set the correct amperage to use solar production

alandtse commented 1 year ago

Check the Tesla API and see if it gives the info you want. If it does, someone who wants to can add it.

craigrouse commented 1 year ago

It looks like this is available on the API as "charger_voltage" (https://tesla-api.timdorr.com/vehicle/state/chargestate). Should be fairly easy to add, though I don't have time to do it right now.

InTheDaylight14 commented 1 year ago

Charger volts is available as an attribute under "Charger Power" sensor. Attributes should be easily accessible in automations.

image

storm1er commented 1 year ago

Also, the current power given by the api is not accurate at all (gives kw without decimal which is unfair as it only a matter of volt * amp) Could we implement both sensor?