platform_driver.interfaces.chargepoint package

class platform_driver.interfaces.chargepoint.AlarmRegister(read_only, point_name, attribute_name, units, data_type, station_id, default_value=None, description='', port_number=None, username=None, timeout=0)[source]

Bases: platform_driver.interfaces.chargepoint.ChargepointRegister

Register designated for all attributes returned from the Chargepoint API getAlarms call.

Input parameters are the same as parent ChargepointRegister class.

Readable attributes: alarmType and alarmTime: Return the most recent alarm registered for the given station. If a port is defined for the register, only alarms ascribed to the port will be returned. If value is None, then there are no active alarms describing the station and/or port (depending on config).

Writeable attributes:

clearAlarms: Only accepts a write-value of 1 or True. This indicates that the Chargepoint station should be cleared of any alarms. If a point is defined for the register, only alarms ascribed to the port will be cleared. This value, when read, will always return None, as it does not exist as a returnable Chargepoint attribute.

attribute_list = ['alarmType', 'alarmTime', 'clearAlarms']
property value
writeable_list = ['clearAlarms']
class platform_driver.interfaces.chargepoint.ChargepointRegister(read_only, point_name, attribute_name, units, data_type, station_id, default_value=None, description='', port_number=None, username=None, timeout=0)[source]

Bases: platform_driver.interfaces.BaseRegister

Base class for any Chargepoint related register

Defines init-level operations for all Chargepoint registers. Also requires abstract get and set methods for value property.

Parameters
  • read_only – True = Read-only, False = Read/Write.

  • point_name – Volttron-given name of point.

  • attribute_name – Name used in Chargepoint API call. Needs to syntacticly match any value in class

‘attribute_list’ variables. :param units: Required by parent class. Not used by Chargepoint. :param data_type: Python type of register. Used to cast API call results. :param station_id: ID of Chargepoint Station register describes. :param default_value: Default value of register. :param description: Basic description of register. :param port_number: (Optional) Port number of Chargepoint Station register describes. Some registers describe port level granularity while others describe the Chargepoint Station as a whole. :param username: Username for Chargepoint API login

get_register(result, method, port_flag=True)[source]

Gets correct register from API response.

Parameters
  • result – API result from which to grab register value.

  • method – Name of Chargepoint API call that was made.

  • port_flag – Flag indicating whether or not Port-level parameters can be used. GetAlarms and

GetChargingSessionData methods use ports in their queries, but have a different reply structure than other API method calls.

Returns

Correct register value cast to appropriate python type. Returns None if there is an error.

read_only_check()[source]
static sanitize_output(data_type, value)[source]
abstract value(x)[source]
class platform_driver.interfaces.chargepoint.ChargingSessionRegister(read_only, point_name, attribute_name, units, data_type, station_id, default_value=None, description='', port_number=None, username=None, timeout=0)[source]

Bases: platform_driver.interfaces.chargepoint.ChargepointRegister

Register designated for all attributes returned from the Chargepoint API getChargingSessions call.

Input parameters are the same as parent ChargepointRegister class. No attribute in this register is writeable.

attribute_list = ['sessionID', 'startTime', 'endTime', 'Energy', 'rfidSerialNumber', 'driverAccountNumber', 'driverName']
property value
writeable_list = []
class platform_driver.interfaces.chargepoint.Interface(**kwargs)[source]

Bases: platform_driver.interfaces.BasicRevert, platform_driver.interfaces.BaseInterface

configure(config_dict, registry_config_str)[source]

Configure interface for driver.

References global CPService object and configures with username and password if not already configured.

Parameters
  • config_dict – Input from driver config.

  • registry_config_str – Input from csv file.

get_point(point_name)[source]

Get the current value for the point name given.

Parameters
  • point_name (str) – Name of the point to retrieve.

  • kwargs – Any interface specific parameters.

Returns

Point value

parse_config(config_dict, registry_config_str)[source]

Main method to parse the CSV registry config file.

class platform_driver.interfaces.chargepoint.LoadRegister(read_only, point_name, attribute_name, units, data_type, station_id, default_value=None, description='', port_number=None, username=None, timeout=0)[source]

Bases: platform_driver.interfaces.chargepoint.ChargepointRegister

Register designated for all attributes returned from the Chargepoint API getLoad call.

Input parameters are the same as parent ChargepointRegister class.

Writeable attributes (Note, if either allowedLoad or percentShed are set, the other will be set to None. In addition, shedState will be set to 1 or True):

allowedLoad: Amount of load to shed in an absolute value. Limits charging to x kW. percentShed: Percent of load to shed. Limits charging to x% of load. shedState: Only accepts a write-value of 0 or False. This indicates that the Chargepoint station should be cleared of any load shed constraints

attribute_list = ['portLoad', 'allowedLoad', 'percentShed', 'shedState']
property value
writeable_list = ['allowedLoad', 'percentShed', 'shedState']
class platform_driver.interfaces.chargepoint.StationRegister(read_only, point_name, attribute_name, units, data_type, station_id, default_value=None, description='', port_number=None, username=None, timeout=0)[source]

Bases: platform_driver.interfaces.chargepoint.ChargepointRegister

Register designated for all attributes returned from the Chargepoint API getStations call.

Input parameters are the same as parent ChargepointRegister class. No attribute in this register is writeable.

attribute_list = ['stationID', 'stationManufacturer', 'stationModel', 'portNumber', 'stationName', 'stationMacAddr', 'stationSerialNum', 'Address', 'City', 'State', 'Country', 'postalCode', 'Lat', 'Long', 'Level', 'Reservable', 'Mode', 'Voltage', 'Current', 'Power', 'numPorts', 'Type', 'startTime', 'endTime', 'minPrice', 'maxPrice', 'unitPricePerHour', 'unitPricePerSession', 'unitPricePerKWh', 'orgID', 'unitPriceForFirst', 'unitPricePerHourThereafter', 'sessionTime', 'Description', 'mainPhone', 'organizationName', 'sgID', 'sgName', 'currencyCode', 'Connector']
property value
writeable_list = []
class platform_driver.interfaces.chargepoint.StationRightsRegister(read_only, point_name, attribute_name, units, data_type, station_id, default_value=None, description='', port_number=None, username=None, timeout=0)[source]

Bases: platform_driver.interfaces.chargepoint.ChargepointRegister

Register designated for all attributes returned from the Chargepoint API getStationRights call.

Input parameters are the same as parent ChargepointRegister class. No attribute in this register is writeable.

Unlike any other ChargepointRegister subclasses, the stationRightsProfile is of type ‘dictionary.’ This calls the global method recursive_asdict, which takes the returned SUDS object and converts it, recursively, into a python dictionary. As such, this register does not go through the parent class get_register method to return its value.

attribute_list = ['stationRightsProfile']
property value
writeable_list = []
class platform_driver.interfaces.chargepoint.StationStatusRegister(read_only, point_name, attribute_name, units, data_type, station_id, default_value=None, description='', port_number=None, username=None, timeout=0)[source]

Bases: platform_driver.interfaces.chargepoint.ChargepointRegister

Register designated for all attributes returned from the Chargepoint API getStationStatus call.

Input parameters are the same as parent ChargepointRegister class. No attribute in this register is writeable.

attribute_list = ['Status', 'TimeStamp']
property value
writeable_list = []
platform_driver.interfaces.chargepoint.recursive_asdict(d)[source]

Convert Suds object into serializable format.

Credit goes to user plaes as found here: http://stackoverflow.com/questions/2412486/serializing-a-suds-object-in-python