Skip to content

Forwarding to a Postgres database

We forward messages to a Postgres database by insering rows into the table(s) we have been granted access to.

Below the schemas for the following messages can be found:

Solar power

The schema for messages forwarded from a Teleport device that is connected to a solar inverter:

CREATE TABLE teleport_solar_power (
"id" serial constraint teleport_solar_power_pkey primary key,
"teleport_hash_id" varchar(32) NOT NULL,
"asset_identifier" varchar(128) NOT NULL,
"attempt" int NOT NULL,
`active_power` decimal(23,3) DEFAULT NULL, -- in W
`generated_energy` decimal(23,3) DEFAULT NULL, -- in W
`active_power_limit_percentage` decimal(4,1) DEFAULT NULL,
"alarms" jsonb, -- if not null, will contain a JSON array of string elements. see alarms 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_solar_power_teleport_idx ON teleport_solar_power (teleport_hash_id, created_at);
CREATE UNIQUE INDEX teleport_solar_power_teleport_asset_idx ON teleport_solar_power (teleport_hash_id, asset_identifier, measured_at);
comment on table teleport_solar_power is '{"version":2}';
CREATE TABLE teleport_solar_power_inverters (
"id" serial constraint teleport_solar_power_inverters_pkey primary key,
"teleport_hash_id" varchar(32) NOT NULL,
"asset_identifier" varchar(128) NOT NULL,
"slave_id" int NOT NULL,
"attempt" int NOT NULL,
"active_power" decimal(23, 3), -- in W
"generated_energy" decimal(23, 3), -- in Wh
"active_power_limit_percentage" decimal(4, 1),
"alarms" jsonb, -- if not null, will contain a JSON array of string elements. see alarms 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_solar_power_inverters_inverters_idx ON teleport_solar_power_inverters (slave_id, created_at);
CREATE INDEX teleport_solar_power_inverters_teleport_idx ON teleport_solar_power_inverters (teleport_hash_id, asset_identifier, created_at);
CREATE UNIQUE INDEX teleport_solar_power_inverters_teleport_asset_idx ON teleport_solar_power_inverters (teleport_hash_id, asset_identifier, slave_id, measured_at);
comment on table teleport_solar_power is '{"version":2}';

Battery power

Batteries produce two types of messages: regular messages and flash messages. Regular messages can be exported in full, or to contain only information relevant for operators. For the strings that can occur in the errors and warnings properties, see Battery power error and warning codes.

Regular messages in full

An example of a request containing one message forwarded from a Teleport device that is connected to a battery:

CREATE TABLE teleport_battery_power (
"id" serial constraint teleport_battery_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
"battery_status" varchar(32),
"energy_charged" decimal(23,3), -- in Wh, nonnegative
"energy_discharged" decimal(23,3), -- in Wh, nonnegative
"frequency" decimal(7,2), -- in Hz, nonnegative
"active_power" decimal(23,3), -- in W, positive means discharging, negative charging
"reactive_power" decimal(23,3), -- in var, positive is injecting reactive power to the grid and negative is absorbing reactive power
"state_of_charge" decimal(7,4), -- in %, nonnegative
"state_of_health" decimal(7,4), -- in %, nonnegative
"available_energy" decimal(23,3), -- in Wh, nonnegative
"rated_energy" decimal(23,3), -- in Wh, nonnegative
"available_active_power_charge" decimal(23,3), -- in W, nonnegative
"available_active_power_discharge" decimal(23,3), -- in W, nonnegative
"available_reactive_power_inject" decimal(23,3), -- in var, nonnegative
"available_reactive_power_absorb" decimal(23,3), -- in var, nonnegative
"active_power_setpoint_dispatch_power" decimal(23,3), -- in W, positive means discharging, negative charging
"active_power_setpoint_deliver_fcr" decimal(23,3), -- in W, positive means discharging, negative charging
"active_power_setpoint_charge_to_state" decimal(23,3), -- in W, positive means discharging, negative charging
"active_power_setpoint_aggregate" decimal(23,3), -- in W, positive means discharging, negative charging
"three_phase_connection_type_high_voltage" varchar(32), -- can be "wye" or "delta"
"ac_voltage_medium_voltage_phase_l1" decimal(23,3), -- in V, nonnegative
"ac_voltage_medium_voltage_phase_l2" decimal(23,3), -- in V, nonnegative
"ac_voltage_medium_voltage_phase_l3" decimal(23,3), -- in V, nonnegative
"ac_voltage_medium_voltage_line_l1" decimal(23,3), -- in V, nonnegative
"ac_voltage_medium_voltage_line_l2" decimal(23,3), -- in V, nonnegative
"ac_voltage_medium_voltage_line_l3" decimal(23,3), -- in V, nonnegative
"ac_current_medium_voltage_phase_l1" decimal(23,3), -- in A, delivering to the grid is a positive value
"ac_current_medium_voltage_phase_l2" decimal(23,3), -- in A, delivering to the grid is a positive value
"ac_current_medium_voltage_phase_l3" decimal(23,3), -- in A, delivering to the grid is a positive value
"ac_current_medium_voltage_line_l1" decimal(23,3), -- in A, delivering to the grid is a positive value
"ac_current_medium_voltage_line_l2" decimal(23,3), -- in A, delivering to the grid is a positive value
"ac_current_medium_voltage_line_l3" decimal(23,3), -- in A, delivering to the grid is a positive value
"auxiliary_power_active" decimal(23,3), -- in W, can be null. Negative means consuming, positive generating, will be negative or 0
"auxiliary_power_reactive" decimal(23,3), -- in Var, can be null. Negative means consuming, positive generating, will be negative or 0
"configuration_dispatch_power_active_power" decimal(23,3), -- in W, positive means discharging, negative charging. When dispatchPower is null but the battery system does not support stand-by mode, the Teleport will send a schedule with 0 W to the asset, while the reported dispatchPower is null.
"configuration_deliver_fcr_max_rate" decimal(23,3), -- in W, nonnegative
"configuration_charge_to_state_percentage" decimal(7,4), -- in %, nonnegative
"warnings" jsonb, -- if not null, will contain a JSON aray of string elements. see error codes section
"errors" jsonb, -- if not null, will contain a JSON array of string elements. see error codes section
"schedule_complete_until" timestamptz, -- first gap in the schedule for this asset_identifier
"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_battery_power_teleport_idx ON teleport_battery_power (teleport_hash_id, created_at);
CREATE UNIQUE INDEX teleport_battery_power_teleport_asset_idx ON teleport_battery_power (teleport_hash_id, asset_identifier, measured_at);
comment on table teleport_battery_power is '{"version":3}';
CREATE TABLE teleport_battery_power_bess (
"id" serial constraint teleport_battery_power_bess_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
"bess_identifier" varchar(128) NOT NULL,
"attempt" int NOT NULL, -- 0-indexed delivery attempt
"cell_temperature_min" decimal(6,2), -- in ºC, min value of all cells
"cell_temperature_max" decimal(6,2), -- in ºC, max value of all cells
"room_temperature" decimal(6,2), -- in ºC, max value of all cells
"state_of_charge" decimal(7,4), -- in %, nonnegative
"available_energy" decimal(23,3), -- in Wh, nonnegative
"available_active_power_charge" decimal(23,3), -- in W, nonnegative
"available_active_power_discharge" decimal(23,3), -- in W, nonnegative
"three_phase_connection_type_low_voltage" varchar(32), -- can be "wye" or "delta"
"ac_voltage_low_voltage_phase_l1" decimal(23,3), -- in V, nonnegative
"ac_voltage_low_voltage_phase_l2" decimal(23,3), -- in V, nonnegative
"ac_voltage_low_voltage_phase_l3" decimal(23,3), -- in V, nonnegative
"ac_voltage_low_voltage_line_l1" decimal(23,3), -- in V, nonnegative
"ac_voltage_low_voltage_line_l2" decimal(23,3), -- in V, nonnegative
"ac_voltage_low_voltage_line_l3" decimal(23,3), -- in V, nonnegative
"ac_current_low_voltage_phase_l1" decimal(23,3), -- in A, delivering to the grid is a positive value
"ac_current_low_voltage_phase_l2" decimal(23,3), -- in A, delivering to the grid is a positive value
"ac_current_low_voltage_phase_l3" decimal(23,3), -- in A, delivering to the grid is a positive value
"ac_current_low_voltage_line_l1" decimal(23,3), -- in A, delivering to the grid is a positive value
"ac_current_low_voltage_line_l2" decimal(23,3), -- in A, delivering to the grid is a positive value
"ac_current_low_voltage_line_l3" decimal(23,3), -- in A, delivering to the grid is a positive value
"warnings" jsonb, -- if not null, will contain a JSON aray of string elements. see error codes section
"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_battery_power_bess_bess_idx ON teleport_battery_power_bess (bess_identifier, created_at);
CREATE INDEX teleport_battery_power_bess_teleport_idx ON teleport_battery_power_bess (teleport_hash_id, asset_identifier, created_at);
CREATE UNIQUE INDEX teleport_battery_power_bess_teleport_asset_idx ON teleport_battery_power_bess (teleport_hash_id, asset_identifier, bess_identifier, measured_at);
CREATE TABLE teleport_battery_power_bess_rack (
"id" serial constraint teleport_battery_power_bess_rack_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
"bess_identifier" varchar(128) NOT NULL,
"rack_identifier" varchar(128) NOT NULL,
"attempt" int NOT NULL, -- 0-indexed delivery attempt
"dc_voltage" decimal(23,3), -- in V, nonnegative
"dc_current" decimal(23,3), -- in A, delivering to the grid is a positive value
"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_battery_power_bess_rack_rack_idx ON teleport_battery_power_bess_rack (rack_identifier, created_at);
CREATE INDEX teleport_battery_power_bess_rack_bess_idx ON teleport_battery_power_bess_rack (bess_identifier, created_at);
CREATE INDEX teleport_battery_power_bess_rack_teleport_idx ON teleport_battery_power_bess_rack (teleport_hash_id, asset_identifier, created_at);
CREATE UNIQUE INDEX teleport_battery_power_bess_rack_teleport_asset_idx ON teleport_battery_power_bess_rack (teleport_hash_id, asset_identifier, rack_identifier, measured_at);

Flash messages

Batteries report flash messages more often than regular messages (typically every second) and contain information that is needed for dispatching algorithms and to forward to the TSO when doing aFRR/FCR.

CREATE TABLE teleport_battery_power_flash (
"id" serial constraint teleport_battery_power_flash_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
"frequency" decimal(7,2), -- in Hz, nonnegative
"active_power" decimal(23,3), -- in W, positive means discharging, negative charging
"state_of_charge" decimal(7,4), -- in %, nonnegative
"available_energy" decimal(23,3), -- in Wh, nonnegative
"available_active_power_charge" decimal(23,3), -- in W, nonnegative
"available_active_power_discharge" decimal(23,3), -- in W, nonnegative
"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_battery_power_flash_teleport_idx ON teleport_battery_power_flash (teleport_hash_id, created_at);
CREATE UNIQUE INDEX teleport_battery_power_flash_teleport_asset_idx ON teleport_battery_power_flash (teleport_hash_id, asset_identifier, measured_at);
comment on table teleport_battery_power_flash is '{"version":1}';

Set battery operation commands

The SetBatteryOperation commands that you send in through our cloud API can also be forwarded.

CREATE TABLE teleport_command_set_battery_operation (
"id" serial constraint teleport_command_set_battery_operation_pkey primary key,
"teleport_hash_id" varchar(32) NOT NULL, -- uniquely identifies the teleport device
"asset_identifiers" jsonb,
"attempt" int NOT NULL, -- 0-indexed delivery attempt
"start_at" timestamptz NOT NULL,
"end_at" timestamptz NOT NULL,
"dispatch_power_active_power" decimal(23,3), -- in W, positive means discharging, negative charging
"deliver_fcr_max_rate" decimal(23,3), -- in W, nonnegative
"charge_to_state_percentage" decimal(7,4), -- in %, nonnegative
"received_at" timestamptz NOT NULL, -- when received through our public API
"created_at" timestamptz NOT NULL -- when written to the table
);
CREATE INDEX teleport_command_set_battery_operation_teleport_created_at_idx ON teleport_command_set_battery_operation (teleport_hash_id, created_at);
CREATE INDEX teleport_command_set_battery_operation_start_at_idx ON teleport_command_set_battery_operation (teleport_hash_id, start_at);
CREATE INDEX teleport_command_set_battery_operation_received_at_idx ON teleport_command_set_battery_operation (teleport_hash_id, received_at);
comment on table teleport_command_set_battery_operation is '{"version":1}';

Meter power

The schema for messages forwarded from a Teleport device that is connected to a meter:

CREATE TABLE "teleport_meter_power" (
"id" serial constraint teleport_meter_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
"phase_voltage_l1" decimal(23,3), -- in V, nonnegative
"phase_voltage_l2" decimal(23,3), -- in V, nonnegative
"phase_voltage_l3" decimal(23,3), -- in V, nonnegative
"current_l1" decimal(23,3), -- in A, delivering to the grid is a positive value
"current_l2" decimal(23,3), -- in A, delivering to the grid is a positive value
"current_l3" decimal(23,3), -- in A, delivering to the grid is a positive value
"active_power_l1" decimal(23,3), -- in W, delivering to the grid is a positive value
"active_power_l2" decimal(23,3), -- in W, delivering to the grid is a positive value
"active_power_l3" decimal(23,3), -- in W, delivering to the grid is a positive value
"active_power_sum" decimal(23,3), -- in W, delivering to the grid is a positive value
"reactive_power_l1" decimal(23,3), -- in var, positive is injecting reactive power to the grid and negative is absorbing reactive power
"reactive_power_l2" decimal(23,3), -- in var, positive is injecting reactive power to the grid and negative is absorbing reactive power
"reactive_power_l3" decimal(23,3), -- in var, positive is injecting reactive power to the grid and negative is absorbing reactive power
"reactive_power_sum" decimal(23,3), -- in var, positive is injecting reactive power to the grid and negative is absorbing reactive power
"frequency" decimal(7,2), -- in Hz, nonnegative
"active_energy_consumed_l1" decimal(23,3), -- in Wh, nonnegative
"active_energy_consumed_l2" decimal(23,3), -- in Wh, nonnegative
"active_energy_consumed_l3" decimal(23,3), -- in Wh, nonnegative
"active_energy_consumed_sum" decimal(23,3), -- in Wh, nonnegative
"active_energy_delivered_l1" decimal(23,3), -- in Wh, nonnegative
"active_energy_delivered_l2" decimal(23,3), -- in Wh, nonnegative
"active_energy_delivered_l3" decimal(23,3), -- in Wh, nonnegative
"active_energy_delivered_sum" decimal(23,3), -- in Wh, nonnegative
"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_meter_power_teleport_idx ON teleport_meter_power (teleport_hash_id, created_at);
CREATE UNIQUE INDEX teleport_meter_power_teleport_asset_idx ON teleport_meter_power (teleport_hash_id, asset_identifier, measured_at);
comment on table teleport_meter_power is '{"version":1}';