How to get entity id of newly created entity using entity_get_controller
Assuming id is the name of your ID entity key, use this after the save:

$id = $entity-&gt;id;


You also have the option of using entity_extract_keys if you want to do it more generically:

list($id, $vid, $bundle) = entity_extract_ids($entity_type, $entity);