ngardiner / TWCManager

Control power delivered by a Tesla Wall Charger using two wires screwed into its RS-485 terminals.
The Unlicense
130 stars 55 forks source link

TWCManager stopping charge on Mobile Charger #457

Open ChutneyMary opened 2 years ago

ChutneyMary commented 2 years ago

My installation has a Tesla Wall Charger with TWCManager installed in a front carport. This services the first Tesla. A second Tesla is in the rear garage with a Tesla Mobile Charger. I was stumped why the second Tesla would sometimes stop charging after a few minutes when connected to the Tesla Mobile Charger. I resolved it by selecting 'Charge Now' in TWCManager to a value that provided an 'Offered' value greater than zero. I'm guessing that the Tesla API is sending the 'stop charging' command to the second Tesla because the Solar Surplus hasn't reached the minimum amount (4.5kW). The second Tesla is only using single phase (2.4kW) with the Mobile Charger. I don't know if there's a work-around to program to use the VIN when connected to the 'main' TWC managed wall charger. Then the Solar Surplus trigger will only be relevant to the vehicle plugged in to the main unit. Otherwise this is probably an edge-case that can be managed knowing the Mobile Charger is affected by TWCManager.

MikeBishop commented 2 years ago

Although some TWCs provide the VIN of the charging car, TWCManager doesn't currently have logic to stop only the car that's actually charging on its TWCs. It uses GPS to only stop cars at home, so the same shouldn't happen if the other vehicle is at a public charging station away from your house, FWIW.

Ultimately, we'd like to be able to manage the car on the Mobile Connector as well, but that's a longer-term aspiration.

ChutneyMary commented 2 years ago

Thanks for the info. I'd like to try an experiment to define the rear garage as the 'away' location. 30 meters separates the front carport from the rear garage. I'm assuming TWCManager has a radius for the defined 'home' location. If I tighten this radius up, I can hopefully exclude the rear garage. Where would I find the radius in the code? It would also help if I can manually edit the Home lat/long. I could also artificially place the lat/long on the far side of the TWC.

MikeBishop commented 2 years ago

Latitude and longitude is in settings.json and can be set from the Settings page, either using a map control or by pulling the current location of a vehicle. The config value atHomeRadius can be used to control the sensitivity, and defaults to about two miles. However, be aware that the default is so large because reported location isn't always precise (particularly in a garage); you might get some false positives / false negatives if you make it too narrow.

ChutneyMary commented 2 years ago

I've attempted to experiment with the atHomeRadius to stop the influence of the TWCManager on a second Tesla parked in the rear garage (the first Tesla is parked in the front carport with the Tesla Wall Charger - separation is about 30 metres). Results have been unsatisfactory. I suspect the GPS position drifts with the metal roof over each vehicle and I can't reliably exclude one vehicle from the atHome location. I've since installed a Tesla Wall Charger in the rear garage (as opposed to using the Mobile Charger). I intend to fit this with a TWCManager if I can independantly control each vehicle's charging behaviour. Is there some way to include a specific VIN with the Start/Stop API command to target a specific vehicle? My experience with atHomeRadius seems to suggest that all vehicles in an account are broadcast to?

MikeBishop commented 2 years ago

Currently, no -- it starts/stops all vehicles on the account which are marked as being "at home." Two things that might be easy to add, off the top of my head, but both require code changes:

There's been discussion about network-based modes of operation, either using the API to control a charging vehicle without control of the TWC or having two TWCManager instances that collaborate with each other, but both of those would be much larger projects that haven't been undertaken yet.

ChutneyMary commented 2 years ago

Thanks for the information. I'd like to leave this issue open with the hope that a VIN "ignore list" could be implemented at some point. I think the occurrence of two home charging Tesla's will be an increasing use-case as ICE vehicles are swapped out.

ChutneyMary commented 2 years ago

As an interim measure, I've settled on designing my own logic control using the Tesla API and my home automation system. Charge-Rate, Charge-Stop and Charge-Start are signalled with Node-Red (node-red-contrib-tesla). I still need the data flow from the Raspberry Pi/TWCManager to assist with the control loop. How can I have TWCManager set to a 'dumb' mode whereby it has no influence on the available amps? I just need it to continue to report various metrics whilst always providing 16amps available. I also don't want it sending any Start/Stop API commands.

MikeBishop commented 1 year ago

You could disable the solar portion, remove your Tesla account, and set the Non-Scheduled behavior to offer 16A.

(Alternately, there is a mode in which it just eavesdrops on real TWCs instead of pretending to be one, but I don't use that mode and couldn't tell you much about what is/isn't supported running that way.)

ChutneyMary commented 1 year ago

Thanks. That worked although I ended up using the Solar Surplus function with an enforced offset of -16 amps. The only reason for not using the Non-Scheduled behaviour is that the Amps Offered hunts around from 16 to 14. I'm guessing the spiking logic is still having some influence with this option.

To summarize, if anyone needs to disable the TWCManager automatic function -

  1. Re-install TWCManager afresh to get rid of the Tesla API credentials,
  2. Use the Schedule tab to enable Track Green Energy from 00:00,
  3. Non-Scheduled power action to Track Green Energy,
  4. Charge Rate Control - Use Tesla API Exclusively,
  5. Consumption Offsets to -16A (or whatever rate you desire).

All the metrics I was previously monitoring via MQTT are still working fine for the alternative control system.

I'll leave this topic open just as a prompt for the VIN "ignore list" (@ngardiner ). The only reason I'm using an alternative control system is to have discrete control over the two vehicles in the Home location.