diff --git a/bin/Openbmc.py b/bin/Openbmc.py
index b370d8b..b87fec8 100755
--- a/bin/Openbmc.py
+++ b/bin/Openbmc.py
@@ -5,17 +5,11 @@
 GPIO_DEV = '/sys/class/gpio'
 BUS = "system"
 
-ENUMS = {
-	'org.openbmc.SensorIntegerThreshold.state' : 
-		['NOT_SET','NORMAL','LOWER_CRITICAL','LOWER_WARNING','UPPER_WARNING','UPPER_CRITICAL'],
-}
-
 def getSystemName():
 	#use filename as system name, strip off path and ext
 	parts = __file__.replace('.pyc','').replace('.py','').split('/')
 	return parts[len(parts)-1]
 
-
 def getDBus():
 	bus = None
 	if (BUS == "session"):
@@ -24,18 +18,11 @@
 		bus = dbus.SystemBus()
 	return bus
 
-
-def getManagerInterface(bus,manager):
-	bus_name = "org.openbmc.managers."+manager
-	obj_name = "/org/openbmc/managers/"+manager
-	obj = bus.get_object(bus_name,obj_name)
-	return dbus.Interface(obj,bus_name)
-
-
 class DbusProperties(dbus.service.Object):
 	def __init__(self):
 		dbus.service.Object.__init__(self)
 		self.properties = {}
+		self.object_path = ""
 
 	@dbus.service.method(dbus.PROPERTIES_IFACE,
 		in_signature='ss', out_signature='v')
@@ -94,17 +81,66 @@
 		if (value_changed == True):
 			self.PropertiesChanged(interface_name, prop_dict, [])
 	
-
 	@dbus.service.signal(dbus.PROPERTIES_IFACE,
 		signature='sa{sv}as')
 	def PropertiesChanged(self, interface_name, changed_properties,
 		invalidated_properties):
 		pass
 
+class DbusObjectManager(dbus.service.Object):
+	def __init__(self):
+		dbus.service.Object.__init__(self)
+		self.objects = {}
+
+	def add(self,object_path,obj):
+		self.objects[object_path] = obj
+		self.InterfacesAdded(object_path,obj.properties)
+
+	def remove(self,object_path):
+		obj = self.objects.pop(object_path,None)
+		obj.remove_from_connection()
+		self.InterfacesRemoved(object_path,obj.properties.keys())
+
+	def get(self,object_path):
+		return self.objects[object_path]
+
+	@dbus.service.method("org.freedesktop.DBus.ObjectManager",
+		in_signature='', out_signature='a{oa{sa{sv}}}')
+	def GetManagedObjects(self):
+		data = {}
+		for objpath in self.objects.keys():
+			data[objpath] = self.objects[objpath].properties
+		return data
+
+	@dbus.service.signal("org.freedesktop.DBus.ObjectManager",
+		signature='oa{sa{sv}}')
+	def InterfacesAdded(self,object_path,properties):
+		self.ObjectAdded(object_path,"")
+
+	@dbus.service.signal("org.freedesktop.DBus.ObjectManager",
+		signature='oas')
+	def InterfacesRemoved(self,object_path,interfaces):
+		pass
+
+	## Legacy support, need to eventually refactor out
 	@dbus.service.signal("org.openbmc.Object.ObjectMapper",
 		signature='ss')
 	def ObjectAdded(self,object_path,interface_name):
 		pass
 
+	## flattens interfaces
+	@dbus.service.method('org.openbmc.Object.Enumerate',
+		in_signature='', out_signature='a{sa{sv}}')
+	def enumerate(self):
+		data = {}
+		for objpath in self.objects.keys():
+			props = self.objects[objpath].properties
+			data[objpath] = { }
+			for iface in props.keys():
+				data[objpath].update(props[iface])
+				
+		return data
+		
+
 
 
diff --git a/bin/Sensors.py b/bin/Sensors.py
new file mode 100755
index 0000000..e2b79ac
--- /dev/null
+++ b/bin/Sensors.py
@@ -0,0 +1,202 @@
+#!/usr/bin/python -u
+
+import sys
+#from gi.repository import GObject
+import gobject
+import dbus
+import dbus.service
+import dbus.mainloop.glib
+import os
+import Openbmc
+
+## Abstract class, must subclass
+class SensorValue(Openbmc.DbusProperties):
+	IFACE_NAME = 'org.openbmc.SensorValue'
+	def __init__(self,bus,name):
+		#Openbmc.DbusProperties.__init__(self)
+		self.Set(SensorValue.IFACE_NAME,'units',"")
+		self.Set(SensorValue.IFACE_NAME,'error',False)
+		
+	@dbus.service.method(IFACE_NAME,
+		in_signature='v', out_signature='')
+	def setValue(self,value):
+		self.Set(SensorValue.IFACE_NAME,'value',value)
+
+	@dbus.service.method(IFACE_NAME,
+		in_signature='', out_signature='v')
+	def getValue(self):
+		return self.Get(SensorValue.IFACE_NAME,'value')
+
+class SensorThresholds(Openbmc.DbusProperties):
+	IFACE_NAME = 'org.openbmc.SensorThresholds'
+	def __init__(self,bus,name):
+		self.Set(SensorThresholds.IFACE_NAME,'thresholds_enabled',False)
+		self.Set(SensorThresholds.IFACE_NAME,'warning_upper',0)
+		self.Set(SensorThresholds.IFACE_NAME,'warning_lower',0)
+		self.Set(SensorThresholds.IFACE_NAME,'critical_upper',0)
+		self.Set(SensorThresholds.IFACE_NAME,'critical_lower',0)
+		self.Set(SensorThresholds.IFACE_NAME,'critical_lower',0)
+		self.Set(SensorThresholds.IFACE_NAME,'threshold_state',"NORMAL")
+		self.Set(SensorThresholds.IFACE_NAME,'worst_threshold_state',"NORMAL")
+	
+	@dbus.service.method(IFACE_NAME,
+		in_signature='', out_signature='')
+	def resetThresholdState(self):
+		self.Set(SensorThresholds.IFACE_NAME,'worst_threshold_state',"NORMAL")
+
+	def check_thresholds(self,value):
+		iface = SensorThresholds.IFACE_NAME
+		if (self.Get(iface,'thresholds_enabled') == False):
+			return False
+		rtn = False
+		current_state = "NORMAL"
+		if (value >= self.properties[iface]['critical_upper']):
+			current_state = "CRITICAL"
+			rtn = True	
+		elif (value <= self.properties[iface]['critical_lower']):
+			current_state = "CRITICAL"	
+			rtn = True	
+		elif (value >= self.properties[iface]['warning_upper']):
+			current_state = "WARNING"	
+			rtn = True	
+		elif (value <= self.properties[iface]['warning_lower']):
+			current_state = "WARNING"	
+			rtn = True
+		self.Set(iface,'threshold_state',current_state)
+		worst = self.properties[iface]['worst_threshold_state']
+		if (current_state == "CRITICAL" or 
+		   (current_state == "WARNING" and worst != "CRITICAL")):
+			self.Set(iface,'worst_threshold_state',current_state)
+
+		return rtn
+
+class VirtualSensor(SensorValue):
+	def __init__(self,bus,name):
+		Openbmc.DbusProperties.__init__(self)
+		SensorValue.__init__(self,bus,name)
+		dbus.service.Object.__init__(self,bus,name)
+
+class HwmonSensor(SensorValue,SensorThresholds):
+	IFACE_NAME = 'org.openbmc.HwmonSensor'
+	def __init__(self,bus,name):
+		Openbmc.DbusProperties.__init__(self)
+		SensorValue.__init__(self,bus,name)
+		SensorThresholds.__init__(self,bus,name)
+		self.Set(HwmonSensor.IFACE_NAME,'scale',1)
+		self.Set(HwmonSensor.IFACE_NAME,'offset',0)
+		self.Set(HwmonSensor.IFACE_NAME,'filename','')
+		self.value_dirty = False
+
+		# need to cache value to know if changed
+		self.value = None
+		dbus.service.Object.__init__(self,bus,name)
+
+	@dbus.service.method(SensorValue.IFACE_NAME,
+		in_signature='v', out_signature='')
+	def setValue(self,value):
+		self.value_dirty = True
+		SensorValue.setValue(self,value)
+
+	## Called by sensor process to update value from polling
+	## if returns not None, then sensor process will update hwmon value
+	@dbus.service.method(IFACE_NAME,
+		in_signature='v', out_signature='(bv)')
+	def setByPoll(self,value):
+		scale = self.properties[HwmonSensor.IFACE_NAME]['scale']
+		offset = self.properties[HwmonSensor.IFACE_NAME]['offset']
+		if (self.value_dirty == True):
+			## new value externally set, so just return to hwmon
+			## process to write value
+			self.value_dirty = False
+			val = (self.properties[SensorValue.IFACE_NAME]['value']-offset) * scale
+			return [True,val]
+		else:
+			val = (value/scale) + offset
+			if (val != self.value):
+				SensorValue.setValue(self,val)
+				self.check_thresholds(val)
+				self.value = val
+
+			return [False,0]
+		
+CONTROL_IFACE = 'org.openbmc.Control'
+class HostStatusSensor(VirtualSensor):
+	def __init__(self,bus,name):
+		VirtualSensor.__init__(self,bus,name)
+		self.setValue("Off")
+
+	##override setValue method
+	@dbus.service.method(SensorValue.IFACE_NAME,
+		in_signature='v', out_signature='')
+	def setValue(self,value):
+		SensorValue.setValue(self,value)
+			
+	@dbus.service.signal(CONTROL_IFACE,signature='s')
+	def GotoSystemState(self,state):
+		pass
+		
+class BootProgressSensor(VirtualSensor):
+	def __init__(self,bus,name):
+		VirtualSensor.__init__(self,bus,name)
+		self.setValue("Off")
+		bus.add_signal_receiver(self.SystemStateHandler,signal_name = "GotoSystemState")
+
+	def SystemStateHandler(self,state):
+		if (state == "HOST_POWERED_OFF"):
+			self.setValue("Off")
+
+
+	##override setValue method
+	@dbus.service.method(SensorValue.IFACE_NAME,
+		in_signature='v', out_signature='')
+	def setValue(self,value):
+		SensorValue.setValue(self,value)
+		if (value == "FW Progress, Starting OS"):
+			self.GotoSystemState("HOST_BOOTED")
+			
+	@dbus.service.signal(CONTROL_IFACE,signature='s')
+	def GotoSystemState(self,state):
+		pass
+		
+class OccStatusSensor(VirtualSensor):
+	def __init__(self,bus,name):
+		VirtualSensor.__init__(self,bus,name)
+		self.setValue("Disabled")
+		bus.add_signal_receiver(self.SystemStateHandler,signal_name = "GotoSystemState")
+
+	def SystemStateHandler(self,state):
+		if (state == "HOST_POWERED_OFF"):
+			self.setValue("Disabled")
+			
+
+	##override setValue method
+	@dbus.service.method(SensorValue.IFACE_NAME,
+		in_signature='v', out_signature='')
+	def setValue(self,value):
+		if (value == "Enabled"):
+			print "Installing OCC device"
+			os.system("echo occ-i2c 0x50 >  /sys/bus/i2c/devices/i2c-3/new_device")
+			os.system("echo occ-i2c 0x51 >  /sys/bus/i2c/devices/i2c-3/new_device")
+		else:
+			print "Deleting OCC device"
+			os.system("echo 0x50 >  /sys/bus/i2c/devices/i2c-3/delete_device")
+			os.system("echo 0x51 >  /sys/bus/i2c/devices/i2c-3/delete_device")
+
+
+		SensorValue.setValue(self,value)
+			
+	@dbus.service.signal(CONTROL_IFACE,signature='s')
+	def GotoSystemState(self,state):
+		pass
+	
+class BootCountSensor(VirtualSensor):
+	def __init__(self,bus,name):
+		VirtualSensor.__init__(self,bus,name)
+		self.setValue(0)
+
+class OperatingSystemStatusSensor(VirtualSensor):
+	def __init__(self,bus,name):
+		VirtualSensor.__init__(self,bus,name)
+		self.setValue("Off")
+	
+
diff --git a/bin/chassis_control.py b/bin/chassis_control.py
index 6a3b9f5..aa656fd 100755
--- a/bin/chassis_control.py
+++ b/bin/chassis_control.py
@@ -18,10 +18,11 @@
 
 BOOTED = 100
 
-class ChassisControlObject(Openbmc.DbusProperties):
+class ChassisControlObject(Openbmc.DbusProperties,Openbmc.DbusObjectManager):
 	def __init__(self,bus,name):
 		self.dbus_objects = { }
 		Openbmc.DbusProperties.__init__(self)
+		Openbmc.DbusObjectManager.__init__(self)
 		dbus.service.Object.__init__(self,bus,name)
 		## load utilized objects
 		self.dbus_objects = {
@@ -51,7 +52,7 @@
 		self.Set(DBUS_NAME,"uuid",str(uuid.uuid1()))
 		self.Set(DBUS_NAME,"reboot",0)
 		self.Set(DBUS_NAME,"power_policy",0)	
-		self.Set(DBUS_NAME,"last_system_state","")	
+		self.Set(DBUS_NAME,"last_system_state","")
 
 		bus.add_signal_receiver(self.power_button_signal_handler, 
 					dbus_interface = "org.openbmc.Button", signal_name = "Released", 
@@ -63,7 +64,7 @@
     		bus.add_signal_receiver(self.host_watchdog_signal_handler, 
 					dbus_interface = "org.openbmc.Watchdog", signal_name = "WatchdogError")
 		bus.add_signal_receiver(self.SystemStateHandler,signal_name = "GotoSystemState")
-		self.ObjectAdded(name,CONTROL_INTF)
+		self.InterfacesAdded(name,self.properties)
 
 
 	def getInterface(self,name):
diff --git a/bin/fan_control.py b/bin/fan_control.py
index 7a75d62..1a528fd 100755
--- a/bin/fan_control.py
+++ b/bin/fan_control.py
@@ -12,7 +12,7 @@
 OBJ_PATH = '/org/openbmc/control/fans'
 IFACE_NAME = 'org.openbmc.control.Fans'
 
-FAN_BUS = 'org.openbmc.sensors.hwmon'
+FAN_BUS = 'org.openbmc.Sensors'
 FAN_OBJS = [
 	'/org/openbmc/sensors/speed/fan0',
 	'/org/openbmc/sensors/speed/fan1',
@@ -23,11 +23,11 @@
 ]
 FAN_IFACE = 'org.openbmc.SensorValue'
 
-class FanControl(Openbmc.DbusProperties):
+class FanControl(Openbmc.DbusProperties,Openbmc.DbusObjectManager):
 	def __init__(self,bus,name):
 		Openbmc.DbusProperties.__init__(self)
+		Openbmc.DbusObjectManager.__init__(self)
 		dbus.service.Object.__init__(self,bus,name)
-		self.ObjectAdded(name,IFACE_NAME)
 		self.Set(IFACE_NAME,"floor",250)
 		self.Set(IFACE_NAME,"ceiling",255)
 		self.fan_intf = []
@@ -36,6 +36,7 @@
 			print "Initializing fan: "+fan
 			obj = bus.get_object(FAN_BUS,fan)
 			self.fan_intf.append(dbus.Interface(obj,FAN_IFACE))
+		self.InterfacesAdded(name,self.properties)
 			
 	@dbus.service.method(DBUS_NAME,
 		in_signature='', out_signature='')
diff --git a/bin/hwmon.py b/bin/hwmon.py
new file mode 100755
index 0000000..513c760
--- /dev/null
+++ b/bin/hwmon.py
@@ -0,0 +1,153 @@
+#!/usr/bin/python -u
+
+import sys
+import os
+import gobject
+import dbus
+import dbus.service
+import dbus.mainloop.glib
+import Openbmc
+from Sensors import SensorValue as SensorValue
+from Sensors import HwmonSensor as HwmonSensor
+from Sensors import SensorThresholds as SensorThresholds
+if (len(sys.argv) < 2):
+	print "Usage:  sensors_hwmon.py [system name]"
+	exit(1)
+
+System = __import__(sys.argv[1])
+
+SENSOR_BUS = 'org.openbmc.Sensors'
+SENSOR_PATH = '/org/openbmc/sensors'
+DIR_POLL_INTERVAL = 10000
+HWMON_PATH = '/sys/class/hwmon'
+
+## static define which interface each property is under
+## need a better way that is not slow
+IFACE_LOOKUP = {
+	'units' : SensorValue.IFACE_NAME,
+	'scale' : HwmonSensor.IFACE_NAME,
+	'offset' : HwmonSensor.IFACE_NAME,
+	'critical_upper' : SensorThresholds.IFACE_NAME,
+	'warning_upper' : SensorThresholds.IFACE_NAME,
+	'critical_lower' : SensorThresholds.IFACE_NAME,
+	'warning_lower' : SensorThresholds.IFACE_NAME,
+}
+
+class Hwmons():
+	def __init__(self,bus):
+		self.sensors = { }
+		self.hwmon_root = { }
+		self.scanDirectory()
+		gobject.timeout_add(DIR_POLL_INTERVAL, self.scanDirectory)   
+
+	def readAttribute(self,filename):
+		val = ""
+		with open(filename, 'r') as f:
+			for line in f:
+				val = line.rstrip('\n')
+		return val
+
+	def writeAttribute(self,filename,value):
+		with open(filename, 'w') as f:
+			f.write(str(value)+'\n')
+
+
+	def poll(self,objpath,attribute):
+		try:
+			raw_value = int(self.readAttribute(attribute))
+			obj = bus.get_object(SENSOR_BUS,objpath)
+			intf = dbus.Interface(obj,HwmonSensor.IFACE_NAME)
+			rtn = intf.setByPoll(raw_value)
+			if (rtn[0] == True):
+				self.writeAttribute(attribute,rtn[1])
+		except:
+			print "HWMON: Attibute no longer exists: "+attribute
+			return False
+
+
+		return True
+
+
+	def addObject(self,dpath,instance_name,attribute):
+		hwmon = System.HWMON_CONFIG[instance_name][attribute]
+		objsuf = hwmon['object_path']
+		try:
+			if (objsuf.find('<label>') > -1):
+				label_file = attribute.replace('_input','_label')
+				label = self.readAttribute(dpath+label_file)
+				objsuf = objsuf.replace('<label>',label)
+		except Exception as e:
+			print e
+			return
+
+		objpath = SENSOR_PATH+'/'+objsuf
+		spath = dpath+attribute
+		if (self.sensors.has_key(objpath) == False):
+			if os.path.isfile(spath):
+				print "HWMON add: "+objpath+" : "+spath
+				obj = bus.get_object(SENSOR_BUS,SENSOR_PATH)
+				intf = dbus.Interface(obj,SENSOR_BUS)
+				intf.register("HwmonSensor",objpath)
+			
+				obj = bus.get_object(SENSOR_BUS,objpath)
+				intf = dbus.Interface(obj,dbus.PROPERTIES_IFACE)
+				intf.Set(HwmonSensor.IFACE_NAME,'filename',spath)
+				
+				## check if one of thresholds is defined to know
+				## whether to enable thresholds or not
+				if (hwmon.has_key('critical_upper')):
+					intf.Set(SensorThresholds.IFACE_NAME,'thresholds_enabled',True)
+
+				for prop in hwmon.keys():
+					if (IFACE_LOOKUP.has_key(prop)):
+						intf.Set(IFACE_LOOKUP[prop],prop,hwmon[prop])
+						print "Setting: "+prop+" = "+str(hwmon[prop])
+
+				self.sensors[objpath]=True
+				self.hwmon_root[dpath].append(objpath)
+				gobject.timeout_add(hwmon['poll_interval'],self.poll,objpath,spath)
+	
+	def scanDirectory(self):
+	 	devices = os.listdir(HWMON_PATH)
+		found_hwmon = {}
+		for d in devices:
+			dpath = HWMON_PATH+'/'+d+'/'
+			found_hwmon[dpath] = True
+			if (self.hwmon_root.has_key(dpath) == False):
+				self.hwmon_root[dpath] = []
+			## the instance name is a soft link
+			instance_name = os.path.realpath(dpath+'device').split('/').pop()
+			if (System.HWMON_CONFIG.has_key(instance_name)):
+	 			for attribute in System.HWMON_CONFIG[instance_name].keys():
+					self.addObject(dpath,instance_name,attribute)
+			else:
+				print "WARNING: Unhandled hwmon: "+dpath
+	
+
+		for k in self.hwmon_root.keys():
+			if (found_hwmon.has_key(k) == False):
+				## need to remove all objects associated with this path
+				print "Removing: "+k
+				for objpath in self.hwmon_root[k]:
+					if (self.sensors.has_key(objpath) == True):
+						print "HWMON remove: "+objpath
+						self.sensors.pop(objpath,None)
+						obj = bus.get_object(SENSOR_BUS,SENSOR_PATH)
+						intf = dbus.Interface(obj,SENSOR_BUS)
+						intf.delete(objpath)
+
+				self.hwmon_root.pop(k,None)
+				
+		return True
+
+			
+if __name__ == '__main__':
+	
+	dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
+	bus = Openbmc.getDBus()
+	root_sensor = Hwmons(bus)
+	mainloop = gobject.MainLoop()
+
+	print "Starting HWMON sensors"
+	mainloop.run()
+
diff --git a/bin/inventory_items.py b/bin/inventory_items.py
index 865a717..6320f90 100755
--- a/bin/inventory_items.py
+++ b/bin/inventory_items.py
@@ -18,28 +18,15 @@
 
 
 INTF_NAME = 'org.openbmc.InventoryItem'
-DBUS_NAME = 'org.openbmc.managers.Inventory'
-ENUM_INTF = 'org.openbmc.Object.Enumerate'
-
+DBUS_NAME = 'org.openbmc.Inventory'
 FRUS = System.FRU_INSTANCES
 
-class Inventory(Openbmc.DbusProperties):
+class Inventory(Openbmc.DbusProperties,Openbmc.DbusObjectManager):
 	def __init__(self,bus,name):
+		Openbmc.DbusProperties.__init__(self)
+		Openbmc.DbusObjectManager.__init__(self)
 		dbus.service.Object.__init__(self,bus,name)
-		self.objects = [ ]
-		self.ObjectAdded(name,ENUM_INTF)		
-
-	def addItem(self,item):
-		self.objects.append(item)
-
-	@dbus.service.method(ENUM_INTF,
-		in_signature='', out_signature='a{sa{sv}}')
-	def enumerate(self):
-		tmp_obj = {}
-		for item in self.objects:
-			tmp_obj[str(item.name)]=item.GetAll(INTF_NAME)
-		return tmp_obj
-			
+		self.InterfacesAdded(name,self.properties)
 
 
 class InventoryItem(Openbmc.DbusProperties):
@@ -59,7 +46,6 @@
 			data['version'] = ''
 
 		self.SetMultiple(INTF_NAME,data)
-		self.ObjectAdded(name,INTF_NAME)		
 		
 		
 	@dbus.service.method(INTF_NAME,
@@ -98,10 +84,9 @@
     obj_parent = Inventory(bus, '/org/openbmc/inventory')
 
     for f in FRUS.keys():
-	print f
 	obj_path=f.replace("<inventory_root>",System.INVENTORY_ROOT)
     	obj = InventoryItem(bus,obj_path,FRUS[f])
-	obj_parent.addItem(obj)
+	obj_parent.add(obj_path,obj)
 
     	## TODO:  this is a hack to update bmc inventory item with version
     	## should be done by flash object
diff --git a/bin/obmcutil b/bin/obmcutil
index 0dd18df..e63fa27 100755
--- a/bin/obmcutil
+++ b/bin/obmcutil
@@ -89,8 +89,8 @@
 		'method' : 'getSystemState',
 	},
 	'bootprogress' : { 
-		'bus_name' : 'org.openbmc.sensor.Power8Virtual',
-		'object_name' : '/org/openbmc/sensor/virtual/BootProgress',
+		'bus_name' : 'org.openbmc.Sensors',
+		'object_name' : '/org/openbmc/sensors/host/BootProgress',
 		'interface_name' : 'org.openbmc.SensorValue'
 	},
 	'biosupdate' : {
@@ -116,13 +116,13 @@
 		'interface_name' : 'org.openbmc.Flash',
 	},
 	'getinventory' : {
-		'bus_name' : 'org.openbmc.managers.Inventory',
+		'bus_name' : 'org.openbmc.Inventory',
 		'object_name' : '/org/openbmc/inventory',
 		'interface_name' : 'org.openbmc.Object.Enumerate',
 		'method' : 'enumerate'
 	},
 	'getsensors' : {
-		'bus_name' : 'org.openbmc.managers.Sensors',
+		'bus_name' : 'org.openbmc.Sensors',
 		'object_name' : '/org/openbmc/sensors',
 		'interface_name' : 'org.openbmc.Object.Enumerate',
 		'method' : 'enumerate'
@@ -143,7 +143,7 @@
 bus = dbus.SystemBus()
 
 
-if (len(sys.argv) == 1 or sys.argv[1] == "-h"):
+if (len(sys.argv) == 1 or sys.argv[1] == "-h" or dbus_objects.has_key(sys.argv[1])==False):
 	print "Usage: obmcutil [command] [[method] [*args]]"
 	print "\tIf [method] is blank, then all properties are printed\n"
 	print "Available commands:"
diff --git a/bin/sensor_manager.py b/bin/sensor_manager.py
deleted file mode 100755
index f1af961..0000000
--- a/bin/sensor_manager.py
+++ /dev/null
@@ -1,101 +0,0 @@
-#!/usr/bin/python -u
-
-import sys
-#from gi.repository import GObject
-import gobject
-import dbus
-import dbus.service
-import dbus.mainloop.glib
-
-if (len(sys.argv) < 2):
-	print "Usage:  sensor_manager.py [system name]"
-	exit(1)
-System = __import__(sys.argv[1])
-import Openbmc
-
-DBUS_NAME = 'org.openbmc.managers.Sensors'
-OBJ_NAME = '/org/openbmc/sensors'
-ENUM_INTF = 'org.openbmc.Object.Enumerate'
-
-class SensorManager(Openbmc.DbusProperties):
-	def __init__(self,bus,name):
-		dbus.service.Object.__init__(self,bus,name)
-		bus.add_signal_receiver(self.SensorChangedHandler,
-					dbus_interface = 'org.openbmc.SensorValue', 
-					signal_name = 'Changed', path_keyword='path')
-		bus.add_signal_receiver(self.SensorErrorHandler,
-					dbus_interface = 'org.openbmc.SensorValue', 
-					signal_name = 'Error', path_keyword='path')
-		bus.add_signal_receiver(self.NormalThreshold,
-					dbus_interface = 'org.openbmc.SensorThreshold', 
-					signal_name = 'Normal', path_keyword='path')
-		bus.add_signal_receiver(self.WarningThreshold,
-					dbus_interface = 'org.openbmc.SensorThreshold', 
-					signal_name = 'Warning', path_keyword='path')
-		bus.add_signal_receiver(self.CriticalThreshold,
-					dbus_interface = 'org.openbmc.SensorThreshold', 
-					signal_name = 'Critical', path_keyword='path')
-
-		self.sensor_cache = {}
-		self.ObjectAdded(name,DBUS_NAME);
-		self.ObjectAdded(name,ENUM_INTF);
-
-	@dbus.service.method(ENUM_INTF,
-		in_signature='', out_signature='a{sa{sv}}')
-	def enumerate(self):
-		return self.sensor_cache;
-	
-	
-	@dbus.service.method(DBUS_NAME,
-		in_signature='s', out_signature='v')
-	def getSensor(self,path):
-		val = 0
-		if (self.sensor_cache.has_key(path) == True):
-			val = self.sensor_cache[path]['value']
-		else:
-			print "ERROR: Unknown sensor: "+path
-		return val
-	
-	## Signal handlers
-	def SensorErrorHandler(self,path = None):
-		self.initSensorEntry(path)
-		self.sensor_cache[path]['error'] = True
-
-	def SensorChangedHandler(self,value,units,path = None):
-		self.initSensorEntry(path)
-		self.sensor_cache[path]['value'] = value
-		self.sensor_cache[path]['units'] = units
-
-	@dbus.service.signal(DBUS_NAME)
-	def CriticalThreshold(self, path = None):
-		print "Critical: "+path
-		self.initSensorEntry(path)
-		self.sensor_cache[path]['threshold'] = "CRITICAL"
-
-	@dbus.service.signal(DBUS_NAME)
-	def WarningThreshold(self, path = None):
-		print "Warning:"+path
-		self.initSensorEntry(path)
-		self.sensor_cache[path]['threshold'] = "WARNING"
-
-	@dbus.service.signal(DBUS_NAME)
-	def NormalThreshold(self, path = None):
-		print "Normal: "+path
-		self.initSensorEntry(path)
-		self.sensor_cache[path]['threshold'] = "NORMAL"
-
-	def initSensorEntry(self,path):
-		if (self.sensor_cache.has_key(path) == False):
-			self.sensor_cache[path] = {}
-
-				
-if __name__ == '__main__':
-    dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
-    bus = Openbmc.getDBus()
-    name = dbus.service.BusName(DBUS_NAME,bus)
-    obj = SensorManager(bus,OBJ_NAME)
-    mainloop = gobject.MainLoop()
-
-    print "Running Sensor Manager"
-    mainloop.run()
-
diff --git a/bin/sensor_manager2.py b/bin/sensor_manager2.py
new file mode 100755
index 0000000..5e044f0
--- /dev/null
+++ b/bin/sensor_manager2.py
@@ -0,0 +1,69 @@
+#!/usr/bin/python -u
+
+import sys
+import os
+import gobject
+import dbus
+import dbus.service
+import dbus.mainloop.glib
+import Openbmc
+import Sensors
+
+DBUS_NAME = 'org.openbmc.Sensors'
+OBJ_PATH = '/org/openbmc/sensors'
+
+
+class SensorManager(Openbmc.DbusProperties,Openbmc.DbusObjectManager):
+	def __init__(self,bus,name):
+		Openbmc.DbusProperties.__init__(self)
+		Openbmc.DbusObjectManager.__init__(self)
+		dbus.service.Object.__init__(self,bus,name)
+		self.InterfacesAdded(name,self.properties)
+
+	@dbus.service.method(DBUS_NAME,
+		in_signature='ss', out_signature='')
+	def register(self,object_name,obj_path):
+		if (self.objects.has_key(obj_path) == False):
+			print "Register: "+object_name+" : "+obj_path
+			sensor = eval('Sensors.'+object_name+'(bus,obj_path)')
+			self.add(obj_path,sensor)
+
+	@dbus.service.method(DBUS_NAME,
+		in_signature='s', out_signature='')
+	def delete(self,obj_path):
+		if (self.objects.has_key(obj_path) == True):
+			print "Delete: "+obj_path
+			self.remove(obj_path)
+	
+	def SensorChange(self,value,path=None):
+		if (self.objects.has_key(path)):
+			self.objects[path].setValue(value)
+		else:
+			print "ERROR: Sensor not found: "+path
+			
+if __name__ == '__main__':
+	dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
+	bus = Openbmc.getDBus()
+	name = dbus.service.BusName(DBUS_NAME,bus)
+	root_sensor = SensorManager(bus,OBJ_PATH)
+
+
+	## instantiate non-polling sensors
+	## these don't need to be in seperate process
+	## TODO: this should not be hardcoded
+
+	obj_path = OBJ_PATH+"/host/HostStatus"
+	root_sensor.add(obj_path,Sensors.HostStatusSensor(bus,obj_path))
+	obj_path = OBJ_PATH+"/host/BootProgress"
+	root_sensor.add(obj_path,Sensors.BootProgressSensor(bus,obj_path))
+	obj_path = OBJ_PATH+"/host/OccStatus"
+	root_sensor.add(obj_path,Sensors.OccStatusSensor(bus,obj_path))
+	obj_path = OBJ_PATH+"/host/BootCount"
+	root_sensor.add(obj_path,Sensors.BootCountSensor(bus,obj_path))
+	obj_path = OBJ_PATH+"/host/OperatingSystemStatus"
+	root_sensor.add(obj_path,Sensors.OperatingSystemStatusSensor(bus,obj_path))
+
+	mainloop = gobject.MainLoop()
+	print "Starting sensor manager"
+	mainloop.run()
+
diff --git a/bin/sensors_hwmon.py b/bin/sensors_hwmon.py
deleted file mode 100755
index 3574b60..0000000
--- a/bin/sensors_hwmon.py
+++ /dev/null
@@ -1,196 +0,0 @@
-#!/usr/bin/python -u
-
-import sys
-import os
-import gobject
-import dbus
-import dbus.service
-import dbus.mainloop.glib
-import Openbmc
-if (len(sys.argv) < 2):
-	print "Usage:  sensors_hwmon.py [system name]"
-	exit(1)
-
-System = __import__(sys.argv[1])
-
-DBUS_NAME = 'org.openbmc.sensors.hwmon'
-OBJ_PATH = '/org/openbmc/sensors'
-DIR_POLL_INTERVAL = 10000
-HWMON_PATH = '/sys/class/hwmon'
-
-class SensorValue(Openbmc.DbusProperties):
-	IFACE_NAME = 'org.openbmc.SensorValue'
-	def __init__(self,bus,name):
-		Openbmc.DbusProperties.__init__(self)
-		self.Set(SensorValue.IFACE_NAME,'units',"")
-		dbus.service.Object.__init__(self,bus,name)
-		
-	@dbus.service.method(IFACE_NAME,
-		in_signature='v', out_signature='')
-	def setValue(self,value):
-		changed = False
-		try:
-			old_value = self.Get(SensorValue.IFACE_NAME,'value')
-			if (value != old_value):
-				changed = True
-		except:
-			changed = True
-
-		if (changed == True):
-			self.Set(SensorValue.IFACE_NAME,'value',value)
-			self.Changed(self.getValue(),self.getUnits())
-
-
-
-	@dbus.service.method(IFACE_NAME,
-		in_signature='', out_signature='v')
-	def getValue(self):
-		return self.Get(SensorValue.IFACE_NAME,'value')
-
-	@dbus.service.method(IFACE_NAME,
-		in_signature='', out_signature='s')
-	def getUnits(self):
-		return self.Get(SensorValue.IFACE_NAME,'units')
-
-	@dbus.service.signal(IFACE_NAME,signature='vs')
-	def Changed(self,value,units):
-		pass
-
-def readAttribute(filename):
-	val = ""
-	with open(filename, 'r') as f:
-		for line in f:
-			val = line.rstrip('\n')
-	return val
-
-class HwmonSensor(SensorValue):
-	def __init__(self, bus ,name, attribute ,poll_interval ,units, scale):
-		SensorValue.__init__(self,bus,name)
-		self.attribute = attribute
-		self.scale = 1
-		if scale > 0:
-			self.scale = scale
-		
-		self.Set(SensorValue.IFACE_NAME,'units',units)
-		self.pollSensor()
-
-		if (poll_interval > 0):
-			gobject.timeout_add(poll_interval, self.pollSensor)  
-		else:
-			print "ERROR HWMON: poll_interval must be > 0"
-		self.ObjectAdded(name,SensorValue.IFACE_NAME)
-			
-
-	def pollSensor(self):
-		try:
-			with open(self.attribute, 'r') as f:
-				for line in f:
-					val = int(line.rstrip('\n'))/self.scale
-					SensorValue.setValue(self,val)
-		except:
-			print "Attribute no longer exists: "+self.attribute
-			return False
-
-		return True
-
-	@dbus.service.method(SensorValue.IFACE_NAME,
-		in_signature='v', out_signature='')
-	def setValue(self,value):
-		try:
-			with open(self.attribute, 'w') as f:
-				val = int(value*self.scale)
-				f.write(str(val)+'\n')
-				SensorValue.setValue(self,value)
-		except Exception as e:
-			print e
-			print "Unable to write: "+self.attribute
-		
-		SensorValue.setValue(self,value)
-
-
-
-	
-
-class Sensors(Openbmc.DbusProperties):
-	def __init__(self,bus,name):
-		dbus.service.Object.__init__(self,bus,name)
-		self.sensors = { }
-		self.hwmon_root = { }
-		bus.add_signal_receiver(self.OccActiveHandler, 
-					dbus_interface = "org.openbmc.SensorValue", signal_name = "Changed", 
-					path="/org/openbmc/sensor/virtual/OccStatus" )
-
-		gobject.timeout_add(DIR_POLL_INTERVAL, self.scanDirectory)   
-		self.ObjectAdded(name,DBUS_NAME)
-
-	def OccActiveHandler(self,value,units):
-		print  "OCC "+value
-		if (value == "Enabled"):
-			print "Installing OCC device"
-			os.system("echo occ-i2c 0x50 >  /sys/bus/i2c/devices/i2c-3/new_device")
-			os.system("echo occ-i2c 0x51 >  /sys/bus/i2c/devices/i2c-3/new_device")
-		if (value == "Disabled"):
-			print "Deleting OCC device"
-			os.system("echo 0x50 >  /sys/bus/i2c/devices/i2c-3/delete_device")
-			os.system("echo 0x51 >  /sys/bus/i2c/devices/i2c-3/delete_device")
-
-	def addObject(self,dpath,instance_name,attribute):
-		hwmon = System.HWMON_CONFIG[instance_name][attribute]
-		objsuf = hwmon['object_path']
-		if (objsuf.find('<label>') > -1):
-			label_file = attribute.replace('_input','_label')
-			label = readAttribute(dpath+label_file)
-			objsuf = objsuf.replace('<label>',label)
-
-		objpath = OBJ_PATH+'/'+objsuf
-		spath = dpath+attribute
-		if (self.sensors.has_key(objpath) == False):
-			if os.path.isfile(spath):
-				print "HWMON add: "+objpath+" : "+spath
-				self.sensors[objpath]= HwmonSensor(bus,objpath,spath,
-					hwmon['poll_interval'],hwmon['units'],hwmon['scale'])
-				self.hwmon_root[dpath].append(objpath)
-	
-
-	def scanDirectory(self):
-	 	devices = os.listdir(HWMON_PATH)
-		found_hwmon = {}
-		for d in devices:
-			dpath = HWMON_PATH+'/'+d+'/'
-			found_hwmon[dpath] = True
-			if (self.hwmon_root.has_key(dpath) == False):
-				self.hwmon_root[dpath] = []
-			## the instance name is a soft link
-			instance_name = os.path.realpath(dpath+'device').split('/').pop()
-			if (System.HWMON_CONFIG.has_key(instance_name)):
-	 			for attribute in System.HWMON_CONFIG[instance_name].keys():
-					self.addObject(dpath,instance_name,attribute)
-			else:
-				print "WARNING: Unhandled hwmon: "+dpath
-	
-
-		for k in self.hwmon_root.keys():
-			if (found_hwmon.has_key(k) == False):
-				## need to remove all objects associated with this path
-				print "Removing: "+k
-				for objpath in self.hwmon_root[k]:
-					if (self.sensors.has_key(objpath) == True):
-						print "HWMON remove: "+objpath
-						obj = self.sensors.pop(objpath,None)
-						obj.remove_from_connection()
-				self.hwmon_root.pop(k,None)
-				
-		return True
-
-			
-if __name__ == '__main__':
-	
-	dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
-	bus = Openbmc.getDBus()
-	name = dbus.service.BusName(DBUS_NAME,bus)
-	root_sensor = Sensors(bus,OBJ_PATH)
-	mainloop = gobject.MainLoop()
-
-	print "Starting HWMON sensors"
-	mainloop.run()
-
diff --git a/bin/sensors_virtual_p8.py b/bin/sensors_virtual_p8.py
deleted file mode 100755
index adda301..0000000
--- a/bin/sensors_virtual_p8.py
+++ /dev/null
@@ -1,144 +0,0 @@
-#!/usr/bin/python -u
-
-import sys
-#from gi.repository import GObject
-import gobject
-import dbus
-import dbus.service
-import dbus.mainloop.glib
-import Openbmc
-
-DBUS_NAME = 'org.openbmc.sensor.Power8Virtual'
-OBJ_PATH = '/org/openbmc/sensor/virtual/'
-
-class SensorValue(Openbmc.DbusProperties):
-	IFACE_NAME = 'org.openbmc.SensorValue'
-	def __init__(self,bus,name):
-		Openbmc.DbusProperties.__init__(self)
-		self.Set(SensorValue.IFACE_NAME,'units',"")
-		dbus.service.Object.__init__(self,bus,name)
-		self.ObjectAdded(name,SensorValue.IFACE_NAME)
-		
-	@dbus.service.method(IFACE_NAME,
-		in_signature='v', out_signature='')
-	def setValue(self,value):
-		changed = False
-		try:
-			old_value = self.Get(SensorValue.IFACE_NAME,'value')
-			if (value != old_value):
-				changed = True
-		except:
-			changed = True
-
-		if (changed == True):
-			self.Set(SensorValue.IFACE_NAME,'value',value)
-			self.Changed(self.getValue(),self.getUnits())
-
-
-
-	@dbus.service.method(IFACE_NAME,
-		in_signature='', out_signature='v')
-	def getValue(self):
-		return self.Get(SensorValue.IFACE_NAME,'value')
-
-	@dbus.service.method(IFACE_NAME,
-		in_signature='', out_signature='s')
-	def getUnits(self):
-		return self.Get(SensorValue.IFACE_NAME,'units')
-
-	@dbus.service.signal(IFACE_NAME,signature='vs')
-	def Changed(self,value,units):
-		pass
-
-class VirtualSensor(SensorValue):
-	def __init__(self,bus,name):
-		SensorValue.__init__(self,bus,name)
-
-		
-CONTROL_IFACE = 'org.openbmc.Control'
-class HostStatusSensor(VirtualSensor):
-	def __init__(self,bus,name):
-		VirtualSensor.__init__(self,bus,name)
-
-	##override setValue method
-	@dbus.service.method(SensorValue.IFACE_NAME,
-		in_signature='v', out_signature='')
-	def setValue(self,value):
-		SensorValue.setValue(self,value)
-		if (value == "BLAH"):
-			self.GotoSystemState("OS_BOOTED")
-			
-	@dbus.service.signal(CONTROL_IFACE,signature='s')
-	def GotoSystemState(self,state):
-		pass
-		
-class BootProgressSensor(VirtualSensor):
-	def __init__(self,bus,name):
-		VirtualSensor.__init__(self,bus,name)
-		self.setValue("Off")
-		bus.add_signal_receiver(self.SystemStateHandler,signal_name = "GotoSystemState")
-
-	def SystemStateHandler(self,state):
-		if (state == "HOST_POWERED_OFF"):
-			self.setValue("Off")
-
-
-	##override setValue method
-	@dbus.service.method(SensorValue.IFACE_NAME,
-		in_signature='v', out_signature='')
-	def setValue(self,value):
-		SensorValue.setValue(self,value)
-		if (value == "FW Progress, Starting OS"):
-			self.GotoSystemState("HOST_BOOTED")
-			
-	@dbus.service.signal(CONTROL_IFACE,signature='s')
-	def GotoSystemState(self,state):
-		pass
-		
-class OccActiveSensor(VirtualSensor):
-	def __init__(self,bus,name):
-		VirtualSensor.__init__(self,bus,name)
-		self.setValue("Disabled")
-		bus.add_signal_receiver(self.SystemStateHandler,signal_name = "GotoSystemState")
-
-	def SystemStateHandler(self,state):
-		if (state == "HOST_POWERED_OFF"):
-			self.setValue("Disabled")
-			
-
-	##override setValue method
-	@dbus.service.method(SensorValue.IFACE_NAME,
-		in_signature='v', out_signature='')
-	def setValue(self,value):
-		SensorValue.setValue(self,value)
-			
-	@dbus.service.signal(CONTROL_IFACE,signature='s')
-	def GotoSystemState(self,state):
-		pass
-		
-				
-if __name__ == '__main__':
-	
-	sensors = {
-		'OperatingSystemStatus' : None,
-		'BootCount' : None,
-	}
-	dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
-	bus = Openbmc.getDBus()
-	name = dbus.service.BusName(DBUS_NAME,bus)
-	for instance in sensors.keys():
-		sensors[instance]= VirtualSensor(bus,OBJ_PATH+instance)
-
-	sensors['HostStatus'] = HostStatusSensor(bus,OBJ_PATH+"HostStatus")
-	sensors['BootProgress'] = BootProgressSensor(bus,OBJ_PATH+"BootProgress")
-	sensors['OccStatus'] = OccActiveSensor(bus,OBJ_PATH+"OccStatus")
-	mainloop = gobject.MainLoop()
-   
-	## Initialize sensors 
- 	sensors['HostStatus'].setValue("OFF")
-	sensors['OperatingSystemStatus'].setValue("OFF")
-	sensors['BootCount'].setValue(0)
-
-	print "Starting virtual sensors"
-	mainloop.run()
-
diff --git a/bin/system_manager.py b/bin/system_manager.py
index e03cced..63e2319 100755
--- a/bin/system_manager.py
+++ b/bin/system_manager.py
@@ -27,9 +27,10 @@
 INTF_CONTROL = 'org.openbmc.Control'
 
 
-class SystemManager(Openbmc.DbusProperties):
+class SystemManager(Openbmc.DbusProperties,Openbmc.DbusObjectManager):
 	def __init__(self,bus,obj_name):
 		Openbmc.DbusProperties.__init__(self)
+		Openbmc.DbusObjectManager.__init__(self)
 		dbus.service.Object.__init__(self,bus,obj_name)
 
 		bus.add_signal_receiver(self.NewObjectHandler,
@@ -60,7 +61,7 @@
 			print "Creating cache directory: "+PropertyCacher.CACHE_PATH
    			os.makedirs(PropertyCacher.CACHE_PATH)
 
-		self.ObjectAdded(obj_name,DBUS_NAME)
+		self.InterfacesAdded(obj_name,self.properties)
 		print "SystemManager Init Done"
 
 
@@ -121,7 +122,7 @@
 			obj_path = System.ID_LOOKUP[category][key]
 			bus_name = self.bus_name_lookup[obj_path]
 			parts = obj_path.split('/')
-			if (parts[3] == 'sensor'):
+			if (parts[3] == 'sensors'):
 				intf_name = INTF_SENSOR
 		except Exception as e:
 			print "ERROR SystemManager: "+str(e)+" not found in lookup"
