Use correct id returned from automation add. fix #3050