Questions are fine, I know some of my descriptions might be shorthand.
So based on what you've said, find an existing charge you have for the location you want in the Charges dashboard, then click through to the relevant Charge Details dashboard for that charge.
In the URL shown in the browser you’ll then see the ID for the charging process shown at the end of the URL, ‘4’ in the example below. Make a note of your relevant charging_process_id.
http://127.0.0.1:3000/d/BHhxFeZRz/charge-details?orgId=1&from=1591759802000&to=1591761621000&var-car_id=1&var-charging_process_id=4
Go to your database, and then execute the command below, replacing ‘4’ with the charging_process_id you noted above.
Code:
SELECT position_id FROM public.charging_processes WHERE id = 4;
This will return something like this:
Code:
position_id
-------------
37
(1 row)
You can then use this position_id value, ’37’ in my example as the position_id in the INSERT statement I gave you.
Note that this is a slight short-cut, doing this will just associate your new charge with a position record which already exists for the same physical location but at a different point in time. Otherwise we’d have to find the position record that existed for where you car was at the date/time you charged BUT I guess that doesn’t exist as otherwise you wouldn’t need to add the charge manually in the first place
The position_id only really seems to be used on the Charge Details dashboard, as it used to show the charging location on the local area map panel. For your faked charge session you won’t have the detailed charging data for the Charge Details to be viewable anyway for the faked session.
I think if you set position_id to the value you look up and also set the geofence_id (think you said you can find that already?) to match your supercharger location then you’ll get something sensible regarding the location summaries on the Charging Stats dashboard.
A revised example of the INSERT statement I gave you originally but with the geofence_id added will look like this:
Code:
INSERT INTO public.charging_processes(
id,
start_date,
end_date,
charge_energy_added,
duration_min,
car_id,
position_id,
geofence_id,
cost
)
VALUES(
nextval('public.charging_processes_id_seq'),
TIMESTAMP '2020-06-29 22:00:00',
TIMESTAMP '2020-06-29 22:30:00',
2.75,
30,
1,
37,
1,
0.12
);