     @_api.device().then (devices) =>
       @_devices = devices
       for device in devices
-        nodeClass = switch device.devCat
-          when 1
-            switch device.subCat
-              when 46 then InsteonFanNode
-              else InsteonDimmerNode
-          when 2  then InsteonSwitchNode
-          when 7  then InsteonLowVoltageNode
-          when 16 then InsteonOpenCloseSensorNode
-        if nodeClass?
-          @log 'verbose', "Device ID #{device.id} (#{device.name}) enumerated"
-          node = new nodeClass({id: device.id, hardwareID: device.insteonID},
-            {adapter: this})
-          @children.add node
+        config = @_deviceConfig(device.id)
+        if config.forwardTo?
+          @log 'verbose', "Will forward device ID #{device.id} to " +
+            "device ID #{config.forwardTo}"
+          @_forward[device.id] = config.forwardTo
+        nodeClassName = if config.classify?
+          config.classify
+        else
+          switch device.devCat
+            when 1
+              switch device.subCat
+                when 46 then 'fan'
+                else 'dimmer'
+            when 2  then 'switch'
+            when 7  then 'lowVoltage'
+            when 16 then 'openCloseSensor'
+            else undefined
+        if nodeClassName?
+          nodeClass = INSTEON_DEVICE_CLASSES[nodeClassName]
+          if nodeClass?
+            @log 'verbose', "Device ID #{device.id} (#{device.name}) " +
+              "enumerated as #{nodeClassName}"
+            @children.add new nodeClass({id: device.id, hardwareID:
+              device.insteonID}, {adapter: this})
+          else
+            @log 'error', "Device ID #{device.id} has unknown class " +
+              "#{nodeClassName}"
         else
           @log 'warn', "Device ID #{device.id} has unknown category " +
             "#{device.devCat} subcategory #{device.subCat}"
+
       @hasDiscovered = true
       @setValid true
       if @get('initialStatusCheck') then @requestAllDevicesStatus()

    @log 'verbose', "Received Insteon command: #{JSON.stringify(cmd)}"
    @_resetStreamCycle()
    node = @children.find(hardwareID: cmd.device_insteon_id)
    proxyFor = @get('proxyDevices')[node?.id]
    if proxyFor?
      node = @children.get(proxyFor)
      if node?
        @log 'verbose', "...proxied to #{node.id}"
      else
        @log 'warn', "Proxy target device #{proxyFor} does not exist!"
    if node?
      @log 'verbose', "Dispatching #{cmd.status} command to node #{node.id}"
      switch node.interfaceType # XXX There's a better way to dispatch these

_ = require('underscore')
InsteonAPI = require('insteon-api')
Adapter = require('../../Adapter')

INSTEON_DEVICE_CLASSES =
  dimmer:          require('./InsteonDimmerNode')
  switch:          require('./InsteonSwitchNode')
  fan:             require('./InsteonFanNode')
  lowVoltage:      require('./InsteonLowVoltageNode')
  openCloseSensor: require('./InsteonOpenCloseSensorNode')

module.exports = class InsteonAdapter extends Adapter
  name: "Insteon Cloud"
