Loadpoint: optional geofence hint for vehicle auto-detection
Is your feature request related to a problem? Please describe.
With regular wallbox chargers (modbus/ocpp/etc), vehicle detection currently uses charger id and/or vehicle charge status. In setups without reliable charger-side id, detection depends on status only. That can be wrong when cloud status does not reflect presence at this loadpoint, as can easily happen when there's multiple vehicles configured that regularly charge outside of the evcc charger location.
Geofencing exists today in charger-specific implementations (vehicle-api, tessie), but not in the general loadpoint detection path. Many manufacturer APIs already provide and expose the cars location.
Describe the solution you'd like
Add an optional geofence setting at loadpoint level and use it as an additional signal during vehicle detection on connect.
Detection order can stay unchanged:
- charger identifier match first
- status-based detection second
When geofence is enabled, apply it to status-based candidate selection, rejecting vehicles outside of the charger location. Keep default behavior unchanged when geofence is not configured.
Describe alternatives you've considered
Using vehicle-api only for geofencing is not a fit when charger-native control is available. Reliable vehicle identifiers are not very widespread, especially in unauthenticated charger setups.
Additional context
Example configuration
loadpoints:
- title: Carport
vehicleDetection:
geofence:
enabled: true
lat: 52.43890
lon: 10.77325
radius: 120 # meters
We could also consider data freshness as an additional vehicle detection filter, rejecting cars whose status is older than a configured threshold.
We could also consider data freshness as an additional vehicle detection filter, rejecting cars whose status is older than a configured threshold.
This information is not available in the internal api. If somebody wants to try this, happy to take a PR. It needs to be ensured that existing heuristics are not impacted.
This information is not available in the internal api.
Agreed, but most manufacturer APIs supply information that could drive such a field. We could consider starting to expose that if we see value in it.
That being said, I'll prepare the changes for pure geofencing since this is going to provide the biggest payoff right now.
We could consider starting to expose that if we see value in it.
This would likely be per vehicle instance api, not per vehicle instance. I don't see a good way for doing this without a major breaking change.
Why is this closed as "not planned", when @terrorobe wanted to work on this? 🤔