Get enitity ID after programatically creating one
You can use getIdentifier() method of the wrapper.

$node = entity_create('node', array('type' =&gt; 'person'));
$entity = entity_metadata_wrapper('node',  $node);
$entity-&gt;save();
$entity-&gt;getIdentifier();