diff --git a/pysystemmgr/system_manager.py b/pysystemmgr/system_manager.py
index cd13f7b..d9761b5 100644
--- a/pysystemmgr/system_manager.py
+++ b/pysystemmgr/system_manager.py
@@ -12,11 +12,12 @@
 from obmc.dbuslib.bindings import DbusProperties, DbusObjectManager, get_dbus
 import obmc.enums
 import obmc_system_config as System
+import obmc.inventory
 import obmc.system
 
 DBUS_NAME = 'org.openbmc.managers.System'
 OBJ_NAME = '/org/openbmc/managers/System'
-
+INTF_SENSOR = 'org.openbmc.SensorValue'
 
 class SystemManager(DbusProperties, DbusObjectManager):
     def __init__(self, bus, obj_name):
@@ -25,8 +26,39 @@
             object_path=obj_name)
         self.bus = bus
 
+        # replace symbolic path in ID_LOOKUP
+        for category in System.ID_LOOKUP:
+            for key in System.ID_LOOKUP[category]:
+                val = System.ID_LOOKUP[category][key]
+                new_val = val.replace(
+                    "<inventory_root>", obmc.inventory.INVENTORY_ROOT)
+                System.ID_LOOKUP[category][key] = new_val
+
         print("SystemManager Init Done")
 
+    def doObjectLookup(self, category, key):
+        obj_path = ""
+        intf_name = INTF_SENSOR
+        try:
+            obj_path = System.ID_LOOKUP[category][key]
+            parts = obj_path.split('/')
+            if (parts[3] != 'sensors'):
+                print ("ERROR SystemManager: SENSOR only supported type")
+                intf_name = ""
+        except Exception as e:
+            print ("ERROR SystemManager: "+str(e)+" not found in lookup")
+
+        return [obj_path, intf_name]
+
+    @dbus.service.method(DBUS_NAME, in_signature='ss', out_signature='(ss)')
+    def getObjectFromId(self, category, key):
+        return self.doObjectLookup(category, key)
+
+    @dbus.service.method(DBUS_NAME, in_signature='sy', out_signature='(ss)')
+    def getObjectFromByteId(self, category, key):
+        byte = int(key)
+        return self.doObjectLookup(category, byte)
+
     @dbus.service.method(DBUS_NAME, in_signature='s', out_signature='sis')
     def gpioInit(self, name):
         gpio_path = ''
