pythonvolttron

Volttron `volttron.platform.jsonrpc.RemoteError` when attempting to `get_point`


Im developing a Volttron energy storage control agent and am attempting to perform a seemingly simple read of the battery's "state of energy" with this line

# read current SoE from battery system
result = self.vip.rpc.call(
    'platform.driver', 
    'get_point', 
    path='devices/STAC/SEDG_BESS',
    point_name='SEDGBatteryStateOfEnergy'
).get(timeout=5)

but I am getting the following error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "src/gevent/event.py", line 305, in gevent._gevent_cevent.AsyncResult.get
  File "src/gevent/event.py", line 335, in gevent._gevent_cevent.AsyncResult.get
  File "src/gevent/event.py", line 305, in gevent._gevent_cevent.AsyncResult.get
  File "src/gevent/event.py", line 305, in gevent._gevent_cevent.AsyncResult.get
  File "src/gevent/event.py", line 323, in gevent._gevent_cevent.AsyncResult.get
  File "src/gevent/event.py", line 303, in gevent._gevent_cevent.AsyncResult._raise_exception
  File "/home/pi/volttron/env/lib/python3.8/site-packages/gevent/_compat.py", line 66, in reraise
    raise value
volttron.platform.jsonrpc.RemoteError: builtins.KeyError('devices/STAC/SEDG_BESS')

I have 2 agents (listeneragent-3.3 & platform_driveragent-4.0) running in the main Volttron process:

(volttron) pi@raspberrypi:~/volttron $ vctl status
UUID AGENT                     IDENTITY                    TAG      STATUS          HEALTH
4 DeviceWriteAgentagent-0.1 DeviceWriteAgentagent-0.1_1                          
a actuatoragent-1.0         platform.actuator                                    
0 listeneragent-3.3         listeneragent-3.3_1         listener running [9856]  GOOD
3 platform_driveragent-4.0  platform.driver                      running [9857]  GOOD
d sqlhistorianagent-4.0.0   sqlhistorianagent-4.0.0_1  

and Im running my custom ESS controller agent in the VSCode debugger using all the settings specified in the Volttron Dev documention

I know the Platform Driver is running and connected to the ESS because I see it posting periodic scrapes of all the modbus registers to volttron.log. Here you can see one of these scrapes with the devices/STAC/SEDG_BESS device with a point named SEDGBatteryStateOfEnergy:

2022-08-25 11:53:20,237 (listeneragent-3.3 9856) __main__ INFO: Peer: pubsub, Sender: platform.driver:, Bus: , Topic: devices/STAC/SEDG_BESS/all, Headers: {'Date': '2022-08-25T17:53:20.083384+00:00', 'TimeStamp': '2022-08-25T17:53:20.083384+00:00', 'SynchronizedTimeStamp': '2022-08-25T17:53:20.000000+00:00', 'min_compatible_version': '3.0', 'max_compatible_version': ''}, Message: 
[{'SEDGACInverterPowerTotal': 3594,
  'SEDGACInverterPowerTotal_SF': 0,
  'SEDGACMeterPowerTotal': 3591,
  'SEDGACMeterPowerTotal_SF': 0,
  'SEDGBatteryStateOfEnergy': 31.998273849487305,
  'SEDGDCBatteryPower': 0.0,
  'SEDGDCInverterPowerTotal': 3648,
  'SEDGDCInverterPowerTotal_SF': 0,
  'SEDGRemote_Control_Charge_Limit': 6600.0,
  'SEDGRemote_Control_Command_Discharge_Limit': 6600.0,
  'SEDGRemote_Control_Command_Mode': 1,
  'SEDGRemote_Control_Command_Timeout': 3600,
  'SEDGStorage_AC_Charge_Limit': 6600.0,
  'SEDGStorage_AC_Charge_Policy': 1,
  'SEDGStorage_Backup_Reserved_Setting': 10.0,
  'SEDGStorage_Charge-Discharge_Default_Mode': 1,
  'SEDGStorage_Control_Mode': 4,
  'SEDGWrite_Remote_Control_Charge_Limit': 6600.0,
  'SEDGWrite_Remote_Control_Command_Discharge_Limit': 6600.0,
  'SEDGWrite_Remote_Control_Command_Mode': 1,
  'SEDGWrite_Remote_Control_Command_Timeout': 3600,
  'SEDGWrite_Storage_AC_Charge_Limit': 6600.0,
  'SEDGWrite_Storage_AC_Charge_Policy': 1,
  'SEDGWrite_Storage_Backup_Reserved_Setting': 10.0,
  'SEDGWrite_Storage_Charge-Discharge_Default_Mode': 1,
  'SEDGWrite_Storage_Control_Mode': 4},
 {'SEDGACInverterPowerTotal': {'type': 'integer',
                               'tz': 'UTC',
                               'units': 'Watts'},
  'SEDGACInverterPowerTotal_SF': {'type': 'integer', 'tz': 'UTC', 'units': ''},
  'SEDGACMeterPowerTotal': {'type': 'integer', 'tz': 'UTC', 'units': 'Watts'},
  'SEDGACMeterPowerTotal_SF': {'type': 'integer', 'tz': 'UTC', 'units': ''},
  'SEDGBatteryStateOfEnergy': {'type': 'integer', 'tz': 'UTC', 'units': '%'},
  'SEDGDCBatteryPower': {'type': 'integer', 'tz': 'UTC', 'units': 'Watts'},
  'SEDGDCInverterPowerTotal': {'type': 'integer',
                               'tz': 'UTC',
                               'units': 'Watts'},
  'SEDGDCInverterPowerTotal_SF': {'type': 'integer', 'tz': 'UTC', 'units': ''},
  'SEDGRemote_Control_Charge_Limit': {'type': 'integer',
                                      'tz': 'UTC',
                                      'units': 'Watts'},
  'SEDGRemote_Control_Command_Discharge_Limit': {'type': 'integer',
                                                 'tz': 'UTC',
                                                 'units': 'Watts'},
  'SEDGRemote_Control_Command_Mode': {'type': 'integer',
                                      'tz': 'UTC',
                                      'units': ''},
  'SEDGRemote_Control_Command_Timeout': {'type': 'integer',
                                         'tz': 'UTC',
                                         'units': 'Sec '},
  'SEDGStorage_AC_Charge_Limit': {'type': 'integer',
                                  'tz': 'UTC',
                                  'units': 'KW or % '},
  'SEDGStorage_AC_Charge_Policy': {'type': 'integer', 'tz': 'UTC', 'units': ''},
  'SEDGStorage_Backup_Reserved_Setting': {'type': 'integer',
                                          'tz': 'UTC',
                                          'units': '% '},
  'SEDGStorage_Charge-Discharge_Default_Mode': {'type': 'integer',
                                                'tz': 'UTC',
                                                'units': ''},
  'SEDGStorage_Control_Mode': {'type': 'integer', 'tz': 'UTC', 'units': ''},
  'SEDGWrite_Remote_Control_Charge_Limit': {'type': 'integer',
                                            'tz': 'UTC',
                                            'units': 'Watts'},
  'SEDGWrite_Remote_Control_Command_Discharge_Limit': {'type': 'integer',
                                                       'tz': 'UTC',
                                                       'units': 'Watts'},
  'SEDGWrite_Remote_Control_Command_Mode': {'type': 'integer',
                                            'tz': 'UTC',
                                            'units': ''},
  'SEDGWrite_Remote_Control_Command_Timeout': {'type': 'integer',
                                               'tz': 'UTC',
                                               'units': 'Sec'},
  'SEDGWrite_Storage_AC_Charge_Limit': {'type': 'integer',
                                        'tz': 'UTC',
                                        'units': 'KW or % '},
  'SEDGWrite_Storage_AC_Charge_Policy': {'type': 'integer',
                                         'tz': 'UTC',
                                         'units': ''},
  'SEDGWrite_Storage_Backup_Reserved_Setting': {'type': 'integer',
                                                'tz': 'UTC',
                                                'units': '% '},
  'SEDGWrite_Storage_Charge-Discharge_Default_Mode': {'type': 'integer',
                                                      'tz': 'UTC',
                                                      'units': ''},
  'SEDGWrite_Storage_Control_Mode': {'type': 'integer',
                                     'tz': 'UTC',
                                     'units': ''}}]

Here's the output of vctl config list platform.driver:

(volttron) pi@raspberrypi:~/volttron $ vctl config list platform.driver
config
devices/STAC/SEDG_BESS
registry_configs/SEDG_tk
registry_configs/SEDG_tk_map

Any idea what might be happening here? I've tried shutting Volttron down and restarting , but it has not seemed to help.

Thanks!


Solution

  • Changing the device path from
    'devices/STAC/SEDG_BESS'
    to
    'STAC/SEDG_BESS'
    did the trick!

    This is a bit confusing as I was referencing this documentation for get_point which shows the "devices/" prefix on the path parameter:
    enter image description here