API Reference

class selprotopy.client.base.SELClient(connApi, logger: Logger | None = None, verbose: bool = False, debug: bool = False, **kwargs)

SELClient Class for Polling an SEL Relay/Intelligent Electronic Device.

The basic polling class intended to interact with an SEL relay which has already been connected to by way of a Telnet or Serial connection using one of the following Python libraries:

Parameters:
connApi : [telnetlib.Telnet, serial.Serial]

Telnet or Serial API which will be used to communicate with the SEL relay.

autoconfig_now : bool, optional

Control to activate automatic configuration with the connected relay at time of class initialization, this should normally be set to True to allow auto-config. Defaults to True

validConnChecks : int, optional

Integer control to indicate maximum number of connection attempts should be issued to relay in the process of verifying established connection(s). Defaults to 5

interdelay : float, optional

Floating control which describes the amount of time in seconds between iterative connection verification attempts. Defaults to 0.025 (seconds)

logger : logging.logger

Logging object to record communications messages.

verbose : bool, optional

Control to dictate whether verbose printing operations should be used (often for debugging and learning purposes). Defaults to False

conn

Connection API

Type:

[telnetlib.Telnet, serial.Serial]

verbose

Verbose information printing record (set by verbose)

Type:

bool

check

Number of connection attempts before indicating failure (set by validConnChecks)

Type:

int

delay

Time (in seconds) to delay between connection attempts (set by interdelay)

Type:

float

fid

Relay’s described Firmware ID string (set by connection with relay)

Type:

str

bfid

Relay’s described BFID string (set by connection with relay)

Type:

str

cid

Relay’s described CID string (set by connection with relay)

Type:

str

devid

Relay’s described DEVID string (set by connection with relay)

Type:

str

partno

Relay’s described part number string (set by connection with relay)

Type:

str

config

Relay’s described configuration string (set by connection with relay)

Type:

str

Methods

access_level()

Identify Current Access Level.

access_level_1([level_1_pass])

Go to Access Level 1.

access_level_2([level_2_pass])

Go To Access Level 2.

autoconfig([attempts, verbose])

Auto-Configure SELClient Instance.

poll_fast_meter([minAccLevel, verbose])

Poll Fast Meter Data from SEL Relay/IED.

quit()

Quit Method.

send_breaker_bit_fast_op(control_point[, ...])

Send a Fast Operate Breaker Bit Control.

send_remote_bit_fast_op(control_point[, command])

Send a Fast Operate Remote Bit Control.

autoconfig_fastmeter

autoconfig_fastmeter_demand

autoconfig_fastmeter_peakdemand

autoconfig_fastoperate

autoconfig_relay_definition

access_level()

Identify Current Access Level.

Simple method to identify what the current access level is for the connected relay. Provides an integer and string.

Returns:

  • int (Integer representing the access level) – as a value in the range of [0, 1, 2, 3]

  • desc (String describing the access level,) – will return empty string for level-0.

access_level_1(level_1_pass: str = b'OTTER', **kwargs)

Go to Access Level 1.

Used to elevate connection privileges with the connected relay to ACC with the appropriate password specified. If called when current access level is greater than ACC, this method will deescalate the permission level to ACC.

See also

quit

Relinquish all permission with relay

access_level_2

Elevate permission to 2AC

Parameters:
level_1_pass : str, optional

Password necessary to access the ACC level, only required if accessing ACC from level 0 (i.e. logging in).

Returns:

success – Indicator of whether the login failed.

Return type:

bool

access_level_2(level_2_pass: str = b'TAIL', **kwargs)

Go To Access Level 2.

Used to elevate connection privileges with the connected relay to 2AC with the appropriate password specified. If called when current access level is greater than 2AC, this method will deescalate the permission level to 2AC.

See also

quit

Relinquish all permission with relay

access_level_1

Elevate permission to ACC

Parameters:
level_2_pass : str, optional

Password necessary to access the 2AC level, only required if accessing 2AC from level 1 (i.e. logging in).

Returns:

success – Indicator of whether the login failed.

Return type:

bool

autoconfig(attempts: int = 0, verbose: bool = False, **kwargs)

Auto-Configure SELClient Instance.

Method to operate the standard auto-configuration process with a connected relay to identify the system parameters of the relay. This includes:

  • FID

  • BFID

  • CID

  • DEVID

  • PARTNO

  • CONFIG

  • Relay Definition Block

This method also automatically interprets the following fast meter blocks by way of separate method calls.

  • Fast Meter Configuration Block

  • Fast Meter Demand Configuration Block

  • Fast Meter Peak Demand Configuration Block

  • Fast Operate Configuration Block

See also

autoconfig_fastmeter

Auto Configuration for Fast Meter

autoconfig_fastmeter_demand

Auto Configuration for Fast Meter Demand

autoconfig_fastmeter_peakdemand

Auto Configuration for Fast Meter Peak Demand

autoconfig_fastoperate

Auto Configuration for Fast Operate

autoconfig_relay_definition

Auto Configuration for Relay Definition Block

Parameters:
attempts : int, optional

Number of auto-configuration attempts, setting to 0 will allow for repeated auto-configuration until all stages succeed. Defaults to 0

verbose : bool, optional

Control to dictate whether verbose printing operations should be used (often for debugging and learning purposes). Defaults to False

poll_fast_meter(minAccLevel: bool = 0, verbose: bool = False, **kwargs)

Poll Fast Meter Data from SEL Relay/IED.

Method to poll the connected relay with the configured protocol settings (use autoconfig method to configure protocol settings).

See also

autoconfig

Relay Auto Configuration

Parameters:
minAccLevel : int, optional

Control to specify whether a minimum access level must be obtained before polling should be performed.

verbose : bool, optional

Control to dictate whether verbose printing operations should be used (often for debugging purposes). Defaults to False

quit()

Quit Method.

Simple method to send the QUIT command to an actively connected relay.

See also

access_level_1

Elevate permission to ACC

access_level_2

Elevate permission to 2AC

send_breaker_bit_fast_op(control_point: str, command: BreakerBitControlType = BreakerBitControlType.TRIP)

Send a Fast Operate Breaker Bit Control.

Send a breaker bit using the Fast Operate protocol by describing the control point and the control type.

See also

send_remote_bit_fast_op

Send Remote Bit Control

Parameters:
control_point : str

Particular Remote Bit point which should be controlled, should be of format ‘RBxx’ where ‘xx’ represents the remote bit number.

command : BreakerBitControlType, optional

Command type which will be sent, must be of: [‘TRIP’, ‘CLOSE’]. Defaults to ‘trip’

send_remote_bit_fast_op(control_point: str, command: RemoteBitControlType = RemoteBitControlType.PULSE)

Send a Fast Operate Remote Bit Control.

Send a remote bit using the Fast Operate protocol by describing the control point and the control type.

See also

send_breaker_bit_fast_op

Send Breaker Bit Control

Parameters:
control_point : str

Particular Remote Bit point which should be controlled, should be of format ‘RBxx’ where ‘xx’ represents the remote bit number.

command : RemoteBitControlType, optional

Command type which will be sent, must be of: [‘SET’, ‘CLEAR’, ‘PULSE’, ‘OPEN’, ‘CLOSE’]. Defaults to ‘pulse’

Sub-Modules and Other Package API References