Skip to content

Migrating from version 1? Use the migration script.

CREATE TABLE teleport_ev_power (
"id" serial CONSTRAINT teleport_ev_power_pkey PRIMARY KEY,
"teleport_hash_id" varchar(32) NOT NULL, -- uniquely identifies the Teleport device
"asset_identifier" varchar(128) NOT NULL, -- globally unique identifier of the asset, when available the brand and serial number of the asset
"attempt" int NOT NULL, -- 0-indexed delivery attempt
"current_type" varchar(32) NOT NULL, -- "dc", "ac", or "mixed"
"power" decimal(23,3), -- in W. Negative if charging a vehicle (consuming from the grid).
"energy_consumed" decimal(23,3), -- in Wh, can be null. Nonnegative. Active consumed energy in case currentType is "ac"
"energy_produced" decimal(23,3), -- in Wh, can be null. Nonnegative. Active produced energy in case currentType is "ac". Only relevant for bidirectional chargers
"setpoints_confirmed_active_power_limit" decimal(23,3), -- in W. The actual power limit, combining setpoints from the Teleport with that of other sources (eg. the vehicles over OCPP)
"setpoints_confirmed_current_limit" decimal(23,3), -- in A. The actual current limit, combining setpoints from the Teleport with that of other sources (eg. the vehicles over OCPP)
"setpoints_desired_active_power_limit_cloud" decimal(23,3), -- in W
"setpoints_desired_active_power_limit_active_control" decimal(23,3), -- in W
"setpoints_desired_active_power_limit_grid_operator" decimal(23,3), -- in W
"setpoints_desired_active_power_limit_modbus_server" decimal(23,3), -- in W
"setpoints_desired_current_limit_cloud" decimal(23,3), -- in W
"setpoints_desired_current_limit_active_control" decimal(23,3), -- in W
"setpoints_desired_current_limit_grid_operator" decimal(23,3), -- in W
"setpoints_desired_current_limit_modbus_server" decimal(23,3), -- in W
"setpoints_effective_active_power_limit" decimal(23,3), -- in W. Negative if charging a vehicle (consuming from the grid). Active power in case currentType is "ac". For EV chargers that only allow control via current this property is null. In that case the Teleport converts the setpoint to a current value and it is included there.
"setpoints_effective_current_limit" decimal(23,3), -- in A. Negative if charging a vehicle (consuming from the grid)
"errors" jsonb, -- if not null, will contain a JSON array of string elements. see error codes section
"scheduled" boolean NOT NULL, -- false for measurements that are not part of the regular reporting interval, eg. directly after command execution and at Teleport initialisation
"measured_at" timestamptz NOT NULL, -- when read-out started
"created_at" timestamptz NOT NULL -- when written to the table
);
CREATE INDEX teleport_ev_power_teleport_idx
ON teleport_ev_power ("teleport_hash_id", "created_at");
CREATE UNIQUE INDEX teleport_ev_power_teleport_asset_idx
ON teleport_ev_power ("teleport_hash_id", "asset_identifier", "measured_at");
COMMENT ON TABLE teleport_ev_power IS '{"version":2}';
CREATE TABLE teleport_ev_power_station (
"id" serial CONSTRAINT teleport_ev_power_station_pkey PRIMARY KEY,
"teleport_hash_id" varchar(32) NOT NULL, -- uniquely identifies the Teleport device
"asset_identifier" varchar(128) NOT NULL, -- globally unique identifier of the asset, when available the brand and serial number of the asset
"station_identifier" varchar(128) NOT NULL, -- identifier of the station
"attempt" int NOT NULL, -- 0-indexed delivery attempt
"errors" jsonb, -- if not null, will contain a JSON array of string elements. see error codes section
"scheduled" boolean NOT NULL, -- false for measurements that are not part of the regular reporting interval, eg. directly after command execution and at Teleport initialisation
"measured_at" timestamptz NOT NULL, -- when read-out started
"created_at" timestamptz NOT NULL -- when written to the table
);
CREATE INDEX teleport_ev_power_station_station_idx
ON teleport_ev_power_station ("station_identifier", "created_at");
CREATE INDEX teleport_ev_power_station_teleport_idx
ON teleport_ev_power_station ("teleport_hash_id", "asset_identifier", "created_at");
CREATE UNIQUE INDEX teleport_ev_power_station_teleport_asset_idx
ON teleport_ev_power_station ("teleport_hash_id", "asset_identifier",
"station_identifier", "measured_at");
COMMENT ON TABLE teleport_ev_power_station IS '{"version":2}';
CREATE TABLE teleport_ev_power_point (
"id" serial CONSTRAINT teleport_ev_power_point_pkey PRIMARY KEY,
"teleport_hash_id" varchar(32) NOT NULL, -- uniquely identifies the Teleport device
"asset_identifier" varchar(128) NOT NULL, -- globally unique identifier of the asset, when available the brand and serial number of the asset
"station_identifier" varchar(128) NOT NULL, -- identifier of the station
"point_identifier" varchar(128) NOT NULL, -- identifier of the point
"attempt" int NOT NULL, -- 0-indexed delivery attempt
"current_type" varchar(32) NOT NULL, -- "dc", "ac-1-phase", "ac-3-phase-delta", "ac-3-phase-wye"
"voltage" decimal(23,3), -- in V only exists if current_type is "dc" or "ac-1-phase"
"current" decimal(23,3), -- in A only exists if current_type is "dc" or "ac-1-phase". Delivering to the grid is a positive value
"power" decimal(23,3), -- in W only exists if current_type is "dc" or "ac-1-phase". Charging a vehicle has a negative value
"energy_consumed" decimal(23,3), -- in Wh
"energy_produced" decimal(23,3), -- in Wh
"voltage_phase_l1" decimal(23,3), -- in V
"voltage_phase_l2" decimal(23,3), -- in V
"voltage_phase_l3" decimal(23,3), -- in V
"voltage_line_l1" decimal(23,3), -- in V
"voltage_line_l2" decimal(23,3), -- in V
"voltage_line_l3" decimal(23,3), -- in V
"current_phase_l1" decimal(23,3), -- in A. Delivering to the grid is a positive value
"current_phase_l2" decimal(23,3), -- in A. Delivering to the grid is a positive value
"current_phase_l3" decimal(23,3), -- in A. Delivering to the grid is a positive value
"current_line_l1" decimal(23,3), -- in A. Delivering to the grid is a positive value
"current_line_l2" decimal(23,3), -- in A. Delivering to the grid is a positive value
"current_line_l3" decimal(23,3), -- in A. Delivering to the grid is a positive value
"power_l1" decimal(23,3), -- in W. Charging a vehicle has a negative value
"power_l2" decimal(23,3), -- in W. Charging a vehicle has a negative value
"power_l3" decimal(23,3), -- in W. Charging a vehicle has a negative value
"power_sum" decimal(23,3), -- in W. Charging a vehicle has a negative value
"is_charging" boolean, -- flag to show point is charging
"vehicle_connected" boolean, -- flag to show vehicle is connected
"vehicle_state_of_charge" decimal(7,4), -- in %, nonnegative
"setpoints_confirmed_active_power_limit" decimal(23,3), -- in W
"setpoints_confirmed_current_limit" decimal(23,3), -- in A
"setpoints_effective_active_power_limit" decimal(23,3), -- in W
"setpoints_effective_current_limit" decimal(23,3), -- in A
"errors" jsonb, -- if not null, will contain a JSON array of string elements. see error codes section
"scheduled" boolean NOT NULL, -- false for measurements that are not part of the regular reporting interval, eg. directly after command execution and at Teleport initialisation
"measured_at" timestamptz NOT NULL, -- when read-out started
"created_at" timestamptz NOT NULL -- when written to the table
);
CREATE INDEX teleport_ev_power_point_point_idx
ON teleport_ev_power_point ("point_identifier", "created_at");
CREATE INDEX teleport_ev_power_point_teleport_idx
ON teleport_ev_power_point ("teleport_hash_id", "asset_identifier", "created_at");
CREATE UNIQUE INDEX teleport_ev_power_point_teleport_asset_idx
ON teleport_ev_power_point ("teleport_hash_id", "asset_identifier",
"station_identifier", "point_identifier",
"measured_at");
COMMENT ON TABLE teleport_ev_power_point IS '{"version":2}';